SRORATS ;B'HAM ISC/MAM - CANCEL RATES ; 12 DEC 1990 8:30 AM
;;3.0; Surgery ;;24 Jun 93
D PAGE S SRSS=0 F S SRSS=$O(^TMP("SRT",$J,SRSS)) Q:SRSS=""!(SRSOUT) D SPEC
Q
SPEC I $Y+4>IOSL D PAGE I SRSOUT Q
S SRSSNM=$S(SRSS="ZZ":"SURGICAL SPECIALTY NOT ENTERED",1:SRSS)
S X=^TMP("SRT",$J,SRSS),Y=$P(X,"^"),TOTAL=Y+$P(X,"^",3),X=$P(X,"^",2),CANRATE=$S(Y>0:X/Y*100,1:0),CANRATE=CANRATE+.5\1*1
S TOTRATE=$S(TOTAL>0:X/TOTAL*100,1:0),TOTRATE=TOTRATE+.5\1*1
W !,SRSSNM,?49,$J(TOTRATE,3)," %",?69,$J(CANRATE,3)," %"
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 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 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
I $E(IOST)="P" W !,?(80-$L(SRINST)\2),SRINST,?70,"PAGE: "_PAGE,!,?32,"SURGICAL SERVICE",!,?20,"CANCELLATION RATE REPORT, SPECIALTY SUMMARY",!,?27,"FROM "_X_" TO "_Y
I $E(IOST)="P" S X=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3) W !,?29,"DATE PRINTED: "_X
I $E(IOST)="P" W !,?21,"REVIEWED BY:",?45,"DATE REVIEWED:",!
W !,?45,"PERCENT AVOIDABLE CANCELLATIONS",!,?43,"-----------------------------------"
W !,"SURGICAL SPECIALTY",?43,"SCHEDULED CASES CANCELLED CASES"
W ! F LINE=1:1:80 W "="
W !!
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSRORATS 1451 printed Dec 13, 2024@02:45:39 Page 2
SRORATS ;B'HAM ISC/MAM - CANCEL RATES ; 12 DEC 1990 8:30 AM
+1 ;;3.0; Surgery ;;24 Jun 93
+2 DO PAGE
SET SRSS=0
FOR
SET SRSS=$ORDER(^TMP("SRT",$JOB,SRSS))
if SRSS=""!(SRSOUT)
QUIT
DO SPEC
+3 QUIT
SPEC IF $Y+4>IOSL
DO PAGE
IF SRSOUT
QUIT
+1 SET SRSSNM=$SELECT(SRSS="ZZ":"SURGICAL SPECIALTY NOT ENTERED",1:SRSS)
+2 SET X=^TMP("SRT",$JOB,SRSS)
SET Y=$PIECE(X,"^")
SET TOTAL=Y+$PIECE(X,"^",3)
SET X=$PIECE(X,"^",2)
SET CANRATE=$SELECT(Y>0:X/Y*100,1:0)
SET CANRATE=CANRATE+.5\1*1
+3 SET TOTRATE=$SELECT(TOTAL>0:X/TOTAL*100,1:0)
SET TOTRATE=TOTRATE+.5\1*1
+4 WRITE !,SRSSNM,?49,$JUSTIFY(TOTRATE,3)," %",?69,$JUSTIFY(CANRATE,3)," %"
+5 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 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 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,?70,"PAGE: "_PAGE,!,?32,"SURGICAL SERVICE",!,?20,"CANCELLATION RATE REPORT, SPECIALTY SUMMARY",!,?27,"FROM "_X_" TO "_Y
+4 IF $EXTRACT(IOST)="P"
SET X=$EXTRACT(DT,4,5)_"/"_$EXTRACT(DT,6,7)_"/"_$EXTRACT(DT,2,3)
WRITE !,?29,"DATE PRINTED: "_X
+5 IF $EXTRACT(IOST)="P"
WRITE !,?21,"REVIEWED BY:",?45,"DATE REVIEWED:",!
+6 WRITE !,?45,"PERCENT AVOIDABLE CANCELLATIONS",!,?43,"-----------------------------------"
+7 WRITE !,"SURGICAL SPECIALTY",?43,"SCHEDULED CASES CANCELLED CASES"
+8 WRITE !
FOR LINE=1:1:80
WRITE "="
+9 WRITE !!