SROUTED ;B'HAM ISC/MAM - EDIT UTILIZATION TIMES ; [ 09/22/98 11:36 AM ]
;;3.0; Surgery ;**77,50**;24 Jun 93
START W @IOF,!,"Update Start and End Times for Operating Rooms",! K %DT S %DT="AEPX",%DT("A")="Update Times for which Date ? " D ^%DT I Y<0 G END
S SRUL="" F I=1:1:80 S SRUL=SRUL_"-"
S SRSDATE=+Y D D^DIQ S SRSDT=Y I '$D(^SRU(SRSDATE)) D STUFF
OR W @IOF,!,"Operating Room Utilization on "_SRSDT,!,SRUL,! K DIC,DA
S DIC("S")="I $$ORDIV^SROUTL0(+Y,$G(SRSITE(""DIV""))),('$P(^SRS(+Y,0),U,6))",DIC="^SRS(",DIC(0)="QEAMZ",DIC("A")="Update Start and End Times for which Operating Room ? " D ^DIC K DIC I Y<0 G:$D(DTOUT)!$D(DUOUT) END G START
S SROR=+Y
W ! K DIE,DA,DR S DA(1)=SRSDATE,DA=SROR,DIE="^SRU(SRSDATE,1,",DR="1T;2T;3T" D ^DIE K DR G:$D(DTOUT)!$D(DUOUT) END
G OR
END D ^SRSKILL W @IOF
Q
STUFF ; stuff operating rooms and specialties
S Y=SRSDATE D D^DIQ S SRDT=Y
K DA,DIC,DD,DO,DINUM,SRTN S (X,DINUM)=SRSDATE,DIC="^SRU(",DIC(0)="L",DLAYGO=131.8 D FILE^DICN K DIC,DLAYGO
S ^SRU(SRSDATE,1,0)="^131.81PA^0^0"
S SROR=0 F S SROR=$O(^SRS(SROR)) Q:'SROR I '$P(^(SROR,0),"^",6) S X1=SRSDATE,X2=-7 D C^%DTC S SRDTOLD=X,SRDTNEW=SRSDATE D OR^SROUTUP
Q
SROUTED ;B'HAM ISC/MAM - EDIT UTILIZATION TIMES ; [ 09/22/98 11:36 AM ]
+1 ;;3.0; Surgery ;**77,50**;24 Jun 93
START WRITE @IOF,!,"Update Start and End Times for Operating Rooms",!
KILL %DT
SET %DT="AEPX"
SET %DT("A")="Update Times for which Date ? "
DO ^%DT
IF Y<0
GOTO END
+1 SET SRUL=""
FOR I=1:1:80
SET SRUL=SRUL_"-"
+2 SET SRSDATE=+Y
DO D^DIQ
SET SRSDT=Y
IF '$DATA(^SRU(SRSDATE))
DO STUFF
OR WRITE @IOF,!,"Operating Room Utilization on "_SRSDT,!,SRUL,!
KILL DIC,DA
+1 SET DIC("S")="I $$ORDIV^SROUTL0(+Y,$G(SRSITE(""DIV""))),('$P(^SRS(+Y,0),U,6))"
SET DIC="^SRS("
SET DIC(0)="QEAMZ"
SET DIC("A")="Update Start and End Times for which Operating Room ? "
DO ^DIC
KILL DIC
IF Y<0
IF $DATA(DTOUT)!$DATA(DUOUT)
GOTO END
GOTO START
+2 SET SROR=+Y
+3 WRITE !
KILL DIE,DA,DR
SET DA(1)=SRSDATE
SET DA=SROR
SET DIE="^SRU(SRSDATE,1,"
SET DR="1T;2T;3T"
DO ^DIE
KILL DR
IF $DATA(DTOUT)!$DATA(DUOUT)
GOTO END
+4 GOTO OR
END DO ^SRSKILL
WRITE @IOF
+1 QUIT
STUFF ; stuff operating rooms and specialties
+1 SET Y=SRSDATE
DO D^DIQ
SET SRDT=Y
+2 KILL DA,DIC,DD,DO,DINUM,SRTN
SET (X,DINUM)=SRSDATE
SET DIC="^SRU("
SET DIC(0)="L"
SET DLAYGO=131.8
DO FILE^DICN
KILL DIC,DLAYGO
+3 SET ^SRU(SRSDATE,1,0)="^131.81PA^0^0"
+4 SET SROR=0
FOR
SET SROR=$ORDER(^SRS(SROR))
IF 'SROR
QUIT
IF '$PIECE(^(SROR,0),"^",6)
SET X1=SRSDATE
SET X2=-7
DO C^%DTC
SET SRDTOLD=X
SET SRDTNEW=SRSDATE
DO OR^SROUTUP
+5 QUIT