Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SROPLIST

SROPLIST.m

Go to the documentation of this file.
SROPLIST ;B'HAM ISC/MAM - LIST OF OPERATIONS ; [ 09/22/98  11:42 AM ]
 ;;3.0; Surgery ;**38,53,50**;24 Jun 93
 U IO S SRED1=SRED+.9999,(SRQ,TOTAL)=0,PAGE=1,SRINST=SRSITE("SITE")
 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
 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
 I 'SRQ,$Y+5>IOSL D HDR^SROPLIS
 W:'SRQ !!!,"TOTAL CASES: ",TOTAL
 G END
SET ; set variables
 I '$D(^SRF(K,.2)) Q
 I $P(^SRF(K,.2),"^",12)="" Q
 S (SRSUR,SRATT,SRFST,SRTWO)="",SRABORT=$S($P($G(^SRF(K,30)),"^"):"*ABORTED*",1:"")
 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")
 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)
 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),"^")
 S:SRFST'="" SRFST=$P(^VA(200,SRFST,0),"^") S:SRTWO'="" SRTWO=$P(^VA(200,SRTWO,0),"^")
OPS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F I=0:0 S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER=""  D OTHER
 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=""
 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
 D TECH^SROPRIN S SRANES=$S($D(SRTECH):SRTECH,1:"")
 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:"")
PRINT ;
 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
 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)
 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)
 S TOTAL=TOTAL+1
 Q
ASK I $E(IOST,1)'="P" W !!,"Press RETURN to continue or '^' to quit.  " R X:DTIME I '$T!(X="^") S SRQ=1 Q
 D HDR^SROPLIS Q
END W:$E(IOST)="P" @IOF I $D(ZTQUEUED) Q:$G(ZTSTOP)  S ZTREQ="@" Q
 I 'SRQ,($E(IOST)'="P") W !!,"Press RETURN to continue  " R X:DTIME
 D ^SRSKILL K SRTN D ^%ZISC W @IOF
 Q
OTHER ; other operations
 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>240 S SRLONG=0,OPER=999,SROPERS=" ..."
 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
 Q
LOOP ; break procedure if greater than 50 characters
 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
 Q