SRODLAY ;B'HAM ISC/MAM - REPORT OF DELAYS ; [ 04/04/00 11:36 AM ]
;;3.0; Surgery ;**77,94**;24 Jun 93
S SRSOUT=0 K %DT W @IOF,!,"Report of Delayed Operations",!
DATE D DATE^SROUTL(.SRSD,.SRED,.SRSOUT) G:SRSOUT END
N SRINSTP S SRINST=$$INST^SROUTL0() G:SRINST="^" END S SRINSTP=$P(SRINST,U),SRINST=$S(SRINST["ALL DIVISIONS":SRINST,1:$P(SRINST,U,2))
SPEC W !!!,"Do you want to print the Report of Delayed Operations for all Surgical",!,"Specialties ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
I "YyNn"'[SRYN W !!,"Enter RETURN to print this report for all surgical specialties, or 'NO' to",!,"select a specific specialty." G SPEC
S SRSS="" I "Nn"[SRYN D SP I SRSOUT G END
W !!,"This report is designed to use a 132 column format."
W ! K %ZIS,IOP,IO("Q"),POP S %ZIS="QM",%ZIS("A")="Print the Report on which Device ? " D ^%ZIS I POP S SRSOUT=1 G END
I $D(IO("Q")) K IO("Q") S ZTRTN="EN^SRODLAY",ZTDESC="Report of Delayed Operations",(ZTSAVE("SRSD"),ZTSAVE("SRED"),ZTSAVE("SRINST"),ZTSAVE("SRINSTP"),ZTSAVE("SRSS"))="" D ^%ZTLOAD G END
EN ; entry when queued
U IO N SRFRTO,SRPRNT S SRSOUT=1 K ^TMP("SR",$J)
S Y=SRSD X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: ",Y=SRED X ^DD("DD") S SRFRTO=SRFRTO_Y,Y=DT X ^DD("DD") S SRPRNT="DATE PRINTED: "_Y
I SRSS D ^SRODLA1 G END
D ^SRODLA2
END I $E(IOST)'="P",'SRSOUT W !!,"Press RETURN to continue " R X:DTIME
I $E(IOST)="P" W @IOF
K ^TMP("SRF",$J),^TMP("SRT",$J) I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
D ^%ZISC W @IOF D ^SRSKILL K SRTN
Q
SP W !! K DIC S DIC("S")="I '$P(^(0),""^"",3)",DIC=137.45,DIC(0)="QEAMZ",DIC("A")="Print the Report of Delayed Operations for which Specialty ? " D ^DIC I Y<0 S SRSOUT=1 Q
S SRSS=+Y
Q
PAGE I 'SRHDR S SRHDR=1 G HDR
S X="" I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
I X["?" W !!,"Enter RETURN to continue printing this report, or '^' to exit from this option." G PAGE
HDR ; print heading
I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
S PAGE=PAGE+1 I $Y W @IOF
I $E(IOST)="P" W !,?(132-$L(SRINST)\2),SRINST,?120,"PAGE: "_PAGE,!,?58,"SURGICAL SERVICE",?100,"REVIEWED BY:",!,?52,"REPORT OF DELAYED OPERATIONS",?100,"DATE REVIEWED:"
W:$D(SPEC) !,?(132-$L(SPEC)\2),SPEC W !,?(132-$L(SRFRTO)\2),SRFRTO I $E(IOST)="P" W ?100,SRPRNT
W !!,"DATE",?12,"PATIENT",?44,"ATTENDING SURGEON",?84,"DELAY COMMENTS",!,"DELAY TIME",?14,"ID #",?44,"OPERATION(S)"
W ! F LINE=1:1:132 W "="
S SRHDR=1
Q
SRODLAY ;B'HAM ISC/MAM - REPORT OF DELAYS ; [ 04/04/00 11:36 AM ]
+1 ;;3.0; Surgery ;**77,94**;24 Jun 93
+2 SET SRSOUT=0
KILL %DT
WRITE @IOF,!,"Report of Delayed Operations",!
DATE DO DATE^SROUTL(.SRSD,.SRED,.SRSOUT)
IF SRSOUT
GOTO END
+1 NEW SRINSTP
SET SRINST=$$INST^SROUTL0()
IF SRINST="^"
GOTO END
SET SRINSTP=$PIECE(SRINST,U)
SET SRINST=$SELECT(SRINST["ALL DIVISIONS":SRINST,1:$PIECE(SRINST,U,2))
SPEC WRITE !!!,"Do you want to print the Report of Delayed Operations for all Surgical",!,"Specialties ? YES// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
GOTO END
+1 SET SRYN=$EXTRACT(SRYN)
IF SRYN=""
SET SRYN="Y"
+2 IF "YyNn"'[SRYN
WRITE !!,"Enter RETURN to print this report for all surgical specialties, or 'NO' to",!,"select a specific specialty."
GOTO SPEC
+3 SET SRSS=""
IF "Nn"[SRYN
DO SP
IF SRSOUT
GOTO END
+4 WRITE !!,"This report is designed to use a 132 column format."
+5 WRITE !
KILL %ZIS,IOP,IO("Q"),POP
SET %ZIS="QM"
SET %ZIS("A")="Print the Report on which Device ? "
DO ^%ZIS
IF POP
SET SRSOUT=1
GOTO END
+6 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTRTN="EN^SRODLAY"
SET ZTDESC="Report of Delayed Operations"
SET (ZTSAVE("SRSD"),ZTSAVE("SRED"),ZTSAVE("SRINST"),ZTSAVE("SRINSTP"),ZTSAVE("SRSS"))=""
DO ^%ZTLOAD
GOTO END
EN ; entry when queued
+1 USE IO
NEW SRFRTO,SRPRNT
SET SRSOUT=1
KILL ^TMP("SR",$JOB)
+2 SET Y=SRSD
XECUTE ^DD("DD")
SET SRFRTO="FROM: "_Y_" TO: "
SET Y=SRED
XECUTE ^DD("DD")
SET SRFRTO=SRFRTO_Y
SET Y=DT
XECUTE ^DD("DD")
SET SRPRNT="DATE PRINTED: "_Y
+3 IF SRSS
DO ^SRODLA1
GOTO END
+4 DO ^SRODLA2
END IF $EXTRACT(IOST)'="P"
IF 'SRSOUT
WRITE !!,"Press RETURN to continue "
READ X:DTIME
+1 IF $EXTRACT(IOST)="P"
WRITE @IOF
+2 KILL ^TMP("SRF",$JOB),^TMP("SRT",$JOB)
IF $DATA(ZTQUEUED)
KILL ^TMP("SR",$JOB)
IF $GET(ZTSTOP)
QUIT
SET ZTREQ="@"
QUIT
+3 DO ^%ZISC
WRITE @IOF
DO ^SRSKILL
KILL SRTN
+4 QUIT
SP WRITE !!
KILL DIC
SET DIC("S")="I '$P(^(0),""^"",3)"
SET DIC=137.45
SET DIC(0)="QEAMZ"
SET DIC("A")="Print the Report of Delayed Operations for which Specialty ? "
DO ^DIC
IF Y<0
SET SRSOUT=1
QUIT
+1 SET SRSS=+Y
+2 QUIT
PAGE IF 'SRHDR
SET SRHDR=1
GOTO HDR
+1 SET X=""
IF $EXTRACT(IOST)'="P"
WRITE !!,"Press RETURN to continue, or '^' to quit: "
READ X:DTIME
IF '$TEST!(X["^")
SET SRSOUT=1
QUIT
+2 IF X["?"
WRITE !!,"Enter RETURN to continue printing this report, or '^' to exit from this option."
GOTO PAGE
HDR ; print heading
+1 IF $DATA(ZTQUEUED)
DO ^SROSTOP
IF SRHALT
SET SRSOUT=1
QUIT
+2 SET PAGE=PAGE+1
IF $Y
WRITE @IOF
+3 IF $EXTRACT(IOST)="P"
WRITE !,?(132-$LENGTH(SRINST)\2),SRINST,?120,"PAGE: "_PAGE,!,?58,"SURGICAL SERVICE",?100,"REVIEWED BY:",!,?52,"REPORT OF DELAYED OPERATIONS",?100,"DATE REVIEWED:"
+4 IF $DATA(SPEC)
WRITE !,?(132-$LENGTH(SPEC)\2),SPEC
WRITE !,?(132-$LENGTH(SRFRTO)\2),SRFRTO
IF $EXTRACT(IOST)="P"
WRITE ?100,SRPRNT
+5 WRITE !!,"DATE",?12,"PATIENT",?44,"ATTENDING SURGEON",?84,"DELAY COMMENTS",!,"DELAY TIME",?14,"ID #",?44,"OPERATION(S)"
+6 WRITE !
FOR LINE=1:1:132
WRITE "="
+7 SET SRHDR=1
+8 QUIT