SROICU ;B'HAM ISC/MAM - UNSCHEDULED ADMISSIONS TO ICU ; [ 01/08/98 9:54 AM ]
;;3.0; Surgery ;**77,106**;24 Jun 93
S SRINST=SRSITE("SITE"),SRSOUT=0 W @IOF,!,"Report of Unscheduled Admissions to the ICU",!
DATE D DATE^SROUTL(.SRSD,.SRED,.SRSOUT) G:SRSOUT END
SPEC W @IOF,!,"Do you want the report for a specific Surgical Specialty ? NO// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
S SRSS="",SRYN=$E(SRYN) I SRYN="" S SRYN="N"
I "YyNn"'[SRYN W !!,"Enter 'YES' to print this report for a specific surgical specialty, or RETURN",!,"to print the report, sorted by the date of operation, for all specialties.",!!,"Press RETURN to continue " R X:DTIME G SPEC
I "Yy"[SRYN D SP I SRSOUT G END
W !!,"This report is designed to use a 132 column format."
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))
W ! K IOP,POP,IO("Q"),%ZIS 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 ZTDESC="Unscheduled Admissions to ICU",ZTRTN="EN^SROICU",(ZTSAVE("SRSD"),ZTSAVE("SRED"),ZTSAVE("SRSS"),ZTSAVE("SRINST"),ZTSAVE("SRINSTP"))="" D ^%ZTLOAD G END
EN ; entry when queued
U IO I SRSS D ^SROICU1 G END
D ^SROICU2
END I $E(IOST)'="P",'SRSOUT W !!,"Press RETURN to continue " R X:DTIME
W:$E(IOST)="P" @IOF I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
D ^%ZISC K SRTN D ^SRSKILL W @IOF
Q
SP ; select specialty
W ! K DIC S DIC("S")="I '$P(^(0),""^"",3)",DIC=137.45,DIC(0)="QEAMZ",DIC("A")="Print the report for which Surgical Specialty ? " D ^DIC I Y<0 S SRSOUT=1
S SRSS=+Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROICU 1653 printed Dec 13, 2024@02:43:56 Page 2
SROICU ;B'HAM ISC/MAM - UNSCHEDULED ADMISSIONS TO ICU ; [ 01/08/98 9:54 AM ]
+1 ;;3.0; Surgery ;**77,106**;24 Jun 93
+2 SET SRINST=SRSITE("SITE")
SET SRSOUT=0
WRITE @IOF,!,"Report of Unscheduled Admissions to the ICU",!
DATE DO DATE^SROUTL(.SRSD,.SRED,.SRSOUT)
if SRSOUT
GOTO END
SPEC WRITE @IOF,!,"Do you want the report for a specific Surgical Specialty ? NO// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
GOTO END
+1 SET SRSS=""
SET SRYN=$EXTRACT(SRYN)
IF SRYN=""
SET SRYN="N"
+2 IF "YyNn"'[SRYN
WRITE !!,"Enter 'YES' to print this report for a specific surgical specialty, or RETURN",!,"to print the report, sorted by the date of operation, for all specialties.",!!,"Press RETURN to continue "
READ X:DTIME
GOTO SPEC
+3 IF "Yy"[SRYN
DO SP
IF SRSOUT
GOTO END
+4 WRITE !!,"This report is designed to use a 132 column format."
+5 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))
+6 WRITE !
KILL IOP,POP,IO("Q"),%ZIS
SET %ZIS="QM"
SET %ZIS("A")="Print the Report on which Device ? "
DO ^%ZIS
IF POP
SET SRSOUT=1
GOTO END
+7 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTDESC="Unscheduled Admissions to ICU"
SET ZTRTN="EN^SROICU"
SET (ZTSAVE("SRSD"),ZTSAVE("SRED"),ZTSAVE("SRSS"),ZTSAVE("SRINST"),ZTSAVE("SRINSTP"))=""
DO ^%ZTLOAD
GOTO END
EN ; entry when queued
+1 USE IO
IF SRSS
DO ^SROICU1
GOTO END
+2 DO ^SROICU2
END IF $EXTRACT(IOST)'="P"
IF 'SRSOUT
WRITE !!,"Press RETURN to continue "
READ X:DTIME
+1 if $EXTRACT(IOST)="P"
WRITE @IOF
IF $DATA(ZTQUEUED)
if $GET(ZTSTOP)
QUIT
SET ZTREQ="@"
QUIT
+2 DO ^%ZISC
KILL SRTN
DO ^SRSKILL
WRITE @IOF
+3 QUIT
SP ; select specialty
+1 WRITE !
KILL DIC
SET DIC("S")="I '$P(^(0),""^"",3)"
SET DIC=137.45
SET DIC(0)="QEAMZ"
SET DIC("A")="Print the report for which Surgical Specialty ? "
DO ^DIC
IF Y<0
SET SRSOUT=1
+2 SET SRSS=+Y
+3 QUIT