AMQQCMPP ;IHS/CMI/THL - MANAGES PRINTED REPORTS ;
;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
; CALLS TASKMAN
;-----
RUN N AMQQRV,AMQQNV,AMQQXV
S (AMQQRV,AMQQNV)="AMQQXV"
S AMQQXV=""
I '$D(AMQQFFF) D SUP I $D(AMQQQUIT) Q
I $D(^XUSEC("AMQQZRPT",DUZ)) S DIR("A")="Enter name of person requesting report",DIR(0)="P^200:AQEM",DIR("B")=$P(@AMQQ200(3)@(DUZ,0),U) D ^DIR S:Y>0 AMQQUSR=+Y K Y,DIRUT,DUOUT,DTOUT,DIR I '$D(AMQQUSR) S AMQQQUIT=1 Q
D DEV
I $D(AMQQQUIT) Q
I '$D(IO("Q")) U IO D TASK D ^%ZISC G EXIT
S ZTRTN="TASK^AMQQCMPP"
S ZTIO=ION
S ZTDTH="NOW"
S ZTDESC="QUERY UTILITY REPORT"
QUEUE ;F I=1:1 S %=$P("AMQV(;AMQQ200(;AMQQRV;AMQQSUPF;AMQQNV;AMQQFFF;AMQQXV;AMQQUSR;^UTILITY(""AMQQ"",$J,;^UTILITY(""AMQQ RAND"",$J,;^UTILITY(""AMQQ TAX"",$J,",";",I) Q:%="" S ZTSAVE(%)=""
F I=1:1 S %=$P("AMQV(;AMQQ200(;AMQQ*;AMQQRV;AMQQSUPF;AMQQNV;AMQQFFF;AMQQXV;AMQQUSR;^UTILITY(""AMQQ"",$J,;^UTILITY(""AMQQ RAND"",$J,;^UTILITY(""AMQQ TAX"",$J,",";",I) Q:%="" S ZTSAVE(%)="" ;PATCH XXX
D ^%ZTLOAD
D ^%ZISC
W !!,$S($D(ZTSK):"Request queued!",1:"Request cancelled!"),!!!
H 3
EXIT K X,Y,%,AMQQSUPF,I,AMQQUSR
W @IOF
Q
;
DEV W !
S %ZIS="QM"
S %ZIS("B")=""
D ^%ZIS
S AMQQIOP=IO
I POP S AMQQQUIT="" Q
D PRINT^AMQQSEC E W " <= Not a secure device!!",*7 G DEV
I $D(IO("Q")),IO=IO(0) W !!,"You can not queue a job to a slave printer..Try again",!!,*7 G DEV
Q
;
TASK I '$D(AMQQFFF) D COVER I $D(AMQQQUIT) Q
X AMQV(0)
I '$D(AMQQFFF) W !,"Total: ",+$G(AMQQTOT)
I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR,DUOUT,DTOUT,DIRUT
W @IOF
I $D(ZTQUEUED) D EXIT2^AMQQKILL S ZTREQ="@"
Q
;
COVER ; - EP -
S %=""
S $P(%,"*",79)=""
W !!!!,%,! K AMQQQUIT
W "** WARNING...The following report may contain CONFIDENTIAL PATIENT DATA. **"
W !,"** You are accountable for keeping the report in a SECURE AREA at all times.**"
W !,"** SHRED the report as soon as it is no longer needed. **"
W !,"** PRIVACY ACT violators are subject to a $5000 fine! **"
W !,%
CV1 S %=$P(@AMQQ200(3)@(DUZ,0),U)
S %=$P(%,",",2,9)_" "_$P(%,",") D
.W !!,"This report ",$S('$D(AMQQUSR)!($G(AMQQUSR)=DUZ):"requested",1:"printed")," by ",%
.I $D(AMQQUSR),AMQQUSR'=DUZ D
..S %=$P(@AMQQ200(3)@(AMQQUSR,0),U)
..S %=$P(%,",",2,9)_" "_$P(%,",")
..W " and requested by ",%
W !,"Date of report: "
S Y=DT
X ^DD("DD")
W Y
W !!
F %=0:0 S %=$O(^UTILITY("AMQQ",$J,"LIST",%)) Q:'% W ! X ^(%)
I $E(IOST,1,2)="C-" W !! S DIR(0)="E" D ^DIR K DIR I $D(DUOUT)+$D(DTOUT) K DUOUT,DTOUT,DIRUT S AMQQQUIT=""
Q
;
COUNT ; ENTRY POINT FROM AMQQCMPL
N AMQQRV,AMQQNV,AMQQXV
S (AMQQRV,AMQQNV)="AMQQXV"
S AMQQXV=""
D DEV
I $D(AMQQQUIT) Q
I '$D(IO("Q")) U IO D TASKC D ^%ZISC Q
S ZTRTN="TASKC^AMQQCMPP"
S ZTIO=ION
S ZTDTH="NOW"
S ZTDESC="Q-MAN COUNT"
D QUEUE
Q
;
TASKC S AMQQH1=$H
I $E(IOST,1,2)'="P-" W !!!!,"COUNTING....",!
E W !!!! D CV1 W !!!
X AMQV(0)
I $E(IOST,1,2)="C-" W $C(13),?9,$C(13)
W "Total: ",+$G(AMQQTOT)
S X1=AMQQH1
S X2=$H
D ELT^AMQQCMP0
W !,"Search time: ",X
I $E(IOST,1,2)="C-" W !!! S DIR(0)="E" D ^DIR K DIR,DIRUT,DUOUT,DTOUT
K AMQQH1,X1,X2
W @IOF
I $D(ZTQUEUED) D EXIT2^AMQQKILL S ZTREQ="@"
Q
;
SUP W !!,"Want to suppress patient names and only print the chart no."
S %=2
D YN^DICN
I %Y=U S AMQQQUIT="" K %Y Q
I $D(DUOUT)+$D(DTOUT) K DTOUT,DUOUT S AMQQQUIT="" Q
I "Nn"[$E(%Y) K %Y Q
S AMQQSUPF=""
K %Y
Q
;
AMQQCMPP ;IHS/CMI/THL - MANAGES PRINTED REPORTS ;
+1 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
+2 ; CALLS TASKMAN
+3 ;-----
RUN NEW AMQQRV,AMQQNV,AMQQXV
+1 SET (AMQQRV,AMQQNV)="AMQQXV"
+2 SET AMQQXV=""
+3 IF '$DATA(AMQQFFF)
DO SUP
IF $DATA(AMQQQUIT)
QUIT
+4 IF $DATA(^XUSEC("AMQQZRPT",DUZ))
SET DIR("A")="Enter name of person requesting report"
SET DIR(0)="P^200:AQEM"
SET DIR("B")=$PIECE(@AMQQ200(3)@(DUZ,0),U)
DO ^DIR
IF Y>0
SET AMQQUSR=+Y
KILL Y,DIRUT,DUOUT,DTOUT,DIR
IF '$DATA(AMQQUSR)
SET AMQQQUIT=1
QUIT
+5 DO DEV
+6 IF $DATA(AMQQQUIT)
QUIT
+7 IF '$DATA(IO("Q"))
USE IO
DO TASK
DO ^%ZISC
GOTO EXIT
+8 SET ZTRTN="TASK^AMQQCMPP"
+9 SET ZTIO=ION
+10 SET ZTDTH="NOW"
+11 SET ZTDESC="QUERY UTILITY REPORT"
QUEUE ;F I=1:1 S %=$P("AMQV(;AMQQ200(;AMQQRV;AMQQSUPF;AMQQNV;AMQQFFF;AMQQXV;AMQQUSR;^UTILITY(""AMQQ"",$J,;^UTILITY(""AMQQ RAND"",$J,;^UTILITY(""AMQQ TAX"",$J,",";",I) Q:%="" S ZTSAVE(%)=""
+1 ;PATCH XXX
FOR I=1:1
SET %=$PIECE("AMQV(;AMQQ200(;AMQQ*;AMQQRV;AMQQSUPF;AMQQNV;AMQQFFF;AMQQXV;AMQQUSR;^UTILITY(""AMQQ"",$J,;^UTILITY(""AMQQ RAND"",$J,;^UTILITY(""AMQQ TAX"",$J,",";",I)
IF %=""
QUIT
SET ZTSAVE(%)=""
+2 DO ^%ZTLOAD
+3 DO ^%ZISC
+4 WRITE !!,$SELECT($DATA(ZTSK):"Request queued!",1:"Request cancelled!"),!!!
+5 HANG 3
EXIT KILL X,Y,%,AMQQSUPF,I,AMQQUSR
+1 WRITE @IOF
+2 QUIT
+3 ;
DEV WRITE !
+1 SET %ZIS="QM"
+2 SET %ZIS("B")=""
+3 DO ^%ZIS
+4 SET AMQQIOP=IO
+5 IF POP
SET AMQQQUIT=""
QUIT
+6 DO PRINT^AMQQSEC
IF '$TEST
WRITE " <= Not a secure device!!",*7
GOTO DEV
+7 IF $DATA(IO("Q"))
IF IO=IO(0)
WRITE !!,"You can not queue a job to a slave printer..Try again",!!,*7
GOTO DEV
+8 QUIT
+9 ;
TASK IF '$DATA(AMQQFFF)
DO COVER
IF $DATA(AMQQQUIT)
QUIT
+1 XECUTE AMQV(0)
+2 IF '$DATA(AMQQFFF)
WRITE !,"Total: ",+$GET(AMQQTOT)
+3 IF $EXTRACT(IOST,1,2)="C-"
SET DIR(0)="E"
DO ^DIR
KILL DIR,DUOUT,DTOUT,DIRUT
+4 WRITE @IOF
+5 IF $DATA(ZTQUEUED)
DO EXIT2^AMQQKILL
SET ZTREQ="@"
+6 QUIT
+7 ;
COVER ; - EP -
+1 SET %=""
+2 SET $PIECE(%,"*",79)=""
+3 WRITE !!!!,%,!
KILL AMQQQUIT
+4 WRITE "** WARNING...The following report may contain CONFIDENTIAL PATIENT DATA. **"
+5 WRITE !,"** You are accountable for keeping the report in a SECURE AREA at all times.**"
+6 WRITE !,"** SHRED the report as soon as it is no longer needed. **"
+7 WRITE !,"** PRIVACY ACT violators are subject to a $5000 fine! **"
+8 WRITE !,%
CV1 SET %=$PIECE(@AMQQ200(3)@(DUZ,0),U)
+1 SET %=$PIECE(%,",",2,9)_" "_$PIECE(%,",")
Begin DoDot:1
+2 WRITE !!,"This report ",$SELECT('$DATA(AMQQUSR)!($GET(AMQQUSR)=DUZ):"requested",1:"printed")," by ",%
+3 IF $DATA(AMQQUSR)
IF AMQQUSR'=DUZ
Begin DoDot:2
+4 SET %=$PIECE(@AMQQ200(3)@(AMQQUSR,0),U)
+5 SET %=$PIECE(%,",",2,9)_" "_$PIECE(%,",")
+6 WRITE " and requested by ",%
End DoDot:2
End DoDot:1
+7 WRITE !,"Date of report: "
+8 SET Y=DT
+9 XECUTE ^DD("DD")
+10 WRITE Y
+11 WRITE !!
+12 FOR %=0:0
SET %=$ORDER(^UTILITY("AMQQ",$JOB,"LIST",%))
IF '%
QUIT
WRITE !
XECUTE ^(%)
+13 IF $EXTRACT(IOST,1,2)="C-"
WRITE !!
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)+$DATA(DTOUT)
KILL DUOUT,DTOUT,DIRUT
SET AMQQQUIT=""
+14 QUIT
+15 ;
COUNT ; ENTRY POINT FROM AMQQCMPL
+1 NEW AMQQRV,AMQQNV,AMQQXV
+2 SET (AMQQRV,AMQQNV)="AMQQXV"
+3 SET AMQQXV=""
+4 DO DEV
+5 IF $DATA(AMQQQUIT)
QUIT
+6 IF '$DATA(IO("Q"))
USE IO
DO TASKC
DO ^%ZISC
QUIT
+7 SET ZTRTN="TASKC^AMQQCMPP"
+8 SET ZTIO=ION
+9 SET ZTDTH="NOW"
+10 SET ZTDESC="Q-MAN COUNT"
+11 DO QUEUE
+12 QUIT
+13 ;
TASKC SET AMQQH1=$HOROLOG
+1 IF $EXTRACT(IOST,1,2)'="P-"
WRITE !!!!,"COUNTING....",!
+2 IF '$TEST
WRITE !!!!
DO CV1
WRITE !!!
+3 XECUTE AMQV(0)
+4 IF $EXTRACT(IOST,1,2)="C-"
WRITE $CHAR(13),?9,$CHAR(13)
+5 WRITE "Total: ",+$GET(AMQQTOT)
+6 SET X1=AMQQH1
+7 SET X2=$HOROLOG
+8 DO ELT^AMQQCMP0
+9 WRITE !,"Search time: ",X
+10 IF $EXTRACT(IOST,1,2)="C-"
WRITE !!!
SET DIR(0)="E"
DO ^DIR
KILL DIR,DIRUT,DUOUT,DTOUT
+11 KILL AMQQH1,X1,X2
+12 WRITE @IOF
+13 IF $DATA(ZTQUEUED)
DO EXIT2^AMQQKILL
SET ZTREQ="@"
+14 QUIT
+15 ;
SUP WRITE !!,"Want to suppress patient names and only print the chart no."
+1 SET %=2
+2 DO YN^DICN
+3 IF %Y=U
SET AMQQQUIT=""
KILL %Y
QUIT
+4 IF $DATA(DUOUT)+$DATA(DTOUT)
KILL DTOUT,DUOUT
SET AMQQQUIT=""
QUIT
+5 IF "Nn"[$EXTRACT(%Y)
KILL %Y
QUIT
+6 SET AMQQSUPF=""
+7 KILL %Y
+8 QUIT
+9 ;