INHOQR ; FRW/JMB ; 24 Aug 95 14:10; Show GIS queue status
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
;
EN ;Main entry point
;NEW statements
;
N %,%ZIS,Q,POP,INTASKED,INPAR
N ZTDESC,ZTIO,ZTRTN,ZTSAVE
;
;Get report parameters
Q:'$$PAR
;
;Background flag
S INTASKED=0
;Get device
W ! K IOP S %ZIS("A")="QUEUE ON DEVICE: ",%ZIS("B")="",%ZIS="NQ" D ^%ZIS G:POP EXIT^INHOQR1
S IOP=ION_";"_IOST_";"_IOM_";"_IOSL
;User did not select their own device, force queue to taskman
I IO=IO(0) S %ZIS="" D ^%ZIS I POP W *7,!,"Sorry, unable to find device..." G EXIT^INHOQR1
I IO'=IO(0) D G EXIT^INHOQR1
. S INTASKED=1,ZTDESC="GIS Queue Status",ZTIO=IOP,ZTRTN="ENZTSK^INHOQR1"
. F X="INPAR(","INTASKED" S ZTSAVE(X)=""
. D ^%ZTLOAD
;
;Go to compilation and display module
G ENZTSK^INHOQR1
;
Q
;
PAR() ;User parameters
;OUTPUT:
; INPAR - array of report parameters
; function - user did not abort ( 0 - no ; 1 - yes )
;
K INPAR
S INPAR("DETAIL")=1 ;detailed report
S INPAR("REPAINT")=5 ;repaint frequency
S INPAR("RUNTOEND")=0 ;always run to end of queues
S INPAR("MAXREPTIME")=1800 ;max time to spend in one rpeort scan
S INPAR("MAXQTIME")=INPAR("MAXREPTIME") ;max time to spend scanning a queue
S INPAR("ITER")=100 ;number of report scans to run (printer)
S INPAR("FUTURE")=0 ;report future tasks
;S INPAR("GRAPH")=0 ;single graph output
;
;Quit if user accepts default paramters
S %=$$RD^INHUTS1("Modify default paramters") Q:'% %'=U W !
S INPAR("DETAIL")=$$RD^INHUTS1("Detailed report",INPAR("DETAIL")) Q:INPAR("DETAIL")=U 0
S INPAR("REPAINT")=$$RD^INHUTS1("Repaint Frequency (sec)",INPAR("REPAINT"),"0,3600") Q:INPAR("REPAINT")=U 0
S INPAR("FUTURE")=$$RD^INHUTS1("Include future tasks") Q:INPAR("FUTURE")=U 0
S INPAR("RUNTOEND")=$$RD^INHUTS1("Always scan to end of queue") Q:INPAR("RUNTOEND")=U 0
I 'INPAR("RUNTOEND") D Q:INPAR("MAXREPTIME")=U 0
. S INPAR("MAXREPTIME")=$$RD^INHUTS1("Maximum time to spend compiling report (sec)",INPAR("MAXREPTIME"),"0,99999")
S INPAR("MAXQTIME")=INPAR("MAXREPTIME")
;S INPAR("GRAPH")=$$RD^INHUTS1("Graph output") Q:INPAR("GRAPH")=U 0
S INPAR("ITER")=$$RD^INHUTS1("Maximum number of iterations (printer only)",INPAR("ITER"),"0,9999") Q:INPAR("ITER")=U 0
Q 1
;
INIARR ;Initialize data and queue arrays
;OUTPUT:
; INDAT - array of data for each queue
; INDEST - array of queues to check
;
N INQ,BP
K INDAT
;Detemine destinations queues to check
D DES1^INHUTS1
;Intialize data arrays
F INQ=1,2,400,700,750 D DATINIT(INQ)
S BP=0 F S BP=$O(INDEST(BP)) Q:'BP D DATINIT(BP)
;
Q
;
DATINIT(INQ) ;Initialize data array
;INPUT:
; INQ - queue entry (ien in Back Proc Control file)
;OUTPUT:
; INDAT - array of initialized data for a queue
;
N X
F X="COUNT","MIN","MAX","AVG","NAME","ITER","TOTC" S INDAT(INQ,X)=""
Q
INHOQR ; FRW/JMB ; 24 Aug 95 14:10; Show GIS queue status
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 ;
EN ;Main entry point
+1 ;NEW statements
+2 ;
+3 NEW %,%ZIS,Q,POP,INTASKED,INPAR
+4 NEW ZTDESC,ZTIO,ZTRTN,ZTSAVE
+5 ;
+6 ;Get report parameters
+7 IF '$$PAR
QUIT
+8 ;
+9 ;Background flag
+10 SET INTASKED=0
+11 ;Get device
+12 WRITE !
KILL IOP
SET %ZIS("A")="QUEUE ON DEVICE: "
SET %ZIS("B")=""
SET %ZIS="NQ"
DO ^%ZIS
IF POP
GOTO EXIT^INHOQR1
+13 SET IOP=ION_";"_IOST_";"_IOM_";"_IOSL
+14 ;User did not select their own device, force queue to taskman
+15 IF IO=IO(0)
SET %ZIS=""
DO ^%ZIS
IF POP
WRITE *7,!,"Sorry, unable to find device..."
GOTO EXIT^INHOQR1
+16 IF IO'=IO(0)
Begin DoDot:1
+17 SET INTASKED=1
SET ZTDESC="GIS Queue Status"
SET ZTIO=IOP
SET ZTRTN="ENZTSK^INHOQR1"
+18 FOR X="INPAR(","INTASKED"
SET ZTSAVE(X)=""
+19 DO ^%ZTLOAD
End DoDot:1
GOTO EXIT^INHOQR1
+20 ;
+21 ;Go to compilation and display module
+22 GOTO ENZTSK^INHOQR1
+23 ;
+24 QUIT
+25 ;
PAR() ;User parameters
+1 ;OUTPUT:
+2 ; INPAR - array of report parameters
+3 ; function - user did not abort ( 0 - no ; 1 - yes )
+4 ;
+5 KILL INPAR
+6 ;detailed report
SET INPAR("DETAIL")=1
+7 ;repaint frequency
SET INPAR("REPAINT")=5
+8 ;always run to end of queues
SET INPAR("RUNTOEND")=0
+9 ;max time to spend in one rpeort scan
SET INPAR("MAXREPTIME")=1800
+10 ;max time to spend scanning a queue
SET INPAR("MAXQTIME")=INPAR("MAXREPTIME")
+11 ;number of report scans to run (printer)
SET INPAR("ITER")=100
+12 ;report future tasks
SET INPAR("FUTURE")=0
+13 ;S INPAR("GRAPH")=0 ;single graph output
+14 ;
+15 ;Quit if user accepts default paramters
+16 SET %=$$RD^INHUTS1("Modify default paramters")
IF '%
QUIT %'=U
WRITE !
+17 SET INPAR("DETAIL")=$$RD^INHUTS1("Detailed report",INPAR("DETAIL"))
IF INPAR("DETAIL")=U
QUIT 0
+18 SET INPAR("REPAINT")=$$RD^INHUTS1("Repaint Frequency (sec)",INPAR("REPAINT"),"0,3600")
IF INPAR("REPAINT")=U
QUIT 0
+19 SET INPAR("FUTURE")=$$RD^INHUTS1("Include future tasks")
IF INPAR("FUTURE")=U
QUIT 0
+20 SET INPAR("RUNTOEND")=$$RD^INHUTS1("Always scan to end of queue")
IF INPAR("RUNTOEND")=U
QUIT 0
+21 IF 'INPAR("RUNTOEND")
Begin DoDot:1
+22 SET INPAR("MAXREPTIME")=$$RD^INHUTS1("Maximum time to spend compiling report (sec)",INPAR("MAXREPTIME"),"0,99999")
End DoDot:1
IF INPAR("MAXREPTIME")=U
QUIT 0
+23 SET INPAR("MAXQTIME")=INPAR("MAXREPTIME")
+24 ;S INPAR("GRAPH")=$$RD^INHUTS1("Graph output") Q:INPAR("GRAPH")=U 0
+25 SET INPAR("ITER")=$$RD^INHUTS1("Maximum number of iterations (printer only)",INPAR("ITER"),"0,9999")
IF INPAR("ITER")=U
QUIT 0
+26 QUIT 1
+27 ;
INIARR ;Initialize data and queue arrays
+1 ;OUTPUT:
+2 ; INDAT - array of data for each queue
+3 ; INDEST - array of queues to check
+4 ;
+5 NEW INQ,BP
+6 KILL INDAT
+7 ;Detemine destinations queues to check
+8 DO DES1^INHUTS1
+9 ;Intialize data arrays
+10 FOR INQ=1,2,400,700,750
DO DATINIT(INQ)
+11 SET BP=0
FOR
SET BP=$ORDER(INDEST(BP))
IF 'BP
QUIT
DO DATINIT(BP)
+12 ;
+13 QUIT
+14 ;
DATINIT(INQ) ;Initialize data array
+1 ;INPUT:
+2 ; INQ - queue entry (ien in Back Proc Control file)
+3 ;OUTPUT:
+4 ; INDAT - array of initialized data for a queue
+5 ;
+6 NEW X
+7 FOR X="COUNT","MIN","MAX","AVG","NAME","ITER","TOTC"
SET INDAT(INQ,X)=""
+8 QUIT