source: WorldVistAEHR/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSOS2.m@ 701

Last change on this file since 701 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1BPSOS2 ;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 ;
16EN ;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 ;
30INIT ; 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
47FETCHES(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 ;
57DIFF ;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 ;
65FETCH58(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 ;
73FETSTAT(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 ;
82UPDFREQ() ;
83 Q 3
84 ;
85CLEARAT() ;
86 S Y=$P(^BPSECX("S",1,0),U,2) X ^DD("DD") Q Y
87 ;
88HDR ; -- header code
89 S VALMHDR(1)="Communications statistics last cleared on "_$$CLEARAT
90 S XQORM("B")="U1" ; Default action is Update
91 Q
92 ;
93UPD ;EP - From BPSOS2A ; Protocol BPS P2 UPDATE
94 D UPDATE(1)
95 S VALMBCK="",XQORM("B")="U1"
96 Q
97 ;
98CONTUPD ; Protocol BPS P2 CONTINUOUS
99 W !!!!!
100 D UPDATE(-1)
101 S VALMBCK=""
102 Q
103 ;
104UPDATE(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 ;
117UPD1 ; 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 ;
125HELP ; -- help code
126 S X="?" D DISP^XQORM1 W !!
127 Q
128 ;
129EXIT ; -- exit code
130 D FULL^VALM1
131 Q
132 ;
133EXPND ; -- expand code
134 Q
Note: See TracBrowser for help on using the repository browser.