- INHOP ;JMB; 13 Sep 95 09:24; Front End for Interface Monitoring Reports
- ;;3.01;BHL IHS Interfaces with GIS;**14**;JUL 01, 2001
- ;COPYRIGHT 1991-2000 SAIC
- ;
- Q
- ;Tags called under option: Background Process Control Menu
- ; Tags - 1 (VS Report)
- ; 2 (QSIZE)
- ; 3 (TOP)
- ; 4 (BPM)
- VS D EN1(1,"EN^INHOV1","INHO VS") Q ;Verify Status Report
- QSIZ D EN1(2,"ENZTSK^INHOQR1","INHO QSIZ") Q ;Queue Size Report
- TOP D EN1(3,"EN^INHOQT1","INHO TOP") Q ;Top Entries Report
- BPM D EN1(4,"EN^INHOA","INHO BPM") Q ;Background Process Monitor
- Q
- ;
- EN1(SELECT,INPRO,INGAL) ;Run selected report
- ;INPUT: SELECT - Report #
- ; INPRO - Procedure to be executed
- ; INGAL - Gallery for reading in parameters
- ;
- N %,INPAR,D,D0,DA,INDA,DIC,DICPOP,DIE,DLAYGO,XGABPOP
- ;
- S INDA=""
- S X=$J_"_"_DUZ_"_"_$P($H,",",2),DIC=4001.1,DIC(0)="L" S DLAYGO=4001.1 D ^DIC S INDA=+Y I +Y<0 W !,"Unable to create record "_X_" in file 4001.1" Q
- S DA=INDA
- ;
- ;Initialize "^DIZ(4001.1" with default values
- D DEF(SELECT,DA)
- ;
- ;Initialize gallery variables
- S DIE=4001.1,DWN=INGAL
- RPT ; Loop, the user can enter/edit values in the input parameters
- ; screen and rerun the report selected as many times as wanted.
- ;
- ;Check to determine if this is an IHS system and the form exists
- I '$$SC^INHUTIL1 Q:'$D(^DIST(.403,"B",DWN)) D
- .N DDSFILE,DR,DDSPAGE,DDSPARM
- .S DDSFILE=DIE,DR="["_DWN_"]",DDSPAGE=1,DDSPARM="SC"
- .D ^DDS
- ; Force ^DWC to ask to file (i.e. take default values)
- I $$SC^INHUTIL1 D
- .S DWASK=""
- .;Run Gallery to enter/edit input parameters
- .D ^DWC
- I '$D(DWFILE)&'$G(DDSSAVE) D INKINDA(INDA) Q
- D GAT(INDA,SELECT,.INPAR)
- ;Q:'$G(BPC) ;cmi/maw 4/4/2006 added so it won't bomb on a blank
- D ST
- G RPT
- ;
- Q
- ;
- ST ;Run Report with INPUT parameters selected
- ;
- ;NEW statements
- N %ZIS,POP,INTASKED,ZTDESC,ZTIO,ZTRTN,ZTSAVE
- ;
- ;IF Device selected is not the user own device, run this routine
- ; in the background.
- S INTASKED=0 ;Background flag
- ;Get device
- ;
- ;Top Entries Report only displays on the screen
- I SELECT=3 D @INPRO Q
- ;
- W ! K IOP S %ZIS("A")="QUEUE ON DEVICE: ",%ZIS("B")="",%ZIS="NQ"
- ;;;DGH;;S:'$$SC^INHUTIL1 %ZIS=%ZIS_"T0"
- D ^%ZIS I POP D EXIT^INHOA Q
- 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..." D EXIT^INHOA Q
- I IO'=IO(0) D D EXIT^INHOA Q
- . S INTASKED=1,ZTDESC="Background Process Monitor",ZTIO=IOP,ZTRTN=INPRO
- . F X="INPAR(","INTASKED" S ZTSAVE(X)=""
- . D ^%ZTLOAD
- ;
- ;Go to compilation and display module
- D @INPRO
- Q
- ;
- DEF(SELECT,DA) ;Initialize ^DIZ(4001.1 with default values
- N DIE,DR
- S DIE="^DIZ(4001.1,"
- S DR=$P($T(@SELECT),";",2,99) D ^DIE
- Q
- ;
- ;Default values mapping
- ; Structure - {Field Number}///{Default Value}
- ; Tags - 1 (VS Report)
- ; 2 (QSIZE)
- ; 3 (TOP)
- ; 4 (BPM)
- 1 ;21///5;22///1;23///100
- 2 ;21///5;22///1;23///100;27///0;25///1800;24///0
- 3 ;21///5;22///1;26///5
- 4 ;21///5;22///1;23///100;27///0;25///1800;26///5;24///0
- Q
- ;
- GAT(INDA,SELECT,INPAR) ;Initialize INPAR with input parameters
- ; INPUT - INDA : ien entry to fileman file #4001.1
- ; SELECT : report number selected
- ; OUPUT - INPAR array initialized
- ;
- ; Tag DOC shows which INPAR parameters are used for each report.
- ; We initialize only the appropiate parameters.
- N B,BPC
- S B=^DIZ(4001.1,INDA,20)
- S BPC=$P(B,U,1)
- ;Q:'$G(BPC) ;cmi/maw 4/4/2006 added as if left blank it bombs
- S:SELECT=4 INPAR("PROCESS")=BPC_U_$P(^INTHPC(BPC,0),U)
- S INPAR("REPAINT")=$P(B,U,2)
- S INPAR("DETAIL")=$P(B,U,3)
- S:";1;2;4;"[SELECT INPAR("ITER")=$P(B,U,4)
- S:";2;4;"[SELECT INPAR("RUNTOEND")=$P(B,U,5)
- I ";2;4;"[SELECT S INPAR("MAXREPTIME")=$P(B,U,6),INPAR("MAXQTIME")=INPAR("MAXREPTIME")
- S:";2;4;"[SELECT INPAR("FUTURE")=$P(B,U,8)
- S:";3;4;"[SELECT INPAR("ITERT")=$P(B,U,7)
- Q
- ;
- DOC ;INPAR Parameters used by each report
- ; This is only for documentation purposes
- ;
- ;VS Report (SELECT=1):
- ; DETAIL,ITER,REPAINT (in INHOP rout.)
- ; QSTART,START (in INHOV1)
- ;QSIZE Report (SELECT=2):
- ; DETAIL,FUTURE,ITER,MAXQTIME,MAXREPTIME,REPAINT,RUNTOEND (in INHOP)
- ; MSGSTART,QSTART,REPSTART,START,TSKSTART (in INHOQR1)
- ;TOP Report (SELECT=3):
- ; DETAIL,ITERT,REPAINT (in INHOP)
- ; START (in INHOQT1)
- ;BPM Report (SELECT=4):
- ; DETAIL,FUTURE,ITER,ITERT,MAXQTIME,MAXREPTIME,PROCESS,REPAINT,RUNTOEND
- ; MSGSTART,QSTART,REPSTART,START,TSKSTART (in INHOQR1)
- ;
- INKINDA(INDA) ;Clean-up Input Parameters storage data
- ; DESCRIPTION:
- ; Cleans up input parameters from file "INTERFACE MESSAGE
- ; SEARCH" (4001.1)
- ;INPUT:
- ; INDA - Ien into ^DIZ(4001.1
- ;
- Q:'$G(INDA) ;nothing to clean-up
- N DA,DIK,X
- S DA=INDA,DIK="^DIZ(4001.1,"
- D ^DIK
- Q
- ;
- GALC(X) ;Check Background Process selected
- ; Tag called from "INHO BPM" gallery
- N DIC,Y
- S DIC=4004,DIC(0)="MNED"
- S DIC("S")="I $D(^INTHPC(""ACT"",1,Y))"
- D ^DIC
- I Y<0 K X Q
- ; Display the text of the Background Process selected
- S DWVOY=$P(Y,U,2)
- ; Repaint window, this allows to repaint full text of
- ; the Background Process selected.
- S DWPNT=""
- ; Store only the pointer
- S $P(^DIZ(4001.1,INDA,20),U)=+Y
- Q
- ;
- GALH ;Help, list of active queues to select from.
- ; Tag is called from "INHO BPM" gallery.
- N DIC,X,Y
- W !,"The following listing contains only active queues." H 2
- S DIC=4004,DIC(0)="MN",X="??"
- S DIC("S")="I $D(^INTHPC(""ACT"",1,Y))"
- D ^DIC
- Q
- ;
- MPURG() ;Purge junk entries from Interface Message Search File, #4001.1
- ; OUTPUT
- ; 1 - Purge completed
- N INDA,X
- S X="^DIZ(4001.1)"
- S INDA=0 F S INDA=$O(@X@(INDA)) Q:'INDA D
- .;kill entry if we can acquire lock
- .L +@X@(INDA):0 I L -@X@(INDA) D INKINDA^INHOP(INDA)
- Q 1
- INHOP ;JMB; 13 Sep 95 09:24; Front End for Interface Monitoring Reports
- +1 ;;3.01;BHL IHS Interfaces with GIS;**14**;JUL 01, 2001
- +2 ;COPYRIGHT 1991-2000 SAIC
- +3 ;
- +4 QUIT
- +5 ;Tags called under option: Background Process Control Menu
- +6 ; Tags - 1 (VS Report)
- +7 ; 2 (QSIZE)
- +8 ; 3 (TOP)
- +9 ; 4 (BPM)
- VS ;Verify Status Report
- DO EN1(1,"EN^INHOV1","INHO VS")
- QUIT
- QSIZ ;Queue Size Report
- DO EN1(2,"ENZTSK^INHOQR1","INHO QSIZ")
- QUIT
- TOP ;Top Entries Report
- DO EN1(3,"EN^INHOQT1","INHO TOP")
- QUIT
- BPM ;Background Process Monitor
- DO EN1(4,"EN^INHOA","INHO BPM")
- QUIT
- +1 QUIT
- +2 ;
- EN1(SELECT,INPRO,INGAL) ;Run selected report
- +1 ;INPUT: SELECT - Report #
- +2 ; INPRO - Procedure to be executed
- +3 ; INGAL - Gallery for reading in parameters
- +4 ;
- +5 NEW %,INPAR,D,D0,DA,INDA,DIC,DICPOP,DIE,DLAYGO,XGABPOP
- +6 ;
- +7 SET INDA=""
- +8 SET X=$JOB_"_"_DUZ_"_"_$PIECE($HOROLOG,",",2)
- SET DIC=4001.1
- SET DIC(0)="L"
- SET DLAYGO=4001.1
- DO ^DIC
- SET INDA=+Y
- IF +Y<0
- WRITE !,"Unable to create record "_X_" in file 4001.1"
- QUIT
- +9 SET DA=INDA
- +10 ;
- +11 ;Initialize "^DIZ(4001.1" with default values
- +12 DO DEF(SELECT,DA)
- +13 ;
- +14 ;Initialize gallery variables
- +15 SET DIE=4001.1
- SET DWN=INGAL
- RPT ; Loop, the user can enter/edit values in the input parameters
- +1 ; screen and rerun the report selected as many times as wanted.
- +2 ;
- +3 ;Check to determine if this is an IHS system and the form exists
- +4 IF '$$SC^INHUTIL1
- IF '$DATA(^DIST(.403,"B",DWN))
- QUIT
- Begin DoDot:1
- +5 NEW DDSFILE,DR,DDSPAGE,DDSPARM
- +6 SET DDSFILE=DIE
- SET DR="["_DWN_"]"
- SET DDSPAGE=1
- SET DDSPARM="SC"
- +7 DO ^DDS
- End DoDot:1
- +8 ; Force ^DWC to ask to file (i.e. take default values)
- +9 IF $$SC^INHUTIL1
- Begin DoDot:1
- +10 SET DWASK=""
- +11 ;Run Gallery to enter/edit input parameters
- +12 DO ^DWC
- End DoDot:1
- +13 IF '$DATA(DWFILE)&'$GET(DDSSAVE)
- DO INKINDA(INDA)
- QUIT
- +14 DO GAT(INDA,SELECT,.INPAR)
- +15 ;Q:'$G(BPC) ;cmi/maw 4/4/2006 added so it won't bomb on a blank
- +16 DO ST
- +17 GOTO RPT
- +18 ;
- +19 QUIT
- +20 ;
- ST ;Run Report with INPUT parameters selected
- +1 ;
- +2 ;NEW statements
- +3 NEW %ZIS,POP,INTASKED,ZTDESC,ZTIO,ZTRTN,ZTSAVE
- +4 ;
- +5 ;IF Device selected is not the user own device, run this routine
- +6 ; in the background.
- +7 ;Background flag
- SET INTASKED=0
- +8 ;Get device
- +9 ;
- +10 ;Top Entries Report only displays on the screen
- +11 IF SELECT=3
- DO @INPRO
- QUIT
- +12 ;
- +13 WRITE !
- KILL IOP
- SET %ZIS("A")="QUEUE ON DEVICE: "
- SET %ZIS("B")=""
- SET %ZIS="NQ"
- +14 ;;;DGH;;S:'$$SC^INHUTIL1 %ZIS=%ZIS_"T0"
- +15 DO ^%ZIS
- IF POP
- DO EXIT^INHOA
- QUIT
- +16 SET IOP=ION_";"_IOST_";"_IOM_";"_IOSL
- +17 ;User did not select their own device, force queue to taskman
- +18 IF IO=IO(0)
- SET %ZIS=""
- DO ^%ZIS
- IF POP
- WRITE *7,!,"Sorry, unable to find device..."
- DO EXIT^INHOA
- QUIT
- +19 IF IO'=IO(0)
- Begin DoDot:1
- +20 SET INTASKED=1
- SET ZTDESC="Background Process Monitor"
- SET ZTIO=IOP
- SET ZTRTN=INPRO
- +21 FOR X="INPAR(","INTASKED"
- SET ZTSAVE(X)=""
- +22 DO ^%ZTLOAD
- End DoDot:1
- DO EXIT^INHOA
- QUIT
- +23 ;
- +24 ;Go to compilation and display module
- +25 DO @INPRO
- +26 QUIT
- +27 ;
- DEF(SELECT,DA) ;Initialize ^DIZ(4001.1 with default values
- +1 NEW DIE,DR
- +2 SET DIE="^DIZ(4001.1,"
- +3 SET DR=$PIECE($TEXT(@SELECT),";",2,99)
- DO ^DIE
- +4 QUIT
- +5 ;
- +6 ;Default values mapping
- +7 ; Structure - {Field Number}///{Default Value}
- +8 ; Tags - 1 (VS Report)
- +9 ; 2 (QSIZE)
- +10 ; 3 (TOP)
- +11 ; 4 (BPM)
- 1 ;21///5;22///1;23///100
- 2 ;21///5;22///1;23///100;27///0;25///1800;24///0
- 3 ;21///5;22///1;26///5
- 4 ;21///5;22///1;23///100;27///0;25///1800;26///5;24///0
- +1 QUIT
- +2 ;
- GAT(INDA,SELECT,INPAR) ;Initialize INPAR with input parameters
- +1 ; INPUT - INDA : ien entry to fileman file #4001.1
- +2 ; SELECT : report number selected
- +3 ; OUPUT - INPAR array initialized
- +4 ;
- +5 ; Tag DOC shows which INPAR parameters are used for each report.
- +6 ; We initialize only the appropiate parameters.
- +7 NEW B,BPC
- +8 SET B=^DIZ(4001.1,INDA,20)
- +9 SET BPC=$PIECE(B,U,1)
- +10 ;Q:'$G(BPC) ;cmi/maw 4/4/2006 added as if left blank it bombs
- +11 IF SELECT=4
- SET INPAR("PROCESS")=BPC_U_$PIECE(^INTHPC(BPC,0),U)
- +12 SET INPAR("REPAINT")=$PIECE(B,U,2)
- +13 SET INPAR("DETAIL")=$PIECE(B,U,3)
- +14 IF ";1;2;4;"[SELECT
- SET INPAR("ITER")=$PIECE(B,U,4)
- +15 IF ";2;4;"[SELECT
- SET INPAR("RUNTOEND")=$PIECE(B,U,5)
- +16 IF ";2;4;"[SELECT
- SET INPAR("MAXREPTIME")=$PIECE(B,U,6)
- SET INPAR("MAXQTIME")=INPAR("MAXREPTIME")
- +17 IF ";2;4;"[SELECT
- SET INPAR("FUTURE")=$PIECE(B,U,8)
- +18 IF ";3;4;"[SELECT
- SET INPAR("ITERT")=$PIECE(B,U,7)
- +19 QUIT
- +20 ;
- DOC ;INPAR Parameters used by each report
- +1 ; This is only for documentation purposes
- +2 ;
- +3 ;VS Report (SELECT=1):
- +4 ; DETAIL,ITER,REPAINT (in INHOP rout.)
- +5 ; QSTART,START (in INHOV1)
- +6 ;QSIZE Report (SELECT=2):
- +7 ; DETAIL,FUTURE,ITER,MAXQTIME,MAXREPTIME,REPAINT,RUNTOEND (in INHOP)
- +8 ; MSGSTART,QSTART,REPSTART,START,TSKSTART (in INHOQR1)
- +9 ;TOP Report (SELECT=3):
- +10 ; DETAIL,ITERT,REPAINT (in INHOP)
- +11 ; START (in INHOQT1)
- +12 ;BPM Report (SELECT=4):
- +13 ; DETAIL,FUTURE,ITER,ITERT,MAXQTIME,MAXREPTIME,PROCESS,REPAINT,RUNTOEND
- +14 ; MSGSTART,QSTART,REPSTART,START,TSKSTART (in INHOQR1)
- +15 ;
- INKINDA(INDA) ;Clean-up Input Parameters storage data
- +1 ; DESCRIPTION:
- +2 ; Cleans up input parameters from file "INTERFACE MESSAGE
- +3 ; SEARCH" (4001.1)
- +4 ;INPUT:
- +5 ; INDA - Ien into ^DIZ(4001.1
- +6 ;
- +7 ;nothing to clean-up
- IF '$GET(INDA)
- QUIT
- +8 NEW DA,DIK,X
- +9 SET DA=INDA
- SET DIK="^DIZ(4001.1,"
- +10 DO ^DIK
- +11 QUIT
- +12 ;
- GALC(X) ;Check Background Process selected
- +1 ; Tag called from "INHO BPM" gallery
- +2 NEW DIC,Y
- +3 SET DIC=4004
- SET DIC(0)="MNED"
- +4 SET DIC("S")="I $D(^INTHPC(""ACT"",1,Y))"
- +5 DO ^DIC
- +6 IF Y<0
- KILL X
- QUIT
- +7 ; Display the text of the Background Process selected
- +8 SET DWVOY=$PIECE(Y,U,2)
- +9 ; Repaint window, this allows to repaint full text of
- +10 ; the Background Process selected.
- +11 SET DWPNT=""
- +12 ; Store only the pointer
- +13 SET $PIECE(^DIZ(4001.1,INDA,20),U)=+Y
- +14 QUIT
- +15 ;
- GALH ;Help, list of active queues to select from.
- +1 ; Tag is called from "INHO BPM" gallery.
- +2 NEW DIC,X,Y
- +3 WRITE !,"The following listing contains only active queues."
- HANG 2
- +4 SET DIC=4004
- SET DIC(0)="MN"
- SET X="??"
- +5 SET DIC("S")="I $D(^INTHPC(""ACT"",1,Y))"
- +6 DO ^DIC
- +7 QUIT
- +8 ;
- MPURG() ;Purge junk entries from Interface Message Search File, #4001.1
- +1 ; OUTPUT
- +2 ; 1 - Purge completed
- +3 NEW INDA,X
- +4 SET X="^DIZ(4001.1)"
- +5 SET INDA=0
- FOR
- SET INDA=$ORDER(@X@(INDA))
- IF 'INDA
- QUIT
- Begin DoDot:1
- +6 ;kill entry if we can acquire lock
- +7 LOCK +@X@(INDA):0
- IF $TEST
- LOCK -@X@(INDA)
- DO INKINDA^INHOP(INDA)
- End DoDot:1
- +8 QUIT 1