AMQQRMH ; IHS/CMI/THL - HEALTH SUMMARY GENERATOR ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;-----
HSUM ; - EP - FROM ^AMQQCMPL
W !
S DIC="^APCHSCTL("
S DIC(0)="AEQ"
S DIC("A")="HEALTH SUMMARY TYPE: "
S DIC("B")="ADULT REGULAR"
D ^DIC
K DIC
I Y=-1 S AMQQQUIT="",AMQQOPT("SPEC")="" Q
S APCHSTYP=+Y
D DEV
I $D(AMQQQUIT) Q
S AMQQRMFL="OUTPUT^AMQQRMH"
I $D(IO("Q")) D HSUMTASK D ^%ZISC W @IOF Q
U IO D HSUMRUN D ^%ZISC
EXIT K %,I
Q
;
DEV W !!!
S %ZIS="Q"
D ^%ZIS
I POP K DUOUT,DTOUT,POP S AMQQQUIT=""
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
;
HSUMRUN W @IOF
X AMQV(0)
I IOST["P-" W @IOF
I $D(ZTQUEUED) D EXIT2^AMQQKILL S ZTREQ="@"
K AMQQRMFL,APCHSTYP,APCHSPAT
Q
;
HSUMTASK S ZTRTN="HSUMRUN^AMQQRMH"
S ZTIO=ION
S ZTDTH="NOW"
F I=1:1 S %=$P("AMQQRMFL;APCHSTYP;AMQV(;AMQQ200(;AMQQRV;AMQQNV;AMQQXV;^UTILITY(""AMQQ"",$J,;^UTILITY(""AMQQ RAND"",$J,;^UTILITY(""AMQQ TAX"",$J,",";",I) Q:%="" S ZTSAVE(%)=""
S ZTDESC="Q-MAN HEALTH SUMMARY GENERATOR"
D ^%ZTLOAD
D ^%ZISC
W !!,$S($D(ZTSK):"Request queued!",1:"Request cancelled!"),!!!
H 3
Q
;
OUTPUT ; ENTRY POINT
I $D(AMQP(0)),$D(APCHSTYP) S X="",APCHSPAT=AMQP(0) D EN^APCHS
I $G(X)=U S AMQQQUIT="" F %=AMQQOV,.1,1,2,3,5,10 S AMQP(%)=99999999999
Q
;
AMQQRMH ; IHS/CMI/THL - HEALTH SUMMARY GENERATOR ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;-----
HSUM ; - EP - FROM ^AMQQCMPL
+1 WRITE !
+2 SET DIC="^APCHSCTL("
+3 SET DIC(0)="AEQ"
+4 SET DIC("A")="HEALTH SUMMARY TYPE: "
+5 SET DIC("B")="ADULT REGULAR"
+6 DO ^DIC
+7 KILL DIC
+8 IF Y=-1
SET AMQQQUIT=""
SET AMQQOPT("SPEC")=""
QUIT
+9 SET APCHSTYP=+Y
+10 DO DEV
+11 IF $DATA(AMQQQUIT)
QUIT
+12 SET AMQQRMFL="OUTPUT^AMQQRMH"
+13 IF $DATA(IO("Q"))
DO HSUMTASK
DO ^%ZISC
WRITE @IOF
QUIT
+14 USE IO
DO HSUMRUN
DO ^%ZISC
EXIT KILL %,I
+1 QUIT
+2 ;
DEV WRITE !!!
+1 SET %ZIS="Q"
+2 DO ^%ZIS
+3 IF POP
KILL DUOUT,DTOUT,POP
SET AMQQQUIT=""
+4 DO PRINT^AMQQSEC
IF '$TEST
WRITE " <= Not a secure device!!",*7
GOTO DEV
+5 IF $DATA(IO("Q"))
IF IO=IO(0)
WRITE !!,"You can not queue a job to a slave printer..Try again",!!,*7
GOTO DEV
+6 QUIT
+7 ;
HSUMRUN WRITE @IOF
+1 XECUTE AMQV(0)
+2 IF IOST["P-"
WRITE @IOF
+3 IF $DATA(ZTQUEUED)
DO EXIT2^AMQQKILL
SET ZTREQ="@"
+4 KILL AMQQRMFL,APCHSTYP,APCHSPAT
+5 QUIT
+6 ;
HSUMTASK SET ZTRTN="HSUMRUN^AMQQRMH"
+1 SET ZTIO=ION
+2 SET ZTDTH="NOW"
+3 FOR I=1:1
SET %=$PIECE("AMQQRMFL;APCHSTYP;AMQV(;AMQQ200(;AMQQRV;AMQQNV;AMQQXV;^UTILITY(""AMQQ"",$J,;^UTILITY(""AMQQ RAND"",$J,;^UTILITY(""AMQQ TAX"",$J,",";",I)
IF %=""
QUIT
SET ZTSAVE(%)=""
+4 SET ZTDESC="Q-MAN HEALTH SUMMARY GENERATOR"
+5 DO ^%ZTLOAD
+6 DO ^%ZISC
+7 WRITE !!,$SELECT($DATA(ZTSK):"Request queued!",1:"Request cancelled!"),!!!
+8 HANG 3
+9 QUIT
+10 ;
OUTPUT ; ENTRY POINT
+1 IF $DATA(AMQP(0))
IF $DATA(APCHSTYP)
SET X=""
SET APCHSPAT=AMQP(0)
DO EN^APCHS
+2 IF $GET(X)=U
SET AMQQQUIT=""
FOR %=AMQQOV,.1,1,2,3,5,10
SET AMQP(%)=99999999999
+3 QUIT
+4 ;