Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: INHOP

INHOP.m

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