source: WorldVistAEHR/trunk/r/SURGERY-SR/SROPRI.m@ 1432

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

initial load of WorldVistAEHR

File size: 3.9 KB
RevLine 
[613]1SROPRI ;B'HAM ISC/MAM - LIST OF OPERATIONS BY PRIORITY ; [ 09/22/98 11:42 AM ]
2 ;;3.0; Surgery ;**38,53,50**;24 Jun 93
3 U IO S (SRHDR,SRQ)=0,PAGE=1,SRINST=SRSITE("SITE") K ^TMP("SRLIST",$J),^TMP("SRSS",$J)
4 N SRFRTO S Y=SRSD X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: ",Y=SRED X ^DD("DD") S SRFRTO=SRFRTO_Y,Y=DT X ^DD("DD") S SRPRINT="DATE PRINTED: "_Y
5 S SRD=SRSD-.0001,SRED1=SRED+.9999,SRSOUT=0 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
6 D PRIORITY^SROPRIO
7 S SRP="" I SRORD F S SRP=$O(^TMP("SRLIST",$J,SRP)) Q:SRP=""!(SRQ) S SRSS="" F S SRSS=$O(^TMP("SRLIST",$J,SRP,SRSS)) Q:SRSS=""!(SRQ) D SPEC
8 I SRORD,SRSP S SRSS="" F S SRSS=$O(SRSP(SRSS)) Q:SRSS=""!SRQ I '$D(^TMP("SRSS",$J,SRSS)) D NONE
9 I 'SRORD F S SRP=$O(^TMP("SRLIST",$J,SRP)) Q:SRP=""!(SRQ) D HDR^SROPRIO Q:SRQ D ALL
10 I 'SRSP,'$D(^TMP("SRLIST",$J)) D HDR^SROPRIO W $$NODATA^SROUTL0()
11END I 'SRQ,$E(IOST)'="P" W !!,"Press RETURN to continue or '^' to quit. " R X:DTIME
12 W:$E(IOST)="P" @IOF K ^TMP("SRLIST",$J) I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
13 D ^%ZISC W @IOF D ^SRSKILL K SRTN
14 Q
15UTIL ; set ^TMP("SRLIST",$J
16 Q:$P($G(^SRF(SRTN,.2)),"^",12)=""
17 S S(0)=^SRF(SRTN,0) S SRP=$P(S(0),"^",10) S:SRP="" SRP="ZZ" I SRPRIO'="ALL",SRP'=SRPRIO Q
18 S SRSS=$P(S(0),"^",4) S:SRSS="" SRSS="ZZ" I SRSP,'$D(SRSP(SRSS)) Q
19 S ^TMP("SRSS",$J,SRSS)="" I SRORD S ^TMP("SRLIST",$J,SRP,SRSS,SRD,SRTN)="" Q
20 S ^TMP("SRLIST",$J,SRP,SRD,SRTN)=""
21 Q
22SPEC S SRSPEC=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"NO SPECIALTY ENTERED") D HDR^SROPRIO Q:SRQ
23 S (TOTAL,SRD)=0 F S SRD=$O(^TMP("SRLIST",$J,SRP,SRSS,SRD)) Q:'SRD!(SRQ) S SRTN=0 F S SRTN=$O(^TMP("SRLIST",$J,SRP,SRSS,SRD,SRTN)) Q:'SRTN!(SRQ) S TOTAL=TOTAL+1 D CASE
24 Q:SRQ I $Y+5>IOSL D HDR^SROPRIO I SRQ Q
25 W !!!,"TOTAL ",SRSPEC,": ",TOTAL
26 Q
27NONE S SRSPEC=$P(^SRO(137.45,SRSS,0),"^") D HDR^SROPRIO Q:SRQ
28 W !!,"TOTAL ",SRSPEC,": 0"
29 Q
30ALL S (SRD,TOTAL)=0 F S SRD=$O(^TMP("SRLIST",$J,SRP,SRD)) Q:'SRD!(SRQ) S SRTN=0 F S SRTN=$O(^TMP("SRLIST",$J,SRP,SRD,SRTN)) Q:'SRTN!(SRQ) D CASE S TOTAL=TOTAL+1
31 Q:SRQ I $Y+5>IOSL D HDR^SROPRIO I SRQ Q
32 W !!!,"TOTAL ",SRCODE(SRP),": ",TOTAL
33 Q
34CASE ; print individual case
35 I $Y+7>IOSL D HDR^SROPRIO I SRQ Q
36 S S(0)=^SRF(SRTN,0),DFN=$P(S(0),"^") D DEM^VADPT S SRNM=VADM(1),SRSSN=VA("PID"),SROD=$P(S(0),"^",9),(SRSUR,SRFST,SRTWO)=""
37 I 'SRORD S SRSS=$P(S(0),"^",4),SRSS=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"NO SPECIALTY ENTERED")
38 S S(.1)=$G(^SRF(SRTN,.1)) S SRSUR=$P(S(.1),"^",4),SRFST=$P(S(.1),"^",5),SRTWO=$P(S(.1),"^",6) S:SRSUR'="" SRSUR=$P(^VA(200,SRSUR,0),"^")
39 S:SRFST'="" SRFST=$P(^VA(200,SRFST,0),"^") S:SRTWO'="" SRTWO=$P(^VA(200,SRTWO,0),"^")
40OPS K SROPERS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
41 K SROPS,MM,MMM S:$L(SROPER)<50 SROPS(1)=SROPER I $L(SROPER)>49 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
42 S SROT=0 I $D(^SRF(SRTN,.2)),$P(^(.2),"^",2)]"",$P(^(.2),"^",3)]"" S X=$P(^SRF(SRTN,.2),"^",2),X1=$P(^(.2),"^",3) D MINS^SRSUTL2 S SROT=X
43 D TECH^SROPRIN
44 S SRANES=$S($D(SRTECH):SRTECH,1:""),SRABORT=$S($P($G(^SRF(SRTN,30)),"^"):"*ABORTED*",1:"")
45PRINT ;
46 W !!,?1,$E(SROD,4,5)_"/"_$E(SROD,6,7)_"/"_$E(SROD,2,3),?13,$E(SRNM,1,26),?38,SROPS(1)
47 W ?90,$E(SRSUR,1,23),?114,$E(SRANES,1,14),!,?1,SRTN,?13,VA("PID") W:$D(SROPS(2)) ?38,SROPS(2) W ?90,$E(SRFST,1,23),?114,"OP TIME: ",SROT," MIN.",!,SRABORT
48 W:'SRORD ?13,"(",$P(SRSS,"("),")" W:$D(SROPS(3)) ?38,SROPS(3) W ?90,$E(SRTWO,1,23)
49 I $D(SROPS(4)) W !,?38,SROPS(4) I $D(SROPS(5)) W !,?38,SROPS(5) I $D(SROPS(6)) W !,?38,SROPS(6)
50 Q
51LOOP ; break procedure if greater than 50 characters
52 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<50 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
53 Q
54OTHER ; other operations
55 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>250 S SRLONG=0,OPER=999,SROPERS=" ..."
56 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
57 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
58 Q
Note: See TracBrowser for help on using the repository browser.