SRORUT ;B'HAM ISC/MAM - OPERATING ROOM UTILIZATION ; [ 09/22/98 11:36 AM ]
;;3.0; Surgery ;**34,77,50**;24 Jun 93
S SRSOUT=0
W @IOF,!,"Operating Room Utilization Report",!
DATE W ! K %DT S %DT="AEPX",%DT("A")="Print utilization information starting with which date ? " D ^%DT I Y<0 S SRSOUT=1 G END
S SRSD=+Y,SRSD1=Y-.0001
W ! K %DT S %DT="AEPX",%DT("A")="Print utilization information through which date ? " D ^%DT I Y<0 S SRSOUT=1 G END
I Y<SRSD W !!,"The ending date must be more recent than the starting date." G DATE
S SRED=+Y,SRED1=SRED+.25
N SRINSTP,SRDIV I '$D(^XUSEC("SROCHIEF",+DUZ)) S SRINST=SRSITE("SITE"),(SRDIV,SRINSTP)=SRSITE("DIV")
I $D(^XUSEC("SROCHIEF",+DUZ)) S SRINST=$$INST^SROUTL0() G:SRINST="^" END S SRINSTP=$P(SRINST,U),SRINST=$S(SRINST["ALL DIVISIONS":SRINST,1:$P(SRINST,U,2)),SRDIV=$S(SRINST["ALL DIVISIONS":SRINST,1:SRINSTP)
D ^SRORIN G:SRSOUT END I "Yy"'[SRYN S SRSOUT=1 G END
ROOMS ; all operating rooms ?
S SROR="ALL" W @IOF,!,"Do you want to print the Operating Room Utilization Report for all",!,"operating rooms ? YES// " R SRYN:DTIME I SRYN["^" S SRSOUT=1 G END
S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
I "YyNn"'[SRYN W !!,"Enter RETURN if you want to print utilization information for every operating",!,"room, or 'NO' to print the report for one particular room.",!!,"Press RETURN to continue " R X:DTIME G ROOMS
I "Yy"[SRYN G ZIS
W ! K DIC S DIC("S")="I $$ORDIV^SROUTL0(+Y,SRINSTP),('$P(^SRS(+Y,0),U,6))",DIC="^SRS(",DIC(0)="QEAMZ",DIC("A")="Print the report for which Operating Room ? " D ^DIC I Y<0 S SRSOUT=1 G END
S SROR=+Y
W !!,"This report is designed to use a 132 column format, and must be run",!,"on a printer.",!
ZIS K %ZIS,IO("Q"),IOP,POP S %ZIS="QM",%ZIS("A")="Print the Operating Room Utilization Report on which Device ? " D ^%ZIS I POP S SRSOUT=1 G END
I $E(IOST)'="P" W !!,"This report must be run on a printer. Please select another device.",! G ZIS
I $D(IO("Q")) K IO("Q") S ZTDESC="OPERATING ROOM UTILIZATION REPORT",ZTRTN="EN^SRORUT0",(ZTSAVE("SRSD*"),ZTSAVE("SRED*"),ZTSAVE("SROR"),ZTSAVE("SRINST"),ZTSAVE("SRINSTP"),ZTSAVE("SRDIV"))="" D ^%ZTLOAD G END
G EN^SRORUT0
END D ^%ZISC W @IOF D ^SRSKILL
Q
SRORUT ;B'HAM ISC/MAM - OPERATING ROOM UTILIZATION ; [ 09/22/98 11:36 AM ]
+1 ;;3.0; Surgery ;**34,77,50**;24 Jun 93
+2 SET SRSOUT=0
+3 WRITE @IOF,!,"Operating Room Utilization Report",!
DATE WRITE !
KILL %DT
SET %DT="AEPX"
SET %DT("A")="Print utilization information starting with which date ? "
DO ^%DT
IF Y<0
SET SRSOUT=1
GOTO END
+1 SET SRSD=+Y
SET SRSD1=Y-.0001
+2 WRITE !
KILL %DT
SET %DT="AEPX"
SET %DT("A")="Print utilization information through which date ? "
DO ^%DT
IF Y<0
SET SRSOUT=1
GOTO END
+3 IF Y<SRSD
WRITE !!,"The ending date must be more recent than the starting date."
GOTO DATE
+4 SET SRED=+Y
SET SRED1=SRED+.25
+5 NEW SRINSTP,SRDIV
IF '$DATA(^XUSEC("SROCHIEF",+DUZ))
SET SRINST=SRSITE("SITE")
SET (SRDIV,SRINSTP)=SRSITE("DIV")
+6 IF $DATA(^XUSEC("SROCHIEF",+DUZ))
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))
SET SRDIV=$SELECT(SRINST["ALL DIVISIONS":SRINST,1:SRINSTP)
+7 DO ^SRORIN
IF SRSOUT
GOTO END
IF "Yy"'[SRYN
SET SRSOUT=1
GOTO END
ROOMS ; all operating rooms ?
+1 SET SROR="ALL"
WRITE @IOF,!,"Do you want to print the Operating Room Utilization Report for all",!,"operating rooms ? YES// "
READ SRYN:DTIME
IF SRYN["^"
SET SRSOUT=1
GOTO END
+2 SET SRYN=$EXTRACT(SRYN)
IF SRYN=""
SET SRYN="Y"
+3 IF "YyNn"'[SRYN
WRITE !!,"Enter RETURN if you want to print utilization information for every operating",!,"room, or 'NO' to print the report for one particular room.",!!,"Press RETURN to continue "
READ X:DTIME
GOTO ROOMS
+4 IF "Yy"[SRYN
GOTO ZIS
+5 WRITE !
KILL DIC
SET DIC("S")="I $$ORDIV^SROUTL0(+Y,SRINSTP),('$P(^SRS(+Y,0),U,6))"
SET DIC="^SRS("
SET DIC(0)="QEAMZ"
SET DIC("A")="Print the report for which Operating Room ? "
DO ^DIC
IF Y<0
SET SRSOUT=1
GOTO END
+6 SET SROR=+Y
+7 WRITE !!,"This report is designed to use a 132 column format, and must be run",!,"on a printer.",!
ZIS KILL %ZIS,IO("Q"),IOP,POP
SET %ZIS="QM"
SET %ZIS("A")="Print the Operating Room Utilization Report on which Device ? "
DO ^%ZIS
IF POP
SET SRSOUT=1
GOTO END
+1 IF $EXTRACT(IOST)'="P"
WRITE !!,"This report must be run on a printer. Please select another device.",!
GOTO ZIS
+2 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTDESC="OPERATING ROOM UTILIZATION REPORT"
SET ZTRTN="EN^SRORUT0"
SET (ZTSAVE("SRSD*"),ZTSAVE("SRED*"),ZTSAVE("SROR"),ZTSAVE("SRINST"),ZTSAVE("SRINSTP"),ZTSAVE("SRDIV"))=""
DO ^%ZTLOAD
GOTO END
+3 GOTO EN^SRORUT0
END DO ^%ZISC
WRITE @IOF
DO ^SRSKILL
+1 QUIT