source: WorldVistAEHR/trunk/r/SURGERY-SR/SROPRI2.m@ 1259

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

initial load of WorldVistAEHR

File size: 2.4 KB
RevLine 
[613]1SROPRI2 ;B'HAM ISC/MAM - TOTAL OPERATIONS (BY PRIORITY) ; [ 07/27/98 2:33 PM ]
2 ;;3.0; Surgery ;**50**;24 Jun 93
3 U IO K ^TMP("SRLIST",$J),^TMP("SR",$J) S SRHDR=0
4 S ^TMP("SRLIST",$J)=0 D PLIST^SROPRIT S X="" F S X=$O(SRCODE(X)) Q:X="" S ^TMP("SRLIST",$J,SRCODE(X))=0
5 S SRLINE="" F X=1:1:80 S SRLINE=SRLINE_"_"
6 F S SRD=$O(^SRF("AC",SRD)) Q:SRD=""!(SRD>SRED1) S SRTN=0 F S SRTN=$O(^SRF("AC",SRD,SRTN)) Q:SRTN="" I $D(^SRF(SRTN,0)),$$DIV^SROUTL0(SRTN) D UTIL
7 I ^TMP("SRLIST",$J,"6. PRIORITY NOT ENTERED")=0 K ^TMP("SRLIST",$J,"6. PRIORITY NOT ENTERED")
8 D HDR Q:SRSOUT S X=0 F S X=$O(^TMP("SRLIST",$J,X)) Q:X="" W !,?24,X,?50,$J(^(X),6)
9 W !!!,?24,"TOTAL SURGICAL CASES: ",?50,$J(^TMP("SRLIST",$J),6),!!!!!
10 I SRSS="" D RET Q
11 S SRHDR=1,SRSS=0 F S SRSS=$O(^TMP("SR",$J,SRSS)) Q:SRSS=""!(SRSOUT) D RET S PRIOR=0 D NO6 F S PRIOR=$O(^TMP("SR",$J,SRSS,PRIOR)) D:PRIOR="" TOT Q:PRIOR=""!(SRSOUT) D PRINT
12 I $E(IOST)'="P",'SRSOUT W !! K DIR S DIR(0)="FOA",DIR("A")=" Press RETURN to continue. " D ^DIR
13 Q
14UTIL ; set UTILITY("SRLIST",$J
15 Q:$P($G(^SRF(SRTN,.2)),"^",12)=""
16 S SR(0)=^SRF(SRTN,0),X=$P(SR(0),"^",10) S:X="" X="ZZ" S X=SRCODE(X)
17 S SP=$P(SR(0),"^",4),SP=$S(SP:$P(^SRO(137.45,SP,0),"^"),1:"SPECIALTY NOT ENTERED")
18 S ^TMP("SRLIST",$J,X)=^TMP("SRLIST",$J,X)+1,^TMP("SRLIST",$J)=^TMP("SRLIST",$J)+1
19 I '$D(^TMP("SR",$J,SP)) S ^TMP("SR",$J,SP)=0,MM="" F S MM=$O(SRCODE(MM)) Q:MM="" S ^TMP("SR",$J,SP,SRCODE(MM))=0
20 I '$D(^TMP("SR",$J,SP,X)) S ^TMP("SR",$J,SP,X)=0
21 S ^TMP("SR",$J,SP)=^TMP("SR",$J,SP)+1,^TMP("SR",$J,SP,X)=^TMP("SR",$J,SP,X)+1
22 Q
23RET S X="" I $E(IOST)'="P" W !!," Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
24 I X["?" W !!,"Press RETURN to continue with the List of Surgical Cases sorted by Surgical",!,"Priority, or '^' if you do not want to review any additional information." G RET
25 I 'SRHDR Q
26HDR ; print heading
27 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
28 W:$Y @IOF W !,?(80-$L(SRINST)\2),SRINST,!,?32,"SURGICAL SERVICE",!,?21,"TOTAL OPERATIONS BY SURGICAL PRIORITY"
29 W !,?(80-$L(SRFRTO)\2),SRFRTO W:$E(IOST)="P" !,?28,SRPRINT W !,SRLINE,!
30 I SRHDR W !,?(80-$L(SRSS)\2),SRSS,!
31 Q
32PRINT ; print information for specialty
33 W !,?24,PRIOR,?50,$J(^TMP("SR",$J,SRSS,PRIOR),6)
34 Q
35TOT ; print total for the specialty
36 W !!!,?24,"TOTAL SURGICAL CASES",?50,$J(^TMP("SR",$J,SRSS),6),!!!!!
37 Q
38NO6 ; delete 6. PRIORITY NOT ENTERED
39 I ^TMP("SR",$J,SRSS,"6. PRIORITY NOT ENTERED")=0 K ^TMP("SR",$J,SRSS,"6. PRIORITY NOT ENTERED")
40 Q
Note: See TracBrowser for help on using the repository browser.