source: FOIAVistA/tag/r/SURGERY-SR/SROPAC0.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1SROPAC0 ;B'HAM ISC/MAM - DAILY ACTIVITY REPORT ; [ 07/27/98 2:33 PM ]
2 ;;3.0; Surgery ;**34,50**;24 Jun 93
3 S SRSOUT=0 D HDR^SROPAC1
4 S SROR=0 F S SROR=$O(^TMP("SRACT",$J,SROR)) Q:SROR=""!(SRSOUT) D ROOM S SRSDATE=0 F S SRSDATE=$O(^TMP("SRACT",$J,SROR,SRSDATE)) Q:'SRSDATE!(SRSOUT) D CASE
5 I '$D(^TMP("SRACT",$J)) W $$NODATA^SROUTL0()
6 Q
7CASE S SRTN=0 F S SRTN=$O(^TMP("SRACT",$J,SROR,SRSDATE,SRTN)) Q:'SRTN!(SRSOUT) D SET
8 Q
9SET ;
10 S DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT
11 S SRNM=VADM(1) I $L(SRNM)>23 S SRNM=$P(SRNM,",")_","_$E($P(SRNM,",",2))
12 K SRSLOC I $D(^DPT(DFN,.1)) S SRSLOC=$P(^(.1),"^") I $D(^DPT(DFN,.101)) S SRSLOC=SRSLOC_" "_$P(^(.101),"^")
13 I '$D(SRSLOC) S SRSLOC="OUTPATIENT"
14 S (SRSUR,SRFST,SRATT,SRAN1,SRAN2)="",SR(.1)=$S($D(^SRF(SRTN,.1)):^(.1),1:""),SR(.3)=$S($D(^SRF(SRTN,.3)):^(.3),1:"")
15 S SRSUR=$P(SR(.1),"^",4),SRATT=$P(SR(.1),"^",13),SRFST=$P(SR(.1),"^",5),SRAN1=$P(SR(.3),"^",4),SRAN2=$P(SR(.3),"^") S:SRSUR'="" SRSUR=$P(^VA(200,SRSUR,0),"^") S:SRATT'="" SRATT=$P(^VA(200,SRATT,0),"^") S:SRFST'="" SRFST=$P(^VA(200,SRFST,0),"^")
16 S:SRAN1'="" SRAN1=$P(^VA(200,SRAN1,0),"^") S:SRAN2'="" SRAN2=$P(^VA(200,SRAN2,0),"^")
17 F USER="SRSUR","SRFST","SRATT","SRAN1","SRAN2" S:'$D(@USER) @USER="" I @USER]"" S @USER=$P(@USER,",")_","_$E($P(@USER,",",2))
18 S SRDIAG=$S($D(^SRF(SRTN,34)):$P(^(34),"^"),1:"")
19OPS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F I=0:0 S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
20 K SROP,MM,MMM S:$L(SROPER)<50 SROP(1)=SROPER I $L(SROPER)>49 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
21 S SRINTIME=$P(^SRF(SRTN,.2),"^",10),SROUTIME=$P(^(.2),"^",12)
22 S Y=SRINTIME D D^DIQ S SRINTIME=$E(SRINTIME,4,5)_"/"_$E(SRINTIME,6,7)_" "_$P(Y,"@",2)
23 I 'SROUTIME S SROUTIME="-----"
24 I SROUTIME S Y=SROUTIME D D^DIQ S SROUTIME=$E(SROUTIME,4,5)_"/"_$E(SROUTIME,6,7)_" "_$P(Y,"@",2)
25 D ^SROPAC1
26 Q
27OTHER ; other operations
28 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>250 S SRLONG=0,OPER=999,SROPERS=" ..."
29 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
30 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
31 Q
32LOOP ; break procedure if greater than 50 characters
33 S SROP(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROP(M))+$L(MM)'<50 S SROP(M)=SROP(M)_MM_" ",SROPER=MMM
34 Q
35ROOM I $Y+9>IOSL D PAGE^SROPAC1 Q
36 W !!,"OPERATING ROOM: "_SROR,!
37 Q
Note: See TracBrowser for help on using the repository browser.