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

AGDBQUE.m

Go to the documentation of this file.
  1. AGDBQUE ; IHS/ASDS/EFG - DOUBLE QUEING SHELL HANDLER ;
  1. ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
  1. ;
  1. ;Thanks to Linda Lehman for the code
  1. ;
  1. ;****************************************************************
  1. ;VARIABLES NEEDED BY PASSING PROGRAM
  1. ;(to change to your name space replace all 'BAR' with your
  1. ;'NAME SPACE' ... be sure to watch how the variables map with
  1. ;your existing routines) mandatories
  1. ;
  1. ;AGQ("RC") - compute routine (required for double queuing. If not
  1. ; present AGQ("RP") will still be queued w/ AGQ("ION"))
  1. ;AGQ("RP") - print routine
  1. ;AGQ("RX") - exit routine that cleans variables
  1. ;AGQ("NS") - name space of variables to auto load in
  1. ; ZTSAVE("NS*")=""
  1. ;
  1. ;optionals
  1. ;
  1. ;AGQ("ION") - forced printer ION with _";"_ characteristics
  1. ;AGQ("IOPAR")=IOPAR - of preselected device
  1. ;AGQ("FQ")=1 - force queuing
  1. ;AGQ("SL")=1 - if slave printing is allowed when queuing
  1. ;AGQ("DTH")=FM - date time of computing/printing . or . =$H
  1. ;****************************************************************
  1. ;
  1. SET ;Set up AGQ variables
  1. S AGQ("RC")=$G(AGQ("RC"))
  1. S AGQ("NS")=$G(AGQ("NS"))
  1. S AGQ("X")="ZTSAVE("""_AGQ("NS")_"*"")"
  1. ;-------------------------------
  1. DEV1 ;Select Device
  1. W !!
  1. K IO("Q")
  1. S %ZIS="NPQ"
  1. S %ZIS("A")="Output DEVICE: "
  1. D ^%ZIS
  1. I $G(POP)!'$D(IO) S DUOUT="" W !,"REPORTING ABORTED",!,*7 G END
  1. S AGQ("ION")=ION_";"_IOST_";"_IOM_";"_IOSL
  1. I $D(IO("DOC")) D
  1. . S AGQ("ION")=$P(AGQ("ION"),";",1,2)
  1. . S $P(AGQ("ION"),";",3)=IO("DOC")
  1. S AGQ("IO")=IO
  1. S AGQ("IOPAR")=$G(IOPAR)
  1. S AGQ("CPU")=$G(IOCPU)
  1. S AGQ("IOT")=IOT
  1. I $D(IO("Q")),IO=IO(0),'$G(AGQ("SL")) W !,"Queing to slave printer not allowed ... Report Aborting" G END
  1. ;-------------------------------
  1. QUE1 ;que
  1. I IO'=IO(0) D K IO("Q"),AGQ,AG,AGD Q
  1. . S ZTDESC="Double Que Computing "_AGQ("RC")_" "_AGQ("RP")
  1. . S ZTRTN="DEQUE1^AGDBQUE"
  1. . S:$D(AGQ("DTH")) ZTDTH=AGQ("DTH")
  1. . S:AGQ("CPU")]"" ZTCPU=AGQ("CPU")
  1. . S ZTSAVE("AG*")=""
  1. . S:AGQ("NS")]"" @AGQ("X")=""
  1. . D ^%ZTLOAD
  1. . W:$G(ZTSK) !,"Task # ",ZTSK," queued.",!
  1. . W:'$G(ZTSK) !,*7,"REPORTING ABORTED"
  1. . S X=1 D EOP
  1. . D HOME^%ZIS
  1. ;-------------------------------
  1. SLAVE ;Open slave device
  1. I $D(IO("S")) S IOP=ION D ^%ZIS
  1. ;-------------------------------
  1. DEQUE1 ;EP - 1st deque | do computing routine
  1. D:AGQ("RC")]"" @(AGQ("RC"))
  1. D @(AGQ("RP"))
  1. I $D(IO("S")) D ^%ZISC ;close slave printer
  1. ;-------------------------------
  1. END ;EP ;> cleanup
  1. D @(AGQ("RX")) ;>perform cleanup
  1. I $D(ZTQUEUED) D KILL^%ZTLOAD
  1. K AGQ,ZTSK,IO("Q"),AGD,AG
  1. Q
  1. EOP ;END OF PAGE (Original code from EOP^AGUTL)
  1. ;X=0, 1, or 2
  1. Q:$G(IOT)'["TRM"
  1. Q:$E($G(IOST))'="C"
  1. Q:$D(IO("S"))
  1. Q:$D(ZTQUEUED)
  1. F W ! Q:$Y+4>IOSL
  1. Q:X=2
  1. S DIR(0)="E"
  1. S:X=1 DIR("A")="Enter RETURN to continue"
  1. D ^DIR
  1. K DIR
  1. Q