source: FOIAVistA/trunk/r/SURGERY-SR/SRORATP.m@ 711

Last change on this file since 711 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1SRORATP ;B'HAM ISC/MAM - CANCEL RATES (CONT) ; [ 02/12/97 12:15 PM ]
2 ;;3.0; Surgery ;**63**;24 Jun 93
3 I SROTOT D ^SRORATA Q
4 S (SRHDR,SRSS,SRSOUT,PAGE)=0
5 F S SRSS=$O(^TMP("SRT",$J,SRSS)) Q:SRSS=""!(SRSOUT) D SP
6 Q:SRSOUT D ^SRORATA
7 Q
8SP D PAGE Q:SRSOUT S SRSSNM="** "_$S(SRSS'="ZZ":SRSS,1:"SURGICAL SPECIALTY NOT ENTERED")_" **"
9 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
10 S TOTRATE=$S(TOTAL>0:X/TOTAL*100,1:0),TOTRATE=TOTRATE+.5\1*1,TCAN=$S(TOTAL>0:Y/TOTAL*100,1:0),TCAN=TCAN+.5\1*1
11 S TPRCNT="CANCELLATION RATE FOR SCHEDULED CASES: "_TCAN_" %"
12 S SPRCNT="AVOIDABLE CANCELLATION RATE FOR SCHEDULED CASES: "_TOTRATE_" %"
13 S CPRCNT="AVOIDABLE CANCELLATION RATE FOR CANCELLED CASES: "_CANRATE_" %"
14 S TOTAL="TOTAL SCHEDULED SURGICAL CASES: "_TOTAL
15 S SRCOL=80-$L(SRSSNM)\2 W !!,?SRCOL,SRSSNM
16 W !!,TOTAL,!,TPRCNT,!,SPRCNT,!,CPRCNT D SUB
17 S REASON=0 F S REASON=$O(^TMP("SRT",$J,SRSS,REASON)) Q:REASON=""!(SRSOUT) D REASON
18 Q:SRSOUT I $Y+4>IOSL D PAGE Q:SRSOUT
19 S X=$P(^TMP("SRT",$J,SRSS),"^"),Y=$P(^(SRSS),"^",2)
20 W !,?47,"-----",?64,"-----",!,"TOTAL CANCELLATIONS",?47,$J(X,4),?64,$J(Y,4)
21 I $E(IOST)="P" W !! F LINE=1:1:80 W "="
22 W ! Q
23REASON I $Y+4>IOSL D PAGE Q:SRSOUT D SUB
24 S X=$P(^TMP("SRT",$J,SRSS,REASON),"^"),Y=$P(^(REASON),"^",2)
25 W !,$S($E(REASON,1,2)="ZZ":$E(REASON,3,45),1:REASON),?47,$J(X,4),?64,$J(Y,4)
26 Q
27PAGE I 'SRHDR S SRHDR=1 G HDR
28 S X="" I $E(IOST)'="P" W !!!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
29 I X["?" W !!,"Enter RETURN to continue printing this report, or '^' to exit from this option." G PAGE
30HDR ; print heading
31 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
32 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
33 I $E(IOST)'="P" Q
34 W !,?(80-$L(SRINST)\2),SRINST,?70,"PAGE: "_PAGE,!,?32,"SURGICAL SERVICE",!,?28,"CANCELLATION RATE REPORT",!,?27,"FROM "_X_" TO "_Y
35 S X=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3) W !,?29,"DATE PRINTED: "_X
36 W !,?21,"REVIEWED BY:",?45,"DATE REVIEWED:"
37 W ! F LINE=1:1:80 W "="
38 Q
39SUB ; print column headings
40 W !!,"CANCELLATION REASON",?45,"TOTAL CANCELS",?62,"TOTAL AVOIDABLE",! F LINE=1:1:80 W "-"
41 Q
Note: See TracBrowser for help on using the repository browser.