ACDWQ ;IHS/ADC/EDE/KML - Q-LOG FOR 5 DRIVER SET REPORTS;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;******************************************************
;//^ACDWDRV*
;Needs ASA* all variables
;**************************************************************
DEBUG D DBQUE Q
W !!,"You should queue all reports to a printer.",!
S ACDNOQUE=1
K IO("Q"),%ZIS,IOP,ZTDTH,ZTSAVE,ZTSK S ACDJBN=$J
S %ZIS="PQ",%ZIS("B")=""
D ^%ZIS
Q:POP
XXX I $E(IOST,1,2)'="P-" W !,"YOU MUST ROUTE THE OUTPUT OF THIS REPORT TO A PRINTER",! D ^%ZISC S POP=1 D PAUSE^ACDDEU Q
;I IO=IO(0) D HUH I 'Y S POP=1 Q
Q:'$D(IO("Q"))
S ZTIO=ION,ACDZTIO=ION S:$G(IOCPU) ZTCPU=IOCPU S ZTSAVE("ACD*")="",ZTSAVE("DUZ(")=""
S ZTRTN=$S($D(ACDWSTAF(1)):"L^ACDWSTAF",$D(ACDWDRV(1)):"L^ACDWDRV1",$D(ACDWDRV(2)):"L^ACDWDRV2",$D(ACDWDRV(3)):"L^ACDWDRV3",$D(ACDWDRV(4)):"L^ACDWDRV4",1:"L^ACDWDRV5")
D ^%ZTLOAD
W !,"Report Queued.."
D ^ACDWK
Q
;
HUH ; SEE IF USER REALLY WANT TO GO TO HOME DEVICE
K DIR
W !,"You have selected your terminal for the ouput of this report."
W !,"If you hat out at the end of a page you will be logged off the system."
W !,"Do you want to continue?",!
S DIR(0)="YO",DIR("B")="N" K DA D ^DIR K DIR
Q
NOTE ;************************************************************
;To convert to double queue
;ACDJBN=JOB#
;ACDZTIO=ION
;ZTIO="" (wake up from first queue in background -no device)
;ZTCPU is passed to %ZTLOAD incase device selected is on a
; different CPU (No need to ZTSAVE("^TMP(""ASA"",$J,") anymore.
;Wake up from first queue and compile.
;Queue again setting ZTIO=ACDZTIO this time.
;Use ACDJBN when oedering through print utility because $J changed
DBQUE ;
D INIT
D XBQUE
Q
;
INIT ;
S ACDJOB=$J
F D Q:ACDBT]""
. S ACDBT=$H
. LOCK +^TMP("ACD",ACDJOB,ACDBT):1
. E S ACDBT=""
. Q
K ^TMP("ACD",ACDJOB,ACDBT)
Q
;
XBQUE ;call to XBDBQUE
K ACDOPT
W ! S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to",DIR("B")="P" K DA D ^DIR K DIR
I $D(DIRUT) S ACDQUIT=1 Q
S ACDOPT=Y
S XBRC=$S($D(ACDWSTAF(1)):"L^ACDWSTAF",$D(ACDWDRV(1)):"L^ACDWDRV1",$D(ACDWDRV(2)):"L^ACDWDRV2",$D(ACDWDRV(3)):"L^ACDWDRV3",$D(ACDWDRV(4)):"L^ACDWDRV4",1:"L^ACDWDRV5")
S XBRX=$S($D(ACDWSTAF(1)):"EOJ^ACDWSTAF",$D(ACDWDRV(1)):"EOJ^ACDWDRV1",$D(ACDWDRV(2)):"EOJ^ACDWDRV2",$D(ACDWDRV(3)):"EOJ^ACDWDRV3",$D(ACDWDRV(4)):"EOJ^ACDWDRV4",1:"EOJ^ACDWDRV5")
S XBRP=$S($D(ACDWSTAF(1)):"P^ACDWSTAF",$D(ACDWDRV(1)):"P^ACDWDRV1",$D(ACDWDRV(2)):"P^ACDWDRV2",$D(ACDWDRV(3)):"P^ACDWDRV3",$D(ACDWDRV(4)):"P^ACDWDRV4",1:"P^ACDWDRV5")
S XBNS="ACD"
I $G(ACDOPT)="B" S XBIOP=0,XBRP="VIEWR^XBLM("""_XBRP_""")"
D ^XBDBQUE
Q
ACDWQ ;IHS/ADC/EDE/KML - Q-LOG FOR 5 DRIVER SET REPORTS;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;******************************************************
+3 ;//^ACDWDRV*
+4 ;Needs ASA* all variables
+5 ;**************************************************************
DEBUG DO DBQUE
QUIT
+1 WRITE !!,"You should queue all reports to a printer.",!
+2 SET ACDNOQUE=1
+3 KILL IO("Q"),%ZIS,IOP,ZTDTH,ZTSAVE,ZTSK
SET ACDJBN=$JOB
+4 SET %ZIS="PQ"
SET %ZIS("B")=""
+5 DO ^%ZIS
+6 IF POP
QUIT
XXX IF $EXTRACT(IOST,1,2)'="P-"
WRITE !,"YOU MUST ROUTE THE OUTPUT OF THIS REPORT TO A PRINTER",!
DO ^%ZISC
SET POP=1
DO PAUSE^ACDDEU
QUIT
+1 ;I IO=IO(0) D HUH I 'Y S POP=1 Q
+2 IF '$DATA(IO("Q"))
QUIT
+3 SET ZTIO=ION
SET ACDZTIO=ION
IF $GET(IOCPU)
SET ZTCPU=IOCPU
SET ZTSAVE("ACD*")=""
SET ZTSAVE("DUZ(")=""
+4 SET ZTRTN=$SELECT($DATA(ACDWSTAF(1)):"L^ACDWSTAF",$DATA(ACDWDRV(1)):"L^ACDWDRV1",$DATA(ACDWDRV(2)):"L^ACDWDRV2",$DATA(ACDWDRV(3)):"L^ACDWDRV3",$DATA(ACDWDRV(4)):"L^ACDWDRV4",1:"L^ACDWDRV5")
+5 DO ^%ZTLOAD
+6 WRITE !,"Report Queued.."
+7 DO ^ACDWK
+8 QUIT
+9 ;
HUH ; SEE IF USER REALLY WANT TO GO TO HOME DEVICE
+1 KILL DIR
+2 WRITE !,"You have selected your terminal for the ouput of this report."
+3 WRITE !,"If you hat out at the end of a page you will be logged off the system."
+4 WRITE !,"Do you want to continue?",!
+5 SET DIR(0)="YO"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+6 QUIT
NOTE ;************************************************************
+1 ;To convert to double queue
+2 ;ACDJBN=JOB#
+3 ;ACDZTIO=ION
+4 ;ZTIO="" (wake up from first queue in background -no device)
+5 ;ZTCPU is passed to %ZTLOAD incase device selected is on a
+6 ; different CPU (No need to ZTSAVE("^TMP(""ASA"",$J,") anymore.
+7 ;Wake up from first queue and compile.
+8 ;Queue again setting ZTIO=ACDZTIO this time.
+9 ;Use ACDJBN when oedering through print utility because $J changed
DBQUE ;
+1 DO INIT
+2 DO XBQUE
+3 QUIT
+4 ;
INIT ;
+1 SET ACDJOB=$JOB
+2 FOR
Begin DoDot:1
+3 SET ACDBT=$HOROLOG
+4 LOCK +^TMP("ACD",ACDJOB,ACDBT):1
+5 IF '$TEST
SET ACDBT=""
+6 QUIT
End DoDot:1
IF ACDBT]""
QUIT
+7 KILL ^TMP("ACD",ACDJOB,ACDBT)
+8 QUIT
+9 ;
XBQUE ;call to XBDBQUE
+1 KILL ACDOPT
+2 WRITE !
SET DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen"
SET DIR("A")="Do you wish to"
SET DIR("B")="P"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
SET ACDQUIT=1
QUIT
+4 SET ACDOPT=Y
+5 SET XBRC=$SELECT($DATA(ACDWSTAF(1)):"L^ACDWSTAF",$DATA(ACDWDRV(1)):"L^ACDWDRV1",$DATA(ACDWDRV(2)):"L^ACDWDRV2",$DATA(ACDWDRV(3)):"L^ACDWDRV3",$DATA(ACDWDRV(4)):"L^ACDWDRV4",1:"L^ACDWDRV5")
+6 SET XBRX=$SELECT($DATA(ACDWSTAF(1)):"EOJ^ACDWSTAF",$DATA(ACDWDRV(1)):"EOJ^ACDWDRV1",$DATA(ACDWDRV(2)):"EOJ^ACDWDRV2",$DATA(ACDWDRV(3)):"EOJ^ACDWDRV3",$DATA(ACDWDRV(4)):"EOJ^ACDWDRV4",1:"EOJ^ACDWDRV5")
+7 SET XBRP=$SELECT($DATA(ACDWSTAF(1)):"P^ACDWSTAF",$DATA(ACDWDRV(1)):"P^ACDWDRV1",$DATA(ACDWDRV(2)):"P^ACDWDRV2",$DATA(ACDWDRV(3)):"P^ACDWDRV3",$DATA(ACDWDRV(4)):"P^ACDWDRV4",1:"P^ACDWDRV5")
+8 SET XBNS="ACD"
+9 IF $GET(ACDOPT)="B"
SET XBIOP=0
SET XBRP="VIEWR^XBLM("""_XBRP_""")"
+10 DO ^XBDBQUE
+11 QUIT