source: FOIAVistA/tag/r/SURGERY-SR/SROANR.m@ 733

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1SROANR ;BIR/ADM - ANESTHESIA REPORT ; [ 02/14/04 12:45 PM ]
2 ;;3.0; Surgery ;**100**;24 Jun 93
3 ;
4 ;** NOTICE: This routine is part of an implementation of a nationally
5 ;** controlled procedure. Local modifications to this routine
6 ;** are prohibited.
7 ;
8 D:'$D(SRTN) ^SROPS Q:'$D(SRTN)
9 D RPT(SRTN)
10 Q
11RPT(SRTN) ; send text of anesthesia report to ^TMP
12 N ANE,C,DFN,J,JJ,SR,SRCASE,SRG,SRI,SRL,SRN,SROR,X,Y K ^TMP("SRANE",$J)
13 S SRCASE=SRTN,SRG="^TMP(""SRANE"",$J,SRCASE)",SRI=0
14 I $P($G(^SRF(SRTN,30)),"^")!$P($G(^SRF(SRTN,31)),"^",8) D LINE(1) S @SRG@(SRI)=" * * "_$S($P($G(^SRF(SRTN,"NON")),"^")="Y":"PROCEDURE",1:"OPERATION")_" ABORTED * *" D LINE(1)
15 F SRN=0:.1:1.1,"NON" S SR(SRN)=$G(^SRF(SRTN,SRN))
16 S SROR="NOT ENTERED" S X=$P(SR(0),"^",2) I X S X=$P(^SRS(X,0),"^"),X=$P(^SC(X,0),"^"),SROR=$E(X,1,24)
17 I $P(SR("NON"),"^")="Y" S X=$P(SR("NON"),"^",2) I X S X=$P(^SC(X,0),"^"),SROR=X
18 D LINE(1) S @SRG@(SRI)=$S($P(SR("NON"),"^")="Y":"Location: ",1:"Operating Room: ")_SROR
19 S Y=$P(SR(.3),"^"),C=$P(^DD(130,.31,0),"^",2) D:Y'="" Y^DIQ,N(25) S:Y="" Y="* NOT ENTERED *" D LINE(2) S @SRG@(SRI)="Anesthetist: "_Y
20 S Y=$P(SR(.3),"^",2),C=$P(^DD(130,.32,0),"^",2) D:Y'="" Y^DIQ,N(24) S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Relief Anesth: "_Y
21 S Y=$P(SR(.3),"^",4),C=$P(^DD(130,.34,0),"^",2) D:Y'="" Y^DIQ,N(20) D LINE(1) S @SRG@(SRI)="Anesthesiologist: "_Y
22 S Y=$P(SR(.3),"^",3),C=$P(^DD(130,.33,0),"^",2) D:Y'="" Y^DIQ,N(20) S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Assist Anesth: "_Y
23 S Y=$P(SR(.3),"^",6),C=$P(^DD(130,.345,0),"^",2) D:Y'="" Y^DIQ D LINE(1) S @SRG@(SRI)="Attending Code: "_Y
24 D TIMES
25 S Y=$P(SR(1.1),"^",3),C=$P(^DD(130,1.13,0),"^",2) D:Y'="" Y^DIQ S:Y="" Y="* NOT ENTERED *" D LINE(2) S @SRG@(SRI)="ASA Class: "_Y
26 S Y=$P(SR(.4),"^",6),C=$P(^DD(130,.46,0),"^",2) D:Y'="" Y^DIQ S:Y="" Y="* NOT ENTERED *" D LINE(2) S @SRG@(SRI)="Operation Disposition: "_Y
27 D TECH^SROANR0
28 D PRIN I $O(^SRF(SRTN,13,0)) D OTHER
29 I $O(^SRF(SRTN,22,0)) D LINE(2) S @SRG@(SRI)="Medications:" D MED^SROANR0
30 D ^SROANR1
31 Q
32N(SRL) N SRN I $L(Y)>SRL S SRN=$P(Y,",")_","_$E($P(Y,",",2))_".",Y=SRN
33 Q
34TIMES ; anesthesia start and end times
35 N AB,AE,OB,OE
36 S AB="* NOT ENTERED *",Y=$P(SR(.2),"^") I Y D D^DIQ S AB=$P(Y,"@")_" "_$P(Y,"@",2)
37 S AE="* NOT ENTERED *",Y=$P(SR(.2),"^",4) I Y D D^DIQ S AE=$P(Y,"@")_" "_$P(Y,"@",2)
38 D LINE(2) S @SRG@(SRI)="Anes Begin: "_AB S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Anes End: "_AE
39 Q
40PRIN ; principal procedure information
41 N CNT,I,LOOP,M,MM,MMM,SRJ,SROPER,SROPS,SRX,SRY,SRZ,X,Z
42 D LINE(2) S @SRG@(SRI)="Procedure(s) Performed:"
43PRIN2 S SROPER=$P(^SRF(SRTN,"OP"),"^")
44 S SROPER="Principal: "_SROPER
45 S:$L(SROPER)<74 SROPS(1)=SROPER I $L(SROPER)>73 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
46 F I=1:1 Q:'$D(SROPS(I)) D LINE(1) S @SRG@(SRI)=$S(I=1:"",1:" ")_SROPS(I)
47 Q
48LOOP ; break procedure if greater than 74 characters
49 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<74 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
50 Q
51OTHER ; other procedures
52 N CNT,OTH,OTHER,SRJ,SRX,SRY,SRZ,Z
53 S (OTH,CNT)=0 F S OTH=$O(^SRF(SRTN,13,OTH)) Q:'OTH S CNT=CNT+1 D OTH
54 Q
55OTH S OTHER=$P(^SRF(SRTN,13,OTH,0),"^")
56 D LINE(1) S @SRG@(SRI)="Other: "_OTHER
57 Q
58SPACE(NUM) ; create spaces
59 ; pass in position returns number of needed spaces
60 I '$D(@SRG@(SRI)) S @SRG@(SRI)=""
61 Q $J("",NUM-$L(@SRG@(SRI)))
62LINE(NUM) ; create carriage returns
63 F J=1:1:NUM S SRI=SRI+1,@SRG@(SRI)=""
64 Q
Note: See TracBrowser for help on using the repository browser.