source: WorldVistAEHR/trunk/r/SURGERY-SR/SRODLT0.m@ 1006

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1SRODLT0 ;B'HAM ISC/ADM - REPORT OF DELAY TIME (CONT) ; [ 04/05/00 2:37 PM ]
2 ;;3.0; Surgery ;**94**;24 Jun 93
3 U IO K ^TMP("SR",$J),REASON S (SRHDR,SRSOUT,SRREA)=0,PAGE=1
4 S SRSDT=$E(SRSD,4,5)_"/"_$E(SRSD,6,7)_"/"_$E(SRSD,2,3),SRSD=SRSD-.0001
5 S SREDT=$E(SRED,4,5)_"/"_$E(SRED,6,7)_"/"_$E(SRED,2,3),SRED=SRED+.9999
6 S SRPRINT=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
7 I SRDL F S SRREA=$O(SRDL(SRREA)) Q:'SRREA S ^TMP("SR",$J,SRREA)="0^0" I SRSP S SRSS=0 F S SRSS=$O(SRSP(SRSS)) Q:'SRSS S ^TMP("SR",$J,SRREA,SRSS)="0^0"
8AC F S SRSD=$O(^SRF("AC",SRSD)) Q:'SRSD!(SRSD>SRED) S SRCASE=0 F S SRCASE=$O(^SRF("AC",SRSD,SRCASE)) Q:'SRCASE I $D(^SRF(SRCASE,0)),$$MANDIV^SROUTL0(SRINSTP,SRCASE) D UTIL
9 D HDR I '$D(^TMP("SR",$J)) W !!,"No data for selected date range."
10 S SRREA=0 F S SRREA=$O(^TMP("SR",$J,SRREA)) Q:'SRREA!(SRSOUT) S REASON=">> Delay Reason: "_$P(^SRO(132.4,SRREA,0),"^")_" <<" D SUB,SPEC I SRCT'=1 D:'SRSOUT TOTAL
11 I 'SRSOUT,'SRDL,'SRSP D ^SRODLT1
12 I 'SRSOUT,'SRDL,SRSP D ^SRODLT2
13 D END Q
14SPEC S SRSS="",SRCT=0 F S SRSS=$O(^TMP("SR",$J,SRREA,SRSS)) Q:SRSS=""!(SRSOUT) S SRSPEC=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"NO SPECIALTY ENTERED"),SRCT=SRCT+1 D PRINT
15 Q
16PRINT ; print specialty data
17 I $Y+5>IOSL D HDR I SRSOUT Q
18 S Y=^TMP("SR",$J,SRREA,SRSS),SRDLAY=$P(Y,"^"),SRDLT=$P(Y,"^",2)
19 W !,$E(SRSPEC,1,30),?33,$J(SRDLAY,5),?46,$J(SRDLT,5)
20 Q
21TOTAL ; print delay reason totals
22 I $Y+5>IOSL D HDR I SRSOUT Q
23 S Y=^TMP("SR",$J,SRREA),SRDLAY=$P(Y,"^"),SRDLT=$P(Y,"^",2)
24 W !!,?24,"TOTAL",?32,$J(SRDLAY,6),?45,$J(SRDLT,6)
25 Q
26HDR ; print heading
27 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
28 I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit. " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
29 W:$Y @IOF W !,?(80-$L(SRINST)\2),SRINST,?72,"PAGE ",PAGE,!,?29,"Report of Delay Times"
30 W !,?27,"From "_SRSDT_" To "_SREDT,! I $E(IOST)="P" W "Printed: "_SRPRINT,!,?21,"Reviewed by:",?45,"Date Reviewed:",!
31 W !,?34,"# OF",?45,"MINUTES",!,"SURGICAL SPECIALTY",?33,"DELAYS",?45,"DELAYED",! F LINE=1:1:80 W "="
32 S (SRPAGE,SRHDR)=1,PAGE=PAGE+1 D:$D(REASON) SUB1
33 Q
34SUB ; print delay reason sub-heading
35 I $Y+7>IOSL D HDR I SRSOUT!('SRPAGE) Q
36 I 'SRPAGE W !! F LINE=1:1:80 W "-"
37SUB1 W !,?(80-$L(REASON)\2),REASON,! S SRPAGE=0
38 Q
39UTIL ; set ^TMP
40 Q:'$O(^SRF(SRCASE,17,0))
41 Q:$P($G(^SRF(SRCASE,.2)),"^",12)=""
42 S SRSS=$P(^SRF(SRCASE,0),"^",4) S:SRSS="" SRSS="ZZ" I SRSP,'$D(SRSP(SRSS)) Q
43 S SRDLAY=0 F S SRDLAY=$O(^SRF(SRCASE,17,SRDLAY)) Q:'SRDLAY S SRREA=$P(^SRF(SRCASE,17,SRDLAY,0),"^") D SET
44 Q
45SET I SRDL,'$D(SRDL(SRREA)) Q
46 I '$D(^TMP("SR",$J,SRREA)) S ^TMP("SR",$J,SRREA)="0^0"
47 I '$D(^TMP("SR",$J,SRREA,SRSS)) S ^TMP("SR",$J,SRREA,SRSS)="0^0"
48 S SRDLT=$P(^SRF(SRCASE,17,SRDLAY,0),"^",2) S:SRDLT="" SRDLT=0
49 S $P(^TMP("SR",$J,SRREA),"^",2)=$P(^TMP("SR",$J,SRREA),"^",2)+SRDLT
50 S $P(^TMP("SR",$J,SRREA),"^")=$P(^TMP("SR",$J,SRREA),"^")+1
51 S $P(^TMP("SR",$J,SRREA,SRSS),"^",2)=$P(^TMP("SR",$J,SRREA,SRSS),"^",2)+SRDLT
52 S $P(^TMP("SR",$J,SRREA,SRSS),"^")=$P(^TMP("SR",$J,SRREA,SRSS),"^")+1
53 Q
54END I 'SRSOUT,$E(IOST)'="P" W !!,"Press RETURN to continue " R X:DTIME
55 W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
56 D ^%ZISC,^SRSKILL W @IOF
57 Q
Note: See TracBrowser for help on using the repository browser.