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

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

revised back to 6/30/08 version

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