source: FOIAVistA/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLOUSR.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 9.5 KB
Line 
1HLOUSR ;ALB/CJM -ListManager Screen for viewing system status;12 JUN 1997 10:00 am ;07/30/2007
2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,134,137**;Oct 13, 1995;Build 21
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5EN ;
6 ;
7 N HLSCREEN,TESTOPEN,HLRFRSH,HLPARMS
8 D WAIT^DICD
9 D EN^VALM("HLO SYSTEM MONITOR")
10 Q
11 ;
12BRIEF ;
13 N COUNT,LINK,QUE,FROM,TIME,STATUS,TEMP,DIR,TODAY,LIST
14 S HLRFRSH="BRIEF^HLOUSR"
15 S (HLSCREEN,VALMSG)="Brief System Status"
16 S VALMCNT=16
17 ;K @VALMAR
18 D CLEAN^VALM10
19 S VALMBG=1
20 S VALMBCK="R"
21 S VALMDDF("COL 1")="COL1^1^80^"
22 K VALMDDF("COL 2"),VALMDDF("COL 3"),VALMDDF("COL 4"),VALMDDF("COL 5")
23 D CHGCAP^VALM("COL 1"," Brief Operational Overview")
24 S @VALMAR@(1,0)="SYSTEM STATUS: "_$S($$CHKSTOP^HLOPROC:"STOPPED",1:"RUNNING")
25 S @VALMAR@(2,0)="PROCESS MANAGER: "_$S($$RUNNING:"RUNNING",1:"STOPPED")
26 ;
27 S TIME=$P($G(TESTOPEN("LISTENER")),"^",2)
28 I TIME,$$FMDIFF^XLFDT($$NOW^XLFDT,TIME,2)<300 D
29 .S STATUS=+TESTOPEN("LISTENER")
30 E D
31 .S STATUS=0
32 .S LINK=$P($G(^HLD(779.1,1,0)),"^",10)
33 .I LINK S LINK=$P($G(^HLCS(870,LINK,0)),"^") Q:'$L(LINK) S STATUS=$$IFOPEN^HLOUSR1(LINK)
34 .S TESTOPEN("LISTENER")=STATUS_"^"_$$NOW^XLFDT
35 ;
36 S @VALMAR@(3,0)="STANDARD LISTENER: "_$S(STATUS:"OPERATIONAL",1:"NOT OPERATIONAL")
37 ;
38 S @VALMAR@(4,0)="TASKMAN: "_$S($$TM^%ZTLOAD:"RUNNING",1:"NOT RUNNING")
39 ;
40 S (LIST,LINK)=""
41 F S LINK=$O(^HLTMP("FAILING LINKS",LINK)) Q:LINK="" D I $L(LIST)>60 S LIST=LIST_",..." Q
42 .N TIME,QUE,LINKARY
43 .I $$GETLINK^HLOTLNK($P(LINK,":"),.LINKARY)
44 .S TIME=$G(^HLTMP("FAILING LINKS",LINK)) Q:TIME=""
45 .I '$G(LINKARY("SHUTDOWN")),TIME="" Q
46 .I '$G(LINKARY("SHUTDOWN")),($$HDIFF^XLFDT($H,TIME,2)<300) Q
47 .S LIST=LIST_$S($L(LIST):", ",1:"")_$P(LINK,":")
48 S @VALMAR@(5,0)="DOWN LINKS: "_LIST
49 S @VALMAR@(6,0)="CLIENT LINK PROCESSES: "_+$G(^HLC("HL7 PROCESS COUNTS","RUNNING","OUTGOING CLIENT LINK"))
50 S @VALMAR@(7,0)="IN-FILER PROCESSES: "_+$G(^HLC("HL7 PROCESS COUNTS","RUNNING","INCOMING QUEUES"))
51 S COUNT=0,LINK=""
52 F S LINK=$O(^HLC("QUEUECOUNT","OUT",LINK)) Q:LINK="" D
53 .S QUE=""
54 .F S QUE=$O(^HLC("QUEUECOUNT","OUT",LINK,QUE)) Q:QUE="" D
55 ..S TEMP=$G(^HLC("QUEUECOUNT","OUT",LINK,QUE))
56 ..S:TEMP>0 COUNT=COUNT+TEMP
57 S @VALMAR@(8,0)="MESSAGES PENDING ON OUT QUEUES: "_$$RJ(+COUNT,7)_" ON SEQUENCE QUEUES: "_$$RJ(+$G(^HLC("QUEUECOUNT","SEQUENCE")),7)
58 S TEMP="STOPPED OUTGOING QUEUES: "
59 S COUNT=0,QUE=""
60 F S QUE=$O(^HLTMP("STOPPED QUEUES","OUT",QUE)) Q:QUE="" S COUNT=COUNT+1 Q:COUNT>4 S:COUNT=1 TEMP=TEMP_QUE S:"23"[COUNT TEMP=TEMP_"; "_QUE S:COUNT=4 TEMP=TEMP_" ..."
61 S @VALMAR@(9,0)=TEMP
62 S COUNT=0,QUE=""
63 F S QUE=$O(^HLC("QUEUECOUNT","IN",QUE)) Q:QUE="" D
64 .S FROM=""
65 .F S FROM=$O(^HLC("QUEUECOUNT","IN",QUE,FROM)) Q:FROM="" D
66 ..S TEMP=$G(^HLC("QUEUECOUNT","IN",QUE,FROM))
67 ..S:TEMP>0 COUNT=COUNT+TEMP
68 S @VALMAR@(10,0)="MESSAGES PENDING ON APPLICATIONS: "_$$RJ(+COUNT,7)
69 S TEMP="STOPPED INCOMING QUEUES: "
70 S COUNT=0,QUE=""
71 F S QUE=$O(^HLTMP("STOPPED QUEUES","IN",QUE)) Q:QUE="" S COUNT=COUNT+1 Q:COUNT>4 S:COUNT=1 TEMP=TEMP_QUE S:"23"[COUNT TEMP=TEMP_"; "_QUE S:COUNT=4 TEMP=TEMP_" ..."
72 S @VALMAR@(11,0)=TEMP
73 S @VALMAR@(12,0)="FILE 777 RECORD COUNT: "_$$RJ($P($G(^HLTMP("FILE 777 RECORD COUNT")),"^"),10)_" --> as of "_$$FMTE^XLFDT($P($G(^HLTMP("FILE 777 RECORD COUNT")),"^",2))
74 S @VALMAR@(13,0)="FILE 778 RECORD COUNT: "_$$RJ($P($G(^HLTMP("FILE 778 RECORD COUNT")),"^"),10)_" --> as of "_$$FMTE^XLFDT($P($G(^HLTMP("FILE 778 RECORD COUNT")),"^",2))
75 S TODAY=$$DT^XLFDT
76 S @VALMAR@(14,0)="MESSAGES SENT TODAY: "_$$RJ($$ADD("OUT"),10)
77 S @VALMAR@(15,0)="MESSAGES RECEIVED TODAY: "_$$RJ($$ADD("IN"),10)
78 S @VALMAR@(16,0)="MESSAGE ERRORS TODAY: "_$$RJ($$ADD("EOUT")+$$ADD("EIN"),10)
79 Q
80ADD(DIR) ;
81 N RAP,SAP,TIME,TOTAL
82 S TOTAL=0
83 S TIME=TODAY-.0001
84 F S TIME=$O(^HLSTATS(DIR,"HOURLY",TIME)) Q:'TIME Q:((TIME\1)>TODAY) D
85 .S SAP=""
86 .F S SAP=$O(^HLSTATS(DIR,"HOURLY",TIME,SAP)) Q:SAP="" D
87 ..Q:SAP="ACCEPT ACK"
88 ..S RAP=""
89 ..F S RAP=$O(^HLSTATS(DIR,"HOURLY",TIME,SAP,RAP)) Q:RAP="" D
90 ...S TYPE=""
91 ...F S TYPE=$O(^HLSTATS(DIR,"HOURLY",TIME,SAP,RAP,TYPE)) Q:TYPE="" D
92 ....S TOTAL=TOTAL+$G(^HLSTATS(DIR,"HOURLY",TIME,SAP,RAP,TYPE))
93 Q TOTAL
94 ;
95HELP ;
96 S X="?" D DISP^XQORM1 W !!
97 Q
98 ;
99EXIT ;
100 D CLEAN^VALM10
101 D CLEAR^VALM1
102 Q
103 ;
104EXPND ;
105 Q
106 ;
107PROCS ;
108 S HLRFRSH="PROCS^HLOUSR"
109 ;K @VALMAR
110 D CLEAN^VALM10
111 S VALMCNT=0
112 S VALMBCK="R"
113 S VALMDDF("COL 1")="COL1^1^34^"
114 S VALMDDF("COL 2")="COL 2^35^10^MIN^H"
115 S VALMDDF("COL 3")="COL 3^47^10^MAX^H"
116 S VALMDDF("COL 4")="COL 4^59^10^#RUNNING^H"
117 S VALMDDF("COL 5")="COL 5^71^10^#QUEUED^IOBON"
118 D CHGCAP^VALM("COL 1","Process Type")
119 N IEN
120 S IEN=0
121 F S IEN=$O(^HLD(779.3,"C",1,IEN)) Q:'IEN D
122 .N PROC
123 .Q:'$$GETPROC^HLOPROC1(IEN,.PROC)
124 .Q:PROC("NAME")="VMS TCP LISTENER"
125 .S VALMCNT=VALMCNT+1
126 .S @VALMAR@(VALMCNT,0)=$$LJ(PROC("NAME"),30)_$$RJ(PROC("MINIMUM"),6)_$$RJ(PROC("MAXIMUM"),12)_$$RJ(+$G(^HLC("HL7 PROCESS COUNTS","RUNNING",PROC("NAME"))),14)_$$RJ(+$G(^HLC("HL7 PROCESS COUNTS","QUEUED",PROC("NAME"))),12)
127 S VALMCNT=VALMCNT+1,@VALMAR@(VALMCNT,0)=""
128 S IEN=""
129 F S IEN=$O(^HLTMP("HL7 RUNNING PROCESSES",IEN)) Q:IEN="" D
130 .N NODE
131 .S NODE=$G(^HLTMP("HL7 RUNNING PROCESSES",IEN))
132 .Q:NODE=""
133 .S VALMCNT=VALMCNT+1
134 .S @VALMAR@(VALMCNT,0)="$J: "_$$LJ(IEN,9)_" ->"_$$CJ($P(NODE,"^",3),28)_"<- started at "_$$HTE^XLFDT($P(NODE,"^"))
135 Q
136 ;
137OUTQUEUE ;
138 N LINK
139 D CLEAN^VALM10
140 ;K @VALMAR
141 S HLRFRSH="OUTQUEUE^HLOUSR"
142 S (HLSCREEN,VALMSG)="Outgoing Queues *down links !stopped queues"
143 S VALMCNT=0
144 S VALMBCK="R"
145 S VALMDDF("COL 1")="COL 1^2^20^ Link^H"
146 S VALMDDF("COL 2")="COL 2^28^20^Queue^H"
147 S VALMDDF("COL 3")="COL 3^50^20^Count^H"
148 K VALMDDF("COL 4"),VALMDDF("COL 5")
149 D CHGCAP^VALM("COL 1"," Link")
150 S LINK=""
151 F S LINK=$O(^HLC("QUEUECOUNT","OUT",LINK)) Q:LINK="" D
152 .N COUNT,QUE,SHOW
153 .S SHOW=LINK
154 .I $D(^HLTMP("FAILING LINKS",SHOW)) S SHOW="*"_SHOW
155 .S QUE=""
156 .F S QUE=$O(^HLC("QUEUECOUNT","OUT",LINK,QUE)) Q:QUE="" D
157 ..S COUNT=$G(^HLC("QUEUECOUNT","OUT",LINK,QUE))
158 ..Q:COUNT<1
159 ..S VALMCNT=VALMCNT+1
160 ..I $E(SHOW)="*" D
161 ...S @VALMAR@(VALMCNT,0)=$$LJ(SHOW,20)_$$CJ($S($$STOPPED^HLOQUE("OUT",QUE):"!",1:"")_QUE,21)_" "_$$RJ(COUNT,10),SHOW=""
162 ...D CNTRL^VALM10(VALMCNT,1,1,IOBON,IOBOFF)
163 ..E S @VALMAR@(VALMCNT,0)=$$LJ(SHOW,20)_$$CJ($S($$STOPPED^HLOQUE("OUT",QUE):"!",1:"")_QUE,21)_" "_$$RJ(COUNT,10),SHOW=""
164 Q
165 ;
166INQUEUE ;
167 N FROM
168 D CLEAN^VALM10
169 ;K @VALMAR
170 S HLRFRSH="INQUEUE^HLOUSR"
171 S (HLSCREEN,VALMSG)="Incoming Queues ('!' = stopped queues)"
172 S VALMCNT=0
173 S VALMBCK="R"
174 S VALMDDF("COL 1")="COL 1^1^40^ From^H"
175 S VALMDDF("COL 2")="COL 2^45^20^Queue^H"
176 S VALMDDF("COL 3")="COL 3^70^10^Count^H"
177 K VALMDDF("COL 4"),VALMDDF("COL 5")
178 D CHGCAP^VALM("COL 1"," From")
179 S FROM=""
180 F S FROM=$O(^HLC("QUEUECOUNT","IN",FROM)) Q:FROM="" D
181 .N COUNT,QUE,SHOW
182 .S SHOW=$$LJ(FROM,40)_" "
183 .S QUE=""
184 .F S QUE=$O(^HLC("QUEUECOUNT","IN",FROM,QUE)) Q:QUE="" D
185 ..S COUNT=$G(^HLC("QUEUECOUNT","IN",FROM,QUE))
186 ..Q:COUNT<0
187 ..S VALMCNT=VALMCNT+1
188 ..S @VALMAR@(VALMCNT,0)=SHOW_$$LJ($S($$STOPPED^HLOQUE("IN",QUE):"!",1:"")_QUE,21)_" "_$$RJ(COUNT,10)
189 ..S SHOW=$$LJ("",40)_" "
190 Q
191VIEWLINK ;
192 N C,QUIT,LINK,LINKARY,TEMP
193 S (QUIT,C,LINK)=""
194 S VALMBCK="R"
195 ;
196 ;currently HL7 (Optimized) only does TCP
197 S LINK=$$ASKLINK
198 Q:LINK=""
199 Q:'$$GETLINK^HLOTLNK(LINK,.LINKARY)
200 S LINK=LINK_":"_LINKARY("PORT")
201 W !,"Hit any key to stop...",!
202 F D Q:QUIT
203 .N COUNT,QUE
204 .S (COUNT,QUE)=""
205 .F S QUE=$O(^HLC("QUEUECOUNT","OUT",LINK,QUE)) Q:QUE="" S TEMP=$G(^HLC("QUEUECOUNT","OUT",LINK,QUE)) S:TEMP>0 COUNT=COUNT+TEMP
206 .W $C(13)," ",$C(13),"MESSAGES PENDING TRANSMISSION: ",IOBON,$$RJ(+COUNT,10),IOBOFF
207 .R *C:1 I $T S QUIT=1
208 Q
209 ;
210CJ(STRING,LEN) ;
211 Q $$CJ^XLFSTR($E(STRING,1,LEN),LEN)
212LJ(STRING,LEN) ;
213 Q $$LJ^XLFSTR($E(STRING,1,LEN),LEN)
214RJ(STRING,LEN) ;
215 Q $$RJ^XLFSTR($E(STRING,1,LEN),LEN)
216 ;
217RUNNING() ;Process Manager running?
218 N RUNNING
219 L +^HLTMP("PROCESS MANAGER"):0
220 S RUNNING='$T
221 I 'RUNNING L -^HLTMP("PROCESS MANAGER")
222 Q RUNNING
223 ;
224TESTLINK ;
225 N LINK,LINKNAME,OK
226 S VALMBCK="R"
227 S LINKNAME=$$ASKLINK
228 Q:LINKNAME=""
229 S OK=$$IFOPEN^HLOUSR1(LINKNAME)
230 I OK W !,LINKNAME_" IS operational..."
231 E W !,LINKNAME_" is NOT operational..."
232 W !,"Hit any key to continue..."
233 R *C:DTIME
234 Q
235 ;
236ASKLINK() ;
237 N DIC,TCP,X,Y,DTOUT,DUOUT
238 S DIC=870
239 S DIC(0)="AENQ"
240 S TCP=$O(^HLCS(869.1,"B","TCP",0))
241 S DIC("A")="Select a TCP link:"
242 S DIC("S")="I $P(^(0),U,3)=TCP"
243 D FULL^VALM1
244 D ^DIC
245 I +Y'=-1,'$D(DTOUT),'$D(DUOUT) Q $P(Y,"^",2)
246 Q ""
247 ;
248STOP ;
249 I '$$ASKYESNO^HLOUSR2("Are you SURE that you want to stop sending and receiving messages","NO") S VALMBCK="" Q
250 ;
251 D STOPHL7^HLOPROC1
252 S VALMBCK="R",VALMSG="HL7 (Optimized) has been stopped...."
253 H 5
254 D @HLRFRSH
255 ;D:HLSCREEN="Brief System Status" BRIEF^HLOUSR
256 ;D:HLSCREEN="Running Processes" PROCS^HLOUSR
257 Q
258 ;
259UPDMODE ;realtime
260 Q:'$L(HLRFRSH)
261 N TOP,BOTTOM,DX,DY,IOTM,IOBM,LINE,OLD,OLDCNT
262 S OLDCNT=VALMCNT
263 W !!!!!,IOINHI,"Hit any key to escape realtime display mode...",IOINORM
264 S IOTM=20,IOBM=23 W @IOSTBM
265 S TOP=VALMBG
266 S BOTTOM=TOP+20
267 F LINE=TOP:1:BOTTOM D
268 .I LINE>VALMCNT S @VALMAR@(LINE,0)=$$LJ(" ",80) Q
269 .S @VALMAR@(LINE,0)=$$LJ(@VALMAR@(LINE,0),80)
270 F LINE=TOP:1:BOTTOM D
271 .S OLD(LINE)=@VALMAR@(LINE,0)
272 F LINE=17:1:BOTTOM D
273 .S DX=50,DY=22 X IOXY W !
274 .D WRITE^VALM10(LINE)
275 D F R *C:4 Q:$T D
276 .D @HLRFRSH
277 .F LINE=TOP:1:BOTTOM D
278 ..I LINE>VALMCNT S @VALMAR@(LINE,0)=$$LJ(" ",80) Q
279 ..S @VALMAR@(LINE,0)=$$LJ(@VALMAR@(LINE,0),80)
280 .S VALMCNT=BOTTOM
281 .F LINE=TOP:1:BOTTOM IF OLD(LINE)'=@VALMAR@(LINE,0) D
282 ..S OLD(LINE)=@VALMAR@(LINE,0)
283 ..S DX=50,DY=22 X IOXY W !
284 ..D WRITE^VALM10(LINE)
285 S VALMCNT=OLDCNT
286 S VALMBCK="R"
287 Q
Note: See TracBrowser for help on using the repository browser.