SROREA ;B'HAM ISC/MAM - DELAY REASONS ; 3 DEC 1990 2:20 PM
;;3.0; Surgery ;;24 Jun 93
I SROTOT D HDR Q:SRSOUT
I 'SROTOT D PAGE Q:SRSOUT
S CAUSE=0 F S CAUSE=$O(^TMP("SR",$J,CAUSE)) Q:'CAUSE!(SRSOUT) D PRINT
Q:SRSOUT W !!,"TOTAL DELAY REASONS",?65,$J(^TMP("SR",$J),5)
Q
PRINT ; display results
I $Y+4>IOSL D PAGE I SRSOUT Q
W !,$P(^SRO(132.4,CAUSE,0),"^"),?65,$J(^TMP("SR",$J,CAUSE),5)
Q
PAGE 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 displaying the delay reasons for the entire",!,"medical center." G PAGE
HDR ; print heading
I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
S X=$E(SRSD,4,5)_"/"_$E(SRSD,6,7)_"/"_$E(SRSD,2,3),Y=$E(SRED,4,5)_"/"_$E(SRED,6,7)_"/"_$E(SRED,2,3),PAGE=PAGE+1 I $Y W @IOF
W:$E(IOST)="P" !,?(80-$L(SRINST)\2),SRINST,!,?32,"SURGICAL SERVICE" W !,?28,"REPORT OF DELAY REASONS",!,?27,"FROM "_X_" TO "_Y
I $E(IOST)="P" W !!,?21,"REVIEWED BY:",?45,"DATE REVIEWED:",!!
W !! F LINE=1:1:80 W "="
W !!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROREA 1069 printed Dec 13, 2024@02:45:40 Page 2
SROREA ;B'HAM ISC/MAM - DELAY REASONS ; 3 DEC 1990 2:20 PM
+1 ;;3.0; Surgery ;;24 Jun 93
+2 IF SROTOT
DO HDR
if SRSOUT
QUIT
+3 IF 'SROTOT
DO PAGE
if SRSOUT
QUIT
+4 SET CAUSE=0
FOR
SET CAUSE=$ORDER(^TMP("SR",$JOB,CAUSE))
if 'CAUSE!(SRSOUT)
QUIT
DO PRINT
+5 if SRSOUT
QUIT
WRITE !!,"TOTAL DELAY REASONS",?65,$JUSTIFY(^TMP("SR",$JOB),5)
+6 QUIT
PRINT ; display results
+1 IF $Y+4>IOSL
DO PAGE
IF SRSOUT
QUIT
+2 WRITE !,$PIECE(^SRO(132.4,CAUSE,0),"^"),?65,$JUSTIFY(^TMP("SR",$JOB,CAUSE),5)
+3 QUIT
PAGE SET X=""
IF $EXTRACT(IOST)'="P"
WRITE !!,"Press RETURN to continue, or '^' to quit: "
READ X:DTIME
IF '$TEST!(X["^")
SET SRSOUT=1
QUIT
+1 IF X["?"
WRITE !!,"Enter RETURN to continue displaying the delay reasons for the entire",!,"medical center."
GOTO PAGE
HDR ; print heading
+1 IF $DATA(ZTQUEUED)
DO ^SROSTOP
IF SRHALT
SET SRSOUT=1
QUIT
+2 SET X=$EXTRACT(SRSD,4,5)_"/"_$EXTRACT(SRSD,6,7)_"/"_$EXTRACT(SRSD,2,3)
SET Y=$EXTRACT(SRED,4,5)_"/"_$EXTRACT(SRED,6,7)_"/"_$EXTRACT(SRED,2,3)
SET PAGE=PAGE+1
IF $Y
WRITE @IOF
+3 if $EXTRACT(IOST)="P"
WRITE !,?(80-$LENGTH(SRINST)\2),SRINST,!,?32,"SURGICAL SERVICE"
WRITE !,?28,"REPORT OF DELAY REASONS",!,?27,"FROM "_X_" TO "_Y
+4 IF $EXTRACT(IOST)="P"
WRITE !!,?21,"REVIEWED BY:",?45,"DATE REVIEWED:",!!
+5 WRITE !!
FOR LINE=1:1:80
WRITE "="
+6 WRITE !!
+7 QUIT