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

ABSPOSUQ.m

Go to the documentation of this file.
  1. ABSPOSUQ ; IHS/OIT/CNI/SCR - DOUBLE QUEING SHELL HANDLER ;
  1. ;;1.0;PHARMACY POINT OF SALE;**39**;JUN 21, 2001;Build 38
  1. ;Taken from ABMDRDBQ
  1. ;;
  1. ;
  1. ; VARIABLES NEEDED BY PASSING PROGRAM
  1. ;(to change to your name space replace all 'ABSP' with your 'NAME SPACE' ... be sure to watch how the variables map with your existing routines)
  1. ; mandatories
  1. ;
  1. ; ABSPQ("RC")-compute routine (required for double queuing. If not present ABSPQ("RP") will still be queued with ABSPQ("ION"))
  1. ; ABSPQ("RP")-print routine
  1. ; ABSPQ("RX")-exit routine that cleans variables
  1. ; ABSPQ("NS")-name space of variables to auto load in ZTSAVE("NS*")=""
  1. ;
  1. ; optionals
  1. ;
  1. ; ABSPQ("ION")-forced printer ION with _";"_ characteristics
  1. ; ABSPQ("IOPAR") = IOPAR of preselected device
  1. ; ABSPQ("FQ")=1 force queuing
  1. ; ABSPQ("SL")=1 - if slave printing is allowed when queuing
  1. ; ABSPQ("DTH")=FM date time of computing/printing .. or .. =$H
  1. ;
  1. SET(ABSPQ) ;SET UP ABSPQ VARIABLES
  1. S ABSPQ("RC")=$G(ABSPQ("RC")),ABSPQ("NS")=$G(ABSPQ("NS")),ABSPQ("X")="ZTSAVE("""_ABSPQ("NS")_"*"")"
  1. ;
  1. DEV1 ;>Select Device
  1. W !! S %ZIS="NPQ",%ZIS("A")="Output DEVICE: " D ^%ZIS
  1. I $G(POP)!'$D(IO) S DUOUT="" W !,"REPORTING ABORTED",!,*7 G END ;--->
  1. S ABSPQ("ION")=ION_";"_IOST_";"_$S($D(ABSP(132)):132,1:80)_";"_IOSL
  1. I $D(IO("DOC")) S ABSPQ("ION")=$P(ABSPQ("ION"),";",1,2),$P(ABSPQ("ION"),";",3)=IO("DOC")
  1. S ABSPQ("IO")=IO,ABSPQ("IOPAR")=$G(IOPAR),ABSPQ("CPU")=$G(IOCPU),ABSPQ("IOT")=IOT
  1. I $D(IO("Q")),IO=IO(0),'$G(ABSPQ("SL")) W !,"Queing to slave printer not allowed ... Report Aborting" G END ;--->
  1. ;I $D(ABSP(132)) D ^ABSPDR16 Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
  1. ;
  1. QUE1 ;que
  1. I IO'=IO(0) D K IO("Q"),ABSPQ,ABSP,ABSPD Q
  1. .S ZTDESC="Double Que Computing "_ABSPQ("RC")_" "_ABSPQ("RP"),ZTRTN="DEQUE1^ABSPOSUQ"
  1. .S:$D(ABSPQ("DTH")) ZTDTH=ABSPQ("DTH") S:ABSPQ("CPU")]"" ZTCPU=ABSPQ("CPU") S ZTSAVE("ABSP*")="" S:ABSPQ("NS")]"" @ABSPQ("X")=""
  1. .D ^%ZTLOAD
  1. .W:$G(ZTSK) !,"Task # ",ZTSK," queued.",!
  1. .W:'$G(ZTSK) !,*7,"REPORTING ABORTED"
  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. ;
  1. D:ABSPQ("RC")]"" @(ABSPQ("RC"))
  1. D @(ABSPQ("RP"))
  1. I $E(IOST)="C" D I 1
  1. .Q:IOT'["TRM"
  1. .Q:$D(ZTQUEUED)
  1. .Q:$D(IO("S"))
  1. .Q:$D(DTOUT)!($D(DIROUT))!($D(DUOUT))
  1. .W ! S DIR(0)="FO",DIR("A")="(REPORT COMPLETE)" D ^DIR K DIR
  1. E W !!,"E N D O F R E P O R T" W:$Y $$EN^ABMVDF("IOF")
  1. ;D 10^ABMDR16:$D(ABSP("PRINT",16))
  1. I $D(IO("S")) D ^%ZISC ;> close slave printer
  1. ;
  1. ;--------
  1. END ;EP ;> cleanup
  1. ;
  1. ;D @(ABSPQ("RX")) ;>perform cleanup
  1. I $D(ZTQUEUED) D KILL^%ZTLOAD
  1. K ABSPQ,ZTSK
  1. Q
  1. EOP(X) ;EP - end of page
  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