1 | BPSOS2 ;BHAM ISC/FCS/DRS - ECME manager's ScreenMan ;06/01/2004
|
---|
2 | ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
|
---|
3 | ;;Per VHA Directive 2004-038, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | ; ECME Statistics Screen
|
---|
6 | ; Called by option BPS STATISTICS
|
---|
7 | ; Uses List Template BPS STATISTICS AND MANAGEMENT
|
---|
8 | ; Original IHS logic had many management function, which are no
|
---|
9 | ; longer used
|
---|
10 | ;
|
---|
11 | ; ALL writes of screen lines should be done as follows:
|
---|
12 | ; IF $$VISIBLE(line) DO WRITE^VALM10(line)
|
---|
13 | ; Then NODISPLY can be set so that $$VISIBLE always returns FALSE
|
---|
14 | Q
|
---|
15 | ;
|
---|
16 | EN ;EP - Option BPS STATISTICS
|
---|
17 | N BASE,CURR,DISP,AVG,CHG
|
---|
18 | ; BASE(*) = base values, from when zeroed things out
|
---|
19 | ; CURR(*) = current values, from most recent read
|
---|
20 | ; CHG(*) = changed value to print, if any
|
---|
21 | D FETCHES(0) ; fetch stats into CURR() array - possibly reset BASE array
|
---|
22 | M CHG=CURR
|
---|
23 | D DIFF
|
---|
24 | S ^TMP("BPSOS2",$J,"FREQ")=30
|
---|
25 | I $P($G(^BPSECX("S",1,0)),U,2)="" D
|
---|
26 | .N %,%H,%I,X D NOW^%DTC S $P(^BPSECX("S",1,0),U,2)=%
|
---|
27 | D EN^VALM("BPS STATISTICS AND MANAGEMENT")
|
---|
28 | Q
|
---|
29 | ;
|
---|
30 | INIT ; Entry Code - Init variables and list array
|
---|
31 | N NODISPLY S NODISPLY=1
|
---|
32 | D CLEAN^VALM10
|
---|
33 | S VALMCNT=0 ; 0 lines so far
|
---|
34 | D LABELS^BPSOS2C
|
---|
35 | D HDR
|
---|
36 | D FETCHES(1) ; set up CURR
|
---|
37 | M CHG=CURR
|
---|
38 | D DIFF ; compute DIFF = differences and changed ones go into CHG
|
---|
39 | D VALUES^BPSOS2B ; displays whatever's in CHG() and kills it off
|
---|
40 | Q
|
---|
41 | ;
|
---|
42 | ; Define Current (CURR) array and reset BASE
|
---|
43 | ;
|
---|
44 | ; Input variable -> B = 0 Reset (kill) BASE values and retrieve
|
---|
45 | ; values
|
---|
46 | ; 1 Just retrieve current values
|
---|
47 | FETCHES(B) N DST
|
---|
48 | S DST="CURR"
|
---|
49 | S ^TMP("BPSOS2",$J,"$H",DST)=$H
|
---|
50 | D FETCH58(DST_"(""COMM"")")
|
---|
51 | D FETSTAT(DST_"(""STAT"")")
|
---|
52 | ;
|
---|
53 | ;If entering option or resetting permanent values clear base
|
---|
54 | I B=0 K BASE S ^TMP("BPSOS2",$J,"$H","BASE")=$H
|
---|
55 | Q
|
---|
56 | ;
|
---|
57 | DIFF ;EP - from BPSOS2A
|
---|
58 | N A,B S A=""
|
---|
59 | F S A=$O(CURR(A)) Q:A="" S B="" F S B=$O(CURR(A,B)) Q:B="" D
|
---|
60 | .I A="STAT" S CHG(A,B)=CURR(A,B)
|
---|
61 | .I A="COMM" S CHG(A,B)=CURR(A,B)-$G(BASE(A,B))
|
---|
62 | ;
|
---|
63 | Q
|
---|
64 | ;
|
---|
65 | FETCH58(DST) ; send DST = closed root of the destination
|
---|
66 | K @DST
|
---|
67 | N FN,DIC,DR,DA,DIQ,TMP ; note that DA=1 is hardcoded
|
---|
68 | S (FN,DIC)=9002313.58,DR="200:219",DIQ="TMP(",DA=1
|
---|
69 | D EN^DIQ1
|
---|
70 | M @DST=TMP(FN,1)
|
---|
71 | Q
|
---|
72 | ;
|
---|
73 | FETSTAT(DEST) ;
|
---|
74 | ; send DEST = closed root of the destination
|
---|
75 | K @DEST
|
---|
76 | N Q,N,A F Q=0:10:90,31 D
|
---|
77 | .S A="" F N=0:1 S A=$O(^BPST("AD",Q,A)) Q:A=""
|
---|
78 | . I Q#10 S @DEST@(Q\10*10)=@DEST@(Q\10*10)+N
|
---|
79 | . E S @DEST@(Q)=N ; relies on multiples of 10 coming first!
|
---|
80 | Q
|
---|
81 | ;
|
---|
82 | UPDFREQ() ;
|
---|
83 | Q 3
|
---|
84 | ;
|
---|
85 | CLEARAT() ;
|
---|
86 | S Y=$P(^BPSECX("S",1,0),U,2) X ^DD("DD") Q Y
|
---|
87 | ;
|
---|
88 | HDR ; -- header code
|
---|
89 | S VALMHDR(1)="Communications statistics last cleared on "_$$CLEARAT
|
---|
90 | S XQORM("B")="U1" ; Default action is Update
|
---|
91 | Q
|
---|
92 | ;
|
---|
93 | UPD ;EP - From BPSOS2A ; Protocol BPS P2 UPDATE
|
---|
94 | D UPDATE(1)
|
---|
95 | S VALMBCK="",XQORM("B")="U1"
|
---|
96 | Q
|
---|
97 | ;
|
---|
98 | CONTUPD ; Protocol BPS P2 CONTINUOUS
|
---|
99 | W !!!!!
|
---|
100 | D UPDATE(-1)
|
---|
101 | S VALMBCK=""
|
---|
102 | Q
|
---|
103 | ;
|
---|
104 | UPDATE(COUNTER) ; with COUNTER = a count down
|
---|
105 | N STOP,DTOUT
|
---|
106 | F D Q:$G(STOP)
|
---|
107 | .D UPD1
|
---|
108 | .S COUNTER=COUNTER-1 I 'COUNTER S STOP=1 Q
|
---|
109 | .I '$G(NODISPLY) D
|
---|
110 | ..D MSG^VALM10("In continuous update mode: press Q to Quit")
|
---|
111 | ..N X S X=$$READ^XGF(1,$$UPDFREQ) D MSG^VALM10(" ")
|
---|
112 | ..I '$G(DTOUT),X]"","Qq^^"[X S STOP=1
|
---|
113 | ..N Y F R Y:0 Q:'$T ; clean out typeahead (like mistaken arrow keys)
|
---|
114 | ..; But if timed out, keep looping and updating
|
---|
115 | Q
|
---|
116 | ;
|
---|
117 | UPD1 ; one update cycle
|
---|
118 | N A,B,T
|
---|
119 | D HDR,RE^VALM4
|
---|
120 | D FETCHES(1) ; fetch into CURR array
|
---|
121 | D DIFF ; compute differences
|
---|
122 | D VALUES^BPSOS2B ; compute values and display if changed
|
---|
123 | Q
|
---|
124 | ;
|
---|
125 | HELP ; -- help code
|
---|
126 | S X="?" D DISP^XQORM1 W !!
|
---|
127 | Q
|
---|
128 | ;
|
---|
129 | EXIT ; -- exit code
|
---|
130 | D FULL^VALM1
|
---|
131 | Q
|
---|
132 | ;
|
---|
133 | EXPND ; -- expand code
|
---|
134 | Q
|
---|