source: WorldVistAEHR/trunk/r/SURGERY-SR/SRONRPT0.m@ 1696

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

initial load of WorldVistAEHR

File size: 7.9 KB
Line 
1SRONRPT0 ;BIR/ADM - NURSE INTRAOP REPORT ;05/31/06
2 ;;3.0; Surgery ;**100,129,147,153,157**;24 Jun 93;Build 3
3 ;** NOTICE: This routine is part of an implementation of a nationally
4 ;** controlled procedure. Local modifications to this routine
5 ;** are prohibited.
6 ;
7 D LINE(2) S @SRG@(SRI)="OR Support Personnel:" D LINE(1) S @SRG@(SRI)=" Scrubbed",@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Circulating" D NURSE
8 S SRLF=1,SRLINE="Other Persons in OR: " I '$O(^SRF(SRTN,32,0)),SRALL D LINE(1) S @SRG@(SRI)=SRLINE_"N/A"
9 I $O(^SRF(SRTN,32,0)) D LINE(1) S @SRG@(SRI)=SRLINE D
10 .S OTH=0 F S OTH=$O(^SRF(SRTN,32,OTH)) Q:'OTH D
11 ..S X=^SRF(SRTN,32,OTH,0),SRLINE=" "_$P(X,"^")
12 ..S Y=$P(X,"^",2) S:Y'="" SRLINE=SRLINE_" ("_Y_")"
13 ..D LINE(1) S @SRG@(SRI)=SRLINE
14 S SRLF=1
15 S X=$P(SR(.1),"^",9),SRMOOD=$S(X:$E($P(^SRO(135.3,X,0),"^"),1,20),1:"N/A")
16 S X=$P(SR(.1),"^",15),SRCONS=$S(X:$E($P(^SRO(135.4,X,0),"^"),1,24),1:"N/A")
17 S X=$P(SR(0),"^",7),SRSKIN=$S(X:$E($P(^SRO(135.2,X,0),"^"),1,20),1:"N/A")
18 S Y=$P(SR(.1),"^",14),C=$P(^DD(130,.195,0),"^",2) D:Y'="" Y^DIQ S SRCONV=$S(Y'="":Y,1:"N/A")
19 I 'SRALL,SRMOOD="N/A",SRCONS="N/A" G SKIN
20 D LINE(1) S @SRG@(SRI)="Preop Mood:",@SRG@(SRI)=@SRG@(SRI)_$$SPACE(18)_SRMOOD,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Preop Consc:",@SRG@(SRI)=@SRG@(SRI)_$$SPACE(56)_SRCONS
21SKIN I 'SRALL,SRSKIN="N/A",SRCONV="N/A" G VAL
22 D LINE(1) S @SRG@(SRI)="Preop Skin Integ: "_SRSKIN,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Preop Converse: "_SRCONV
23VAL S SRLF=1,Y=$P(SR(.6),"^",9),C=$P(^DD(130,.69,0),"^",2) D:Y'="" Y^DIQ S SRUSER=$S(Y="":"N/A",1:Y)
24 I 'SRALL,SRUSER="N/A" G VER
25 D LINE(1) S @SRG@(SRI)="Valid Consent/ID Band Confirmed By: "_SRUSER
26 ;
27VER N II,SROIM,SROUT,SROIN,SRHRM
28 S Y=$P(SR("VER"),"^",5),SROIN=$S(Y="Y":"YES",Y="M":"MARKING NOT REQUIRED FOR THIS PROCEDURE",Y="N":"NO - MARKING REQUIRED BUT NOT DONE (see MARKED SITE COMMENTS)",1:"* NOT ENTERED *")
29 D LINE(1) S @SRG@(SRI)="Mark on Surgical Site Confirmed: "_$S($L(SROIN)>43:"",1:SROIN)
30 I $L(SROIN)>43 D LINE(1) S @SRG@(SRI)=$$SPACE(2)_SROIN
31 S II=84 D ENSC,LINE(1)
32 S Y=$P(SR("VER"),"^",4),SROIM=$S(Y="Y":"YES",Y="I":"IMAGING NOT REQUIRED FOR THIS PROCEDURE",Y="N":"IMAGING REQUIRED BUT NOT VIEWED (see IMAGING CONFIRMED COMMENTS)",1:"* NOT ENTERED *")
33 D LINE(1) S @SRG@(SRI)="Preoperative Imaging Confirmed: "_$S($L(SROIM)>43:"",1:SROIM)
34 I $L(SROIM)>43 D LINE(1) S @SRG@(SRI)=$$SPACE(2)_SROIM
35 S II=83 D ENSC,LINE(1)
36 S Y=$P(SR("VER"),"^",3),SROUT=$S(Y="Y":"YES",Y="N":"NO (see TIME OUT VERIFIED COMMENTS)",1:"* NOT ENTERED *")
37 D LINE(1) S @SRG@(SRI)="Time Out Verification Completed: "_$S($L(SROUT)>43:"",1:SROUT)
38 S II=82 D ENSC
39 S SRLF=1
40 ;
41PREP N SRSKIP S SRSKIP=0
42 S Y=$P(SR(.1),"^",8),C=$P(^DD(130,.18,0),"^",2) D:Y'="" Y^DIQ,N(25) S SRUSER=$S(Y="":"N/A",1:Y)
43 S Y=$P(SR(.1),"^",7),C=$P(^DD(130,.175,0),"^",2) D:Y'="" Y^DIQ S SRAGNT=$S(Y="":"N/A",1:$E(Y,1,22))
44 I 'SRALL,SRUSER="N/A",SRAGNT="N/A" G PREP2
45 D LINE(1) S @SRG@(SRI)="Skin Prep By: "_SRUSER,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Skin Prep Agent: "_SRAGNT
46 S SRSKIP=1
47PREP2 S Y=$P(SR(.1),"^",12),C=$P(^DD(130,4,0),"^",2) D:Y'="" Y^DIQ,N(21) S SRUSER=$S(Y="":"N/A",1:Y)
48 S Y=$P(SR(31),"^",2),C=$P(^DD(130,8,0),"^",2) D:Y'="" Y^DIQ S SRAGNT=$S(Y="":"N/A",1:$E(Y,1,18))
49 I 'SRALL,SRUSER="N/A",SRAGNT="N/A" G PREOP
50 D LINE(1) S @SRG@(SRI)="Skin Prep By (2): "_SRUSER,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"2nd Skin Prep Agent: "_SRAGNT
51 S SRSKIP=0 D LINE(1)
52PREOP S Y=$P(SR(.1),"^",2),C=$P(^DD(130,.12,0),"^",2) D:Y'="" Y^DIQ S SRUSER=$S(Y="":"N/A",1:Y)
53 D:SRSKIP LINE(1) D LINE(1) S @SRG@(SRI)="Preop Surgical Site Hair Removal by: "_SRUSER
54 S Y=$P(SR("VER"),"^",6),C=$P(^DD(130,506,0),"^",2) D:Y'="" Y^DIQ S SRHRM=$S(Y="":"* NOT ENTERED *",1:Y)
55 D LINE(1) S @SRG@(SRI)="Surgical Site Hair Removal Method: "_$S($L(SRHRM)>43:"",1:SRHRM)
56 I $L(SRHRM)>43 D LINE(1) S @SRG@(SRI)=$$SPACE(2)_SRHRM
57 S II=49 D ENSC
58 ;
59POS S SRLF=1,SRLINE="Surgery Position(s): " I '$O(^SRF(SRTN,42,0)),SRALL D LINE(1) S @SRG@(SRI)=SRLINE_"N/A"
60 I $O(^SRF(SRTN,42,0)) D LINE(1) S @SRG@(SRI)=SRLINE D
61 .S SRP=0 F S SRP=$O(^SRF(SRTN,42,SRP)) Q:'SRP S X=^SRF(SRTN,42,SRP,0),Z=$P(X,"^"),Y=$P(X,"^",2) D
62 ..S SRPOS=$P(^SRO(132,Z,0),"^") D:Y D^DIQ S SRTIME=$S(Y'="":$P(Y,"@")_" "_$P(Y,"@",2),1:"N/A")
63 ..D LINE(1) S @SRG@(SRI)=" "_SRPOS,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Placed: "_SRTIME
64 S SRLF=1,SRLINE="Restraints and Position Aids: "
65 I '$O(^SRF(SRTN,20,0)),SRALL D LINE(1) S @SRG@(SRI)=SRLINE_"N/A"
66 I $O(^SRF(SRTN,20,0)) N SRRP D LINE(1) S @SRG@(SRI)=SRLINE,(SRRP,CNT)=0 F S SRRP=$O(^SRF(SRTN,20,SRRP)) Q:'SRRP S CNT=CNT+1,X=^SRF(SRTN,20,SRRP,0),Z=$P(X,"^"),Y=$P(X,"^",2),W=$P(X,"^",3) D
67 .S SREST=$P(^SRO(132.05,Z,0),"^"),C=$P(^DD(130.31,1,0),"^",2) D:Y'="" Y^DIQ,N(31) S:Y="" Y="N/A"
68 .D LINE(1) S @SRG@(SRI)=" "_SREST,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(36)_"Applied By: "_Y
69 .I W'="" D LINE(1) S @SRG@(SRI)=" Comments: "_W
70 S SRLF=1,X=$P(SR(.7),"^",5),SREL=$S(X'="":X,1:"N/A")
71 S X=$P(SR(.5),"^",4),SRELP=$S(X:$P(^SRO(138,X,0),"^"),1:"N/A")
72 S X=$P(SR(.5),"^",13),SRELP2=$S(X:$P(^SRO(138,X,0),"^"),1:"")
73 S X=$P(SR(.7),"^"),SRC=$S(X'="":X,1:"N/A"),X=$P(SR(.7),"^",2),SRCT=$S(X'="":X,1:"N/A")
74 I 'SRALL,SREL="N/A",SRELP="N/A",SRELP2="" G LAB
75 D LINE(1) S @SRG@(SRI)="Electrocautery Unit: "_SREL
76 D LINE(1) S @SRG@(SRI)="ESU Coagulation Range: "_SRC
77 D LINE(1) S @SRG@(SRI)="ESU Cutting Range: "_SRCT
78 D LINE(1) S @SRG@(SRI)="Electroground Position(s): "_SRELP
79 I SRELP2'="" D LINE(1) S @SRG@(SRI)=$$SPACE(27)_SRELP2
80LAB S SRLF=1 I $O(^SRF(SRTN,9,0))!SRALL D LAB1
81 S SRLF=1 I $O(^SRF(SRTN,6,0)) D LINE(1) S @SRG@(SRI)="Anesthesia Technique(s):" S ANE=0 F S ANE=$O(^SRF(SRTN,6,ANE)) Q:'ANE D ANE
82 I '$O(^SRF(SRTN,6,0)),SRALL D LINE(1) S @SRG@(SRI)="Anesthesia Technique(s): N/A"
83 D ^SRONRPT1
84 Q
85NURSE ; nurse info
86 N CNT,CIRC,I,NURSE,SCRU,X,Y,Z
87 S (CNT,CIRC)=0 F S CIRC=$O(^SRF(SRTN,19,CIRC)) Q:'CIRC S CNT=CNT+1 D
88 .S Z=^SRF(SRTN,19,CIRC,0),Y=$P(Z,"^"),C=$P(^DD(130.28,.01,0),"^",2) D Y^DIQ,N(21) S SRX=Y
89 .S Y=$P(Z,"^",3),C=$P(^DD(130.28,3,0),"^",2) D:Y'="" Y^DIQ S CIRC(CNT)=SRX_" ("_Y_")"
90 S (CNT,SCRU)=0 F S SCRU=$O(^SRF(SRTN,23,SCRU)) Q:'SCRU S CNT=CNT+1 D
91 .S Z=^SRF(SRTN,23,SCRU,0),Y=$P(Z,"^"),C=$P(^DD(130.36,.01,0),"^",2) D Y^DIQ,N(21) S SRX=Y
92 .S Y=$P(Z,"^",3),C=$P(^DD(130.36,3,0),"^",2) D:Y'="" Y^DIQ S SCRU(CNT)=SRX_" ("_Y_")"
93 S:'$D(SCRU(1)) SCRU(1)="N/A" S:'$D(CIRC(1)) CIRC(1)="N/A"
94 F I=1:1 Q:('$D(SCRU(I))&'$D(CIRC(I))) S NURSE(I)=$S($D(SCRU(I)):SCRU(I),1:"")_"^"_$S($D(CIRC(I)):CIRC(I),1:"")
95 S I=0 F S I=$O(NURSE(I)) Q:'I D LINE(1) S @SRG@(SRI)=$$SPACE(2)_$P(NURSE(I),"^") S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_$P(NURSE(I),"^",2)
96 Q
97LAB1 N SRSP S SRLF=1 D LINE(1) S @SRG@(SRI)="Material Sent to Laboratory for Analysis: "
98 I 'SRALL,'$O(^SRF(SRTN,9,0)),'$O(^SRF(SRTN,41,0)) S @SRG@(SRI)=@SRG@(SRI)_"N/A" Q
99 D LINE(1) S @SRG@(SRI)="Specimens: " D
100 .I '$O(^SRF(SRTN,9,0)) S @SRG@(SRI)=@SRG@(SRI)_"N/A" Q
101 .S SRSP=0 F S SRSP=$O(^SRF(SRTN,9,SRSP)) Q:'SRSP D LINE(1) S @SRG@(SRI)=$$SPACE(2)_^SRF(SRTN,9,SRSP,0)
102 D LINE(1) S @SRG@(SRI)="Cultures: " D
103 .I '$O(^SRF(SRTN,41,0)) S @SRG@(SRI)=@SRG@(SRI)_"N/A" Q
104 .S SRSP=0 F S SRSP=$O(^SRF(SRTN,41,SRSP)) Q:'SRSP D LINE(1) S @SRG@(SRI)=$$SPACE(2)_^SRF(SRTN,41,SRSP,0)
105 Q
106N(SRL) N SRN I $L(Y)>SRL S SRN=$P(Y,",")_","_$E($P(Y,",",2))_".",Y=SRN
107 Q
108SPACE(NUM) ; create spaces
109 ;pass in position returns number of needed spaces
110 I '$D(@SRG@(SRI)) S @SRG@(SRI)=""
111 Q $J("",NUM-$L(@SRG@(SRI)))
112LINE(NUM) ; create carriage returns
113 I $G(SRLF) S NUM=NUM+1,SRLF=0
114 F J=1:1:NUM S SRI=SRI+1,@SRG@(SRI)=""
115 Q
116ANE ; print anesthesia technique
117 N A,AGNT,C,CNT,DRUG
118 S A=^SRF(SRTN,6,ANE,0),Y=$P(A,"^"),C=$P(^DD(130.06,.01,0),"^",2) D:Y'="" Y^DIQ D LINE(1) S Y=Y_$S($P(A,"^",3)="Y":" (PRINCIPAL)",1:""),@SRG@(SRI)=$$SPACE(2)_Y
119 Q
120ENSC N X,SRLINE
121 D LINE(1) S @SRG@(SRI)=" "_$S(II=82:"Time Out Verified Comments: ",II=83:"Imaging Confirmed Comments: ",II=84:"Marked Site Comments: ",II=49:"Hair Removal Comments: ",1:"") D
122 .I '$O(^SRF(SRTN,II,0)) S @SRG@(SRI)=@SRG@(SRI)_"NO COMMENTS ENTERED" Q
123 .S SRLINE=0 F S SRLINE=$O(^SRF(SRTN,II,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,II,SRLINE,0) D COMM^SRONRPT3(X,3)
124 Q
Note: See TracBrowser for help on using the repository browser.