source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLEVREP.m@ 1608

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

initial load of WorldVistAEHR

File size: 6.8 KB
RevLine 
[613]1HLEVREP ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
2 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
3 ;
4SHOWONE ; Show entry in any Event Monitoring file...
5 ;
6 ;
7CTRL ;
8 ;
9 D HD
10 D EX
11 F Q:(IOSL-$Y)<4 W !
12 QUIT:$$BTE^HLCSMON("Press RETURN to continue, '^' to exit... ") ;->
13CTRL1 D HD
14 W !!,"You must now select one of the following files..."
15 S FILE=$$FILE QUIT:FILE'>0 ;->
16 W !
17 D @("SHOW"_FILE)
18 G CTRL1 ;->
19 ;
20 ;
21 ;
22SHOW7761 ; Show HL7 Monitor (#776.1) entries...
23 N DIC,IEN
24 D HDR("View 'HL7 Monitor file (#776.1)' Entries")
25 ;
26S7761 KILL DIC,IEN
27 W !
28 S IEN=$$ASKIEN(776.1) QUIT:IEN'>0 ;->
29 W !!,"Loading report..."
30 D LOAD7761(IEN)
31 D BROWSE^DDBR($NA(^TMP($J,"HL7761")),"N","View 'HL7 Monitor file (#776.1)' Entries")
32 KILL ^TMP($J,"HL7761")
33 G S7761 ;->
34 ;
35LOAD7761(IEN) ; Load browswer global...
36 KILL ^TMP($J,"HL7761")
37 D BODY7761(IEN)
38 D RUNS7761(IEN)
39 Q
40 ;
41RUNS7761(EVIEN) ;
42 N DATA,IEN,LASTDT,RUNS
43 ;
44 KILL ^TMP($J,"HLRUNS")
45 ;
46 ; Loop thru master job runs looking for event monitor checks...
47 S LASTDT=":",RUNS=0
48 F S LASTDT=$O(^HLEV(776.2,"B",LASTDT),-1) Q:'LASTDT!(RUNS>6) D
49 . S IEN=":"
50 . F S IEN=$O(^HLEV(776.2,"B",+LASTDT,IEN),-1) Q:'IEN!(RUNS>6) D
51 . . S MIEN=$O(^HLEV(776.2,+IEN,51,"B",EVIEN,0)) QUIT:MIEN'>0 ;->
52 . . S DATA=$G(^HLEV(776.2,+IEN,51,MIEN,0))
53 . . S ^TMP($J,"HLRUNS",IEN)=$P(DATA,U,2)_U_$P(DATA,U,3) ; STATUS^TIME
54 . . S RUNS=RUNS+1
55 ;
56 ; If none found...
57 QUIT:'$D(^TMP($J,"HLRUNS")) ;->
58 ;
59 ; Recent master job checks of monitor...
60 D ADD7761(""),ADD7761("Recent Master Job Checks of this Monitor")
61 D ADD7761($$REPEAT^XLFSTR("-",74))
62 S IEN=0
63 F S IEN=$O(^TMP($J,"HLRUNS",IEN)) Q:'IEN D
64 . S DATA=^TMP($J,"HLRUNS",IEN)
65 . D ADD7761($E($$SDT^HLEVX001($P(DATA,U,2))_$$REPEAT^XLFSTR(" ",17),1,17)_" "_$$STAT2M^HLEVX001($P(DATA,U)))
66 ;
67 Q
68 ;
69BODY7761(IEN) ; Actual display code for entry...
70 N NODE,P1,P2,P3,P4,P5,P6,PAR,PCE
71 ;
72 S NODE=$G(^HLEV(776.1,+IEN,0))
73 F PCE=1:1:6 S @("P"_PCE)=$P(NODE,U,PCE)
74 ;
75 ; Store under field number...
76 F PCE=1:1:8 S PAR(PCE)=$P($G(^HLEV(776.1,+IEN,40)),U,PCE)
77 ;
78 D SH7761("Monitor",$S(P1]"":P1,1:"---"))
79 D SH7761("Description",$S(P3]"":P3,1:"---"))
80 D SH7761("Status",$S(P2="A":"ACTIVE",1:"INACTIVE"))
81 D SH7761("Requeue minutes",$S(P4:P4_"min",P4=0:"0 [Immediate Run]",1:"---"))
82 D SH7761("M startup",$S(P6]"":P6,1:"---"))
83 D XMYS(+IEN)
84 W !,$$CJ^XLFSTR(" Parameter ""Variable"" Descriptors ",IOM,"-")
85 F PCE=1:1:8 I PAR(PCE)]"" D
86 . W !,?25,"Parameter - "_PCE_" = ",PAR(PCE)
87 ;
88 D SHWP(776.1,IEN,41,"Parameter Notes")
89 D SHWP(776.1,IEN,50,"Event Description")
90 ;
91 Q
92 ;
93XMYS(HLEVIENE) ; Add XMYs from monitor...
94 N REC,TAG,XMY
95 D ADDXMYS^HLEVAPI2(+HLEVIENE) QUIT:'$D(XMY) ;->
96 S VAL=""
97 F S VAL=$O(XMY(VAL)) Q:VAL']"" D
98 . I VAL["@" S REC(VAL)="" QUIT ;->
99 . I VAL=+VAL S VAL=$P($G(^VA(200,+VAL,0)),U) S:VAL]"" REC(VAL)="" QUIT ;->
100 . I $E(VAL,1,2)="G." S REC(VAL)=""
101 KILL XMY
102 QUIT:'$D(REC) ;->
103 S VAL=""
104 S TAG=$E(" Recipients: ",1,35)
105 F S VAL=$O(REC(VAL)) Q:VAL']"" D
106 . S TAG=TAG_VAL
107 . D ADD7761(TAG)
108 . S TAG=$$REPEAT^XLFSTR(" ",35)
109 Q
110 ;
111SHWP(FILE,IEN,HLN,TAG) ;
112 N MIEN,TXT
113 QUIT:$O(^HLEV(FILE,+IEN,HLN,0))'>0 ;-> No data...
114 S TXT=$$CJ^XLFSTR(" "_TAG_" ",IOM,"-")
115 D ADD7761(TXT)
116 S MIEN=0
117 F S MIEN=$O(^HLEV(FILE,+IEN,HLN,MIEN)) Q:MIEN'>0 D
118 . D ADD7761(^HLEV(FILE,+IEN,HLN,MIEN,0))
119 Q
120 ;
121SH7761(TAG,VAL) ;
122 N TXT
123 S TXT=$E($$REPEAT^XLFSTR(" ",80),1,(32-$L(TAG)-2))_TAG_":"
124 S TXT=$E(TXT_$$REPEAT^XLFSTR(" ",45),1,35)_VAL
125 D ADD7761(TXT)
126 Q
127 ;
128ADD7761(TXT) ; Add TXT to browser global...
129 N NO
130 S NO=$O(^TMP($J,"HL7761",":"),-1)+1
131 S ^TMP($J,"HL7761",+NO)=TXT
132 Q
133 ;
134SHOW776 ; Show HL7 Monitor Job (#776) entries...
135 N DIC,IEN
136S776 KILL DIC,IEN
137 S IEN=$$ASKIEN(776) QUIT:IEN'>0 ;->
138 D VIEW776(+IEN)
139 W !,$$REPEAT^XLFSTR("-",IOM)
140 G S776 ;->
141 ;
142VIEW776(IEN) ; Actual display code for entry...
143 ;
144 W !!,"View Code to be placed here..."
145 Q
146 ;
147 ;
148SHOW7762 ; Show HL7 Monitor Master Job (#776.2) entries...
149 N DIC,IEN
150S7762 KILL DIC,IEN
151 S IEN=$$ASKIEN(776.2) QUIT:IEN'>0 ;->
152 D VIEW7762(+IEN)
153 W !,$$REPEAT^XLFSTR("-",IOM)
154 G S7762 ;->
155 ;
156VIEW7762 ; Actual display code for entry...
157 ;
158 W !!,"View Code to be placed here..."
159 Q
160 ;
161 ;
162SHOW7769 ; Show HL7 Monitor Parameters (#776.999) entries...
163 D VIEW7769(1)
164 W !,$$REPEAT^XLFSTR("-",IOM)
165 Q
166 ;
167VIEW7769(BT) ; Actual display code for entry...
168 N DATA,NODE,P1,P2,P3,P4,P5,P6,PCE,TAG,VAL
169 ;
170 S NODE=$G(^HLEV(776.999,1,0)) I NODE']"" D QUIT ;->
171 . W !,"No system entry exists..."
172 ;
173 F PCE=1:1:6 S @("P"_PCE)=$P(NODE,U,PCE)
174 ;
175 S NODE(1)=P1_U_"Name"
176 S NODE(2)=$S(P2="A":"ACTIVE",1:"INACTIVE")_U_"Status - MASTER"
177 S NODE(3)=P3_"min"_U_"Requeue minutes - MASTER"
178 S NODE(4)=P4_"hr"_U_"Purge hours - RUNTIME DATA"
179 S NODE(6)=$S(P6="A":"ACTIVE",1:"INACTIVE")_U_"Status - EVENT"
180 ;
181 W @IOF,$$CJ^XLFSTR("System Parameters",IOM)
182 W !,$$REPEAT^XLFSTR("=",IOM)
183 ;
184 F PCE=1,"Status Fields",2,6,"Requeue Frequency for Master Job",3,"Purge Parameters (""Cutoff"" hours)",4 D
185 . I PCE'=+PCE D QUIT ;->
186 . . W !!,$$CJ^XLFSTR(PCE,IOM)
187 . . W !,$$CJ^XLFSTR($$REPEAT^XLFSTR("-",$L(PCE)+20),IOM)
188 . S DATA=NODE(PCE),VAL=$P(DATA,U),TAG=$P(DATA,U,2)
189 . S DATA=TAG_": "_VAL
190 . W !,$$CJ^XLFSTR(DATA,IOM)
191 ;
192 I $G(BT) D TELL^HLEVMST0("","0^0^999")
193 ;
194 Q
195 ;
196 ;
197ASKIEN(FILE,HLAYGO) ; Generic DIC lookup...
198 N DIC,X,Y
199 S DIC=FILE,DIC(0)="AEMQN"_$G(HLAYGO)
200 S DIC("A")="Select "_$S(FILE=776:"EVENT ""RUN"" ENTRY",FILE=776.1:"EVENT MONITOR ENTRY",FILE=776.2:"MASTER JOB ""RUN"" ENTRY",FILE=776.999:"PARAMETER ENTRY",1:"??")_": "
201 D ^DIC
202 Q $S(+Y>0:+Y,1:"")
203 ;
204FILE() ; Get from user file to display information...
205 N ANS,DIR,DIRUT,DTOUT,DUOUT,X,Y
206 S DIR(0)="SO^1:HL7 Monitor file (#776.1);2:HL7 Monitor Parameters file (#776.999);3:HL7 Monitor Job file (#776);4:HL7 Monitor Master Job file (#776.2);5:Exit this option"
207 S DIR("A")="Select OPTION"
208 D ^DIR
209 S ANS=+Y\1,ANS=$S(ANS>0&(ANS<5):+ANS,1:"")
210 S ANS=$S(ANS:$P("7761^7769^776^7762",U,+ANS),1:"")
211 Q ANS
212 ;
213HD W @IOF,$$CJ^XLFSTR("Display Event Monitoring Entries",IOM)
214 W !,$$REPEAT^XLFSTR("=",IOM)
215 QUIT
216 ;
217EX N I,T F I=1:1 S T=$T(EX+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
218 ;; This option displays entries from the following files:
219 ;;
220 ;; SETUP-RELATED FILES
221 ;; ----------------------------------------------------
222 ;; HL7 Monitor file (#776.1)
223 ;; HL7 Monitor Parameters file (#776.999)
224 ;;
225 ;; RUNTIME-RELATED FILES
226 ;; ----------------------------------------------------
227 ;; HL7 Monitor Job file (#776)
228 ;; HL7 Monitor Master Job file (#776.2)
229 Q
230 ;
231HDR(TXT,IEN) W @IOF,$$CJ^XLFSTR(TXT,IOM)
232 N IOINHI,IOINORM,NAME,X,Y
233 I $G(IEN) D
234 . S X="IOINHI;IOINORM" D ENDR^%ZISS
235 . S NAME=$P($G(^HLEV(776.1,+IEN,0)),U)
236 . W !,$$CJ^XLFSTR(IOINHI_NAME_" [#"_IEN_"]"_IOINORM,IOM)
237 W !,$$REPEAT^XLFSTR("=",IOM)
238 Q
239 ;
240EOR ;HLEVREP - Event Monitor REPORTS ;5/16/03 14:42
Note: See TracBrowser for help on using the repository browser.