source: FOIAVistA/trunk/r/SURGERY-SR/SROPLIST.m@ 1470

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1SROPLIST ;B'HAM ISC/MAM - LIST OF OPERATIONS ; [ 09/22/98 11:42 AM ]
2 ;;3.0; Surgery ;**38,53,50**;24 Jun 93
3 U IO S SRED1=SRED+.9999,(SRQ,TOTAL)=0,PAGE=1,SRINST=SRSITE("SITE")
4 N SRFRTO S Y=DT X ^DD("DD") S SRPRINT="DATE PRINTED: "_Y S Y=SRSD X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: ",Y=SRED X ^DD("DD") S SRFRTO=SRFRTO_Y D HDR^SROPLIS
5 F S SRD=$O(^SRF("AC",SRD)) Q:SRD=""!(SRD>SRED1)!SRQ S K=0 F S K=$O(^SRF("AC",SRD,K)) Q:K=""!SRQ I $D(^SRF(K,0)),$$DIV^SROUTL0(K) D SET
6 I 'SRQ,$Y+5>IOSL D HDR^SROPLIS
7 W:'SRQ !!!,"TOTAL CASES: ",TOTAL
8 G END
9SET ; set variables
10 I '$D(^SRF(K,.2)) Q
11 I $P(^SRF(K,.2),"^",12)="" Q
12 S (SRSUR,SRATT,SRFST,SRTWO)="",SRABORT=$S($P($G(^SRF(K,30)),"^"):"*ABORTED*",1:"")
13 K SROP S SRTN=K,S(0)=^SRF(SRTN,0),DFN=$P(S(0),"^",1) D DEM^VADPT S SRNM=VADM(1),SRSSN=VA("PID")
14 S SRDT=$P(S(0),"^",9),SRTS=$S($P(S(0),"^",4)]"":$P(^SRO(137.45,$P(S(0),"^",4),0),"^"),1:"SPECIALTY NOT ENTERED"),SROD=$P(S(0),"^",9)
15 S:$D(^SRF(SRTN,.1)) S(.1)=^(.1),SRSUR=$P(S(.1),"^",4),SRATT=$P(S(.1),"^",13),SRFST=$P(S(.1),"^",5),SRTWO=$P(S(.1),"^",6) S:SRSUR'="" SRSUR=$P(^VA(200,SRSUR,0),"^") S:SRATT'="" SRATT=$P(^VA(200,SRATT,0),"^")
16 S:SRFST'="" SRFST=$P(^VA(200,SRFST,0),"^") S:SRTWO'="" SRTWO=$P(^VA(200,SRTWO,0),"^")
17OPS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F I=0:0 S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
18 K SROPS,MM,MMM S:$L(SROPER)<50 SROPS(1)=SROPER I $L(SROPER)>49 S SROPER=SROPER_" " S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
19 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
20 D TECH^SROPRIN S SRANES=$S($D(SRTECH):SRTECH,1:"")
21 S A=$P(S(0),"^",10),SRTYPE=$S(A="EL":"ELECTIVE",A="EM":"EMERGENCY",A="A":"ADD ON, NONEMERGENT",A="S":"STANDBY",A="U":"URGENT, ADD TODAY",1:"")
22PRINT ;
23 S Z=0 D:$Y+8>IOSL ASK Q:SRQ W !!,$E(SROD,4,5)_"/"_$E(SROD,6,7)_"/"_$E(SROD,2,3),?13,$E(SRNM,1,24),?38,SRTS
24 W ?90,$E(SRSUR,1,23),?114,$E(SRANES,1,14),!,SRTN,?13,VA("PID"),?38,SROPS(1),?90,$E(SRFST,1,23),?114,"OP TIME: "_SROT_" MIN.",!,SRABORT,?13,SRTYPE W:$D(SROPS(2)) ?38,SROPS(2) W ?90,$E(SRTWO,1,23)
25 W:$D(SROPS(3)) !,?38,SROPS(3) I $D(SROPS(4)) W !,?38,SROPS(4) I $D(SROPS(5)) W !,?38,SROPS(5) I $D(SROPS(6)) W !,?38,SROPS(6)
26 S TOTAL=TOTAL+1
27 Q
28ASK I $E(IOST,1)'="P" W !!,"Press RETURN to continue or '^' to quit. " R X:DTIME I '$T!(X="^") S SRQ=1 Q
29 D HDR^SROPLIS Q
30END W:$E(IOST)="P" @IOF I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
31 I 'SRQ,($E(IOST)'="P") W !!,"Press RETURN to continue " R X:DTIME
32 D ^SRSKILL K SRTN D ^%ZISC W @IOF
33 Q
34OTHER ; other operations
35 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>240 S SRLONG=0,OPER=999,SROPERS=" ..."
36 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
37 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
38 Q
39LOOP ; break procedure if greater than 50 characters
40 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
41 Q
Note: See TracBrowser for help on using the repository browser.