SRONRPT0 ;BIR/ADM - NURSE INTRAOP REPORT; MAY 5, 2006
;;3.0;Surgery;**100,129,147,153,157,175,176,182,184,212**;24 Jun 93;Build 1
;** NOTICE: This routine is part of an implementation of a nationally
;** controlled procedure. Local modifications to this routine
;** are prohibited.
;
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
S SRLF=1,SRLINE="Other Persons in OR: " I '$O(^SRF(SRTN,32,0)),SRALL D LINE(1) S @SRG@(SRI)=SRLINE_"N/A"
I $O(^SRF(SRTN,32,0)) D LINE(1) S @SRG@(SRI)=SRLINE D
.S OTH=0 F S OTH=$O(^SRF(SRTN,32,OTH)) Q:'OTH D
..S X=^SRF(SRTN,32,OTH,0),SRLINE=" "_$P(X,"^")
..S Y=$P(X,"^",2) S:Y'="" SRLINE=SRLINE_" ("_Y_")"
..D LINE(1) S @SRG@(SRI)=SRLINE
S SRLF=1
S X=$P(SR(.1),"^",9),SRMOOD=$S(X:$E($P(^SRO(135.3,X,0),"^"),1,20),1:"N/A")
S X=$P(SR(.1),"^",15),SRCONS=$S(X:$E($P(^SRO(135.4,X,0),"^"),1,24),1:"N/A")
S X=$P(SR(0),"^",7),SRSKIN=$S(X:$E($P(^SRO(135.2,X,0),"^"),1,20),1:"N/A")
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")
I 'SRALL,SRMOOD="N/A",SRCONS="N/A" G SKIN
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
SKIN I 'SRALL,SRSKIN="N/A",SRCONV="N/A" G VER
D LINE(1) S @SRG@(SRI)="Preop Skin Integ: "_SRSKIN,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Preop Converse: "_SRCONV
;
VER N II,SROIM,SROUT,SROIN,SRHRM
D LINE(2) S @SRG@(SRI)="--- Time Out Checklist ---"
S Y=$P(SR("VER"),"^",7),SROIN=$S(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Confirm Correct Patient Identity: "_SROIN
S Y=$P(SR("VER"),"^",8),SROIN=$S(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Confirm Procedure To Be Performed: "_SROIN
S Y=$P(SR("VER"),"^",9),SROIN=$S(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Confirm Site of the Procedure, Including Laterality: "_SROIN
S Y=$P(SR("VER"),"^",10),SROIN=$S(Y=1:"YES, i-MED",Y=2:"YES, PAPER",Y=3:"YES, TELEPHONE",Y=4:"NO, EMERGENCY",Y=5:"NO, NOT EMERGENCY",Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Confirm Valid Consent: "_SROIN
S Y=$P(SR("VER"),"^",11),SROIN=$S(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Confirm Patient Position: "_SROIN
S Y=$P(SR("VER"),"^",12),SROIN=$S(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *")
D LINE(1) S @SRG@(SRI)="Confirm Procedure Site has been Marked Appropriately and that the Site of the " D LINE(1) S @SRG@(SRI)=" Mark is Visible After Prep and Draping: "_SROIN
D LINE(1) S Y=$P(SR("VER"),"^",13),SROIN=$S(Y="Y":"YES",Y="N":"NO",Y="NA":"N/A",1:"* NOT ENTERED *") S @SRG@(SRI)="Pertinent Medical Images Have Been Confirmed: "_SROIN
S Y=$P(SR("VER"),"^",14),SROIN=$S(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Correct Medical Implant(s) is Available: "_SROIN
S Y=$P(SR("VER"),"^",18),SROIN=$S(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Availability of Special Equipment: "_SROIN
S Y=$P(SR("VER"),"^",15),SROIN=$S(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",Y="NI":"NOT INDICATED",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Appropriate Antibiotic Prophylaxis: "_SROIN
S Y=$P(SR("VER"),"^",16),SROIN=$S(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",Y="NI":"NOT INDICATED",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Appropriate Deep Vein Thrombosis Prophylaxis: "_SROIN
S Y=$P(SR("VER"),"^",17),SROIN=$S(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",Y="NI":"NOT INDICATED",1:"* NOT ENTERED *") D LINE(1) S @SRG@(SRI)="Blood Availability: "_SROIN
S II=51 D ENSC
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)
I 'SRALL,SRUSER="N/A" G TIME
D LINE(1) S @SRG@(SRI)="Time-Out Document Completed By: "_SRUSER
;
TIME S Y=$P(SR(.6),"^",12),C=$P(^DD(130,74,0),"^",2) D:Y'="" Y^DIQ S SRTME=$S(Y="":"N/A",1:Y)
I 'SRALL,SRTME="N/A" G PREP
D LINE(1) S @SRG@(SRI)="Time-Out Completed: "_SRTME
S SRLF=1
;
PREP N SRSKIP S SRSKIP=0
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)
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))
I 'SRALL,SRUSER="N/A",SRAGNT="N/A" G PREP2
D LINE(1) S @SRG@(SRI)="Skin Prep By: "_SRUSER,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Skin Prep Agent: "_SRAGNT
S SRSKIP=1
PREP2 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)
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))
I 'SRALL,SRUSER="N/A",SRAGNT="N/A" G PREOP
D LINE(1) S @SRG@(SRI)="Skin Prep By (2): "_SRUSER,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"2nd Skin Prep Agent: "_SRAGNT
S SRSKIP=0 D LINE(1)
PREOP 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)
D:SRSKIP LINE(1) D LINE(1) S @SRG@(SRI)="Preop Surgical Site Hair Removal by: "_SRUSER
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)
D LINE(1) S @SRG@(SRI)="Surgical Site Hair Removal Method: "_$S($L(SRHRM)>43:"",1:SRHRM)
I $L(SRHRM)>43 D LINE(1) S @SRG@(SRI)=$$SPACE(2)_SRHRM
S II=49 D ENSC
;
POS S SRLF=1,SRLINE="Surgery Position(s): " I '$O(^SRF(SRTN,42,0)),SRALL D LINE(1) S @SRG@(SRI)=SRLINE_"N/A"
I $O(^SRF(SRTN,42,0)) D LINE(1) S @SRG@(SRI)=SRLINE D
.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
..S SRPOS=$P(^SRO(132,Z,0),"^") D:Y D^DIQ S SRTIME=$S(Y'="":$P(Y,"@")_" "_$P(Y,"@",2),1:"N/A")
..D LINE(1) S @SRG@(SRI)=" "_SRPOS,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Placed: "_SRTIME
S SRLF=1,SRLINE="Restraints and Position Aids: "
I '$O(^SRF(SRTN,20,0)),SRALL D LINE(1) S @SRG@(SRI)=SRLINE_"N/A"
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
.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"
.D LINE(1) S @SRG@(SRI)=" "_SREST,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(36)_"Applied By: "_Y
.I W'="" D LINE(1) S @SRG@(SRI)=" Comments: "_W
S SRLF=1,X=$P(SR(.7),"^",5),SREL=$S(X'="":X,1:"N/A")
S X=$P(SR(.5),"^",4),SRELP=$S(X:$P(^SRO(138,X,0),"^"),1:"N/A")
S X=$P(SR(.5),"^",13),SRELP2=$S(X:$P(^SRO(138,X,0),"^"),1:"")
S X=$P(SR(.7),"^"),SRC=$S(X'="":X,1:"N/A"),X=$P(SR(.7),"^",2),SRCT=$S(X'="":X,1:"N/A")
I 'SRALL,SREL="N/A",SRELP="N/A",SRELP2="" G LAB
D LINE(1) S @SRG@(SRI)="Electrocautery Unit: "_SREL
D LINE(1) S @SRG@(SRI)="ESU Coagulation Range: "_SRC
D LINE(1) S @SRG@(SRI)="ESU Cutting Range: "_SRCT
D LINE(1) S @SRG@(SRI)="Electroground Position(s): "_SRELP
I SRELP2'="" D LINE(1) S @SRG@(SRI)=$$SPACE(27)_SRELP2
LAB S SRLF=1 I $O(^SRF(SRTN,9,0))!$O(^SRF(SRTN,41,0))!SRALL D LAB1 ;SR212 - add check for CULTURES (41)
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
I '$O(^SRF(SRTN,6,0)),SRALL D LINE(1) S @SRG@(SRI)="Anesthesia Technique(s): N/A"
D ^SRONRPT1
Q
NURSE ; nurse info
N CNT,CIRC,I,NURSE,SCRU,X,Y,Z
S (CNT,CIRC)=0 F S CIRC=$O(^SRF(SRTN,19,CIRC)) Q:'CIRC S CNT=CNT+1 D
.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
.S Y=$P(Z,"^",3),C=$P(^DD(130.28,3,0),"^",2) D:Y'="" Y^DIQ S CIRC(CNT)=SRX_" ("_Y_")"
S (CNT,SCRU)=0 F S SCRU=$O(^SRF(SRTN,23,SCRU)) Q:'SCRU S CNT=CNT+1 D
.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
.S Y=$P(Z,"^",3),C=$P(^DD(130.36,3,0),"^",2) D:Y'="" Y^DIQ S SCRU(CNT)=SRX_" ("_Y_")"
S:'$D(SCRU(1)) SCRU(1)="N/A" S:'$D(CIRC(1)) CIRC(1)="N/A"
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:"")
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)
Q
LAB1 N SRSP S SRLF=1 D LINE(1) S @SRG@(SRI)="Material Sent to Laboratory for Analysis: "
I 'SRALL,'$O(^SRF(SRTN,9,0)),'$O(^SRF(SRTN,41,0)) S @SRG@(SRI)=@SRG@(SRI)_"N/A" Q
D LINE(1) S @SRG@(SRI)="Specimens: " D
.I '$O(^SRF(SRTN,9,0)) S @SRG@(SRI)=@SRG@(SRI)_"N/A" Q
.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)
D LINE(1) S @SRG@(SRI)="Cultures: " D
.I '$O(^SRF(SRTN,41,0)) S @SRG@(SRI)=@SRG@(SRI)_"N/A" Q
.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)
Q
N(SRL) N SRN I $L(Y)>SRL S SRN=$P(Y,",")_","_$E($P(Y,",",2))_".",Y=SRN
Q
SPACE(NUM) ; create spaces
;pass in position returns number of needed spaces
I '$D(@SRG@(SRI)) S @SRG@(SRI)=""
Q $J("",NUM-$L(@SRG@(SRI)))
LINE(NUM) ; create carriage returns
I $G(SRLF) S NUM=NUM+1,SRLF=0
F J=1:1:NUM S SRI=SRI+1,@SRG@(SRI)=""
Q
ANE ; print anesthesia technique
N A,AGNT,C,CNT,DRUG
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
Q
ENSC N X,SRLINE
D LINE(1) S @SRG@(SRI)=$S(II=51:"Checklist Comment: ",II=49:" Hair Removal Comments: ",II=53:"Wound Sweep Comment: ",II=54:"Intra-Operative X-Ray Comment: ",1:"") D
.I '$O(^SRF(SRTN,II,0)) S @SRG@(SRI)=@SRG@(SRI)_"NO COMMENTS ENTERED" Q
.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)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSRONRPT0 9836 printed Dec 13, 2024@02:44:34 Page 2
SRONRPT0 ;BIR/ADM - NURSE INTRAOP REPORT; MAY 5, 2006
+1 ;;3.0;Surgery;**100,129,147,153,157,175,176,182,184,212**;24 Jun 93;Build 1
+2 ;** NOTICE: This routine is part of an implementation of a nationally
+3 ;** controlled procedure. Local modifications to this routine
+4 ;** are prohibited.
+5 ;
+6 DO LINE(2)
SET @SRG@(SRI)="OR Support Personnel:"
DO LINE(1)
SET @SRG@(SRI)=" Scrubbed"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Circulating"
DO NURSE
+7 SET SRLF=1
SET SRLINE="Other Persons in OR: "
IF '$ORDER(^SRF(SRTN,32,0))
IF SRALL
DO LINE(1)
SET @SRG@(SRI)=SRLINE_"N/A"
+8 IF $ORDER(^SRF(SRTN,32,0))
DO LINE(1)
SET @SRG@(SRI)=SRLINE
Begin DoDot:1
+9 SET OTH=0
FOR
SET OTH=$ORDER(^SRF(SRTN,32,OTH))
if 'OTH
QUIT
Begin DoDot:2
+10 SET X=^SRF(SRTN,32,OTH,0)
SET SRLINE=" "_$PIECE(X,"^")
+11 SET Y=$PIECE(X,"^",2)
if Y'=""
SET SRLINE=SRLINE_" ("_Y_")"
+12 DO LINE(1)
SET @SRG@(SRI)=SRLINE
End DoDot:2
End DoDot:1
+13 SET SRLF=1
+14 SET X=$PIECE(SR(.1),"^",9)
SET SRMOOD=$SELECT(X:$EXTRACT($PIECE(^SRO(135.3,X,0),"^"),1,20),1:"N/A")
+15 SET X=$PIECE(SR(.1),"^",15)
SET SRCONS=$SELECT(X:$EXTRACT($PIECE(^SRO(135.4,X,0),"^"),1,24),1:"N/A")
+16 SET X=$PIECE(SR(0),"^",7)
SET SRSKIN=$SELECT(X:$EXTRACT($PIECE(^SRO(135.2,X,0),"^"),1,20),1:"N/A")
+17 SET Y=$PIECE(SR(.1),"^",14)
SET C=$PIECE(^DD(130,.195,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRCONV=$SELECT(Y'="":Y,1:"N/A")
+18 IF 'SRALL
IF SRMOOD="N/A"
IF SRCONS="N/A"
GOTO SKIN
+19 DO LINE(1)
SET @SRG@(SRI)="Preop Mood:"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(18)_SRMOOD
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Preop Consc:"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(56)_SRCONS
SKIN IF 'SRALL
IF SRSKIN="N/A"
IF SRCONV="N/A"
GOTO VER
+1 DO LINE(1)
SET @SRG@(SRI)="Preop Skin Integ: "_SRSKIN
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Preop Converse: "_SRCONV
+2 ;
VER NEW II,SROIM,SROUT,SROIN,SRHRM
+1 DO LINE(2)
SET @SRG@(SRI)="--- Time Out Checklist ---"
+2 SET Y=$PIECE(SR("VER"),"^",7)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Confirm Correct Patient Identity: "_SROIN
+3 SET Y=$PIECE(SR("VER"),"^",8)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Confirm Procedure To Be Performed: "_SROIN
+4 SET Y=$PIECE(SR("VER"),"^",9)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Confirm Site of the Procedure, Including Laterality: "_SROIN
+5 SET Y=$PIECE(SR("VER"),"^",10)
SET SROIN=$SELECT(Y=1:"YES, i-MED",Y=2:"YES, PAPER",Y=3:"YES, TELEPHONE",Y=4:"NO, EMERGENCY",Y=5:"NO, NOT EMERGENCY",Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Confirm Valid Consent: "_SROIN
+6 SET Y=$PIECE(SR("VER"),"^",11)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Confirm Patient Position: "_SROIN
+7 SET Y=$PIECE(SR("VER"),"^",12)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",1:"* NOT ENTERED *")
+8 DO LINE(1)
SET @SRG@(SRI)="Confirm Procedure Site has been Marked Appropriately and that the Site of the "
DO LINE(1)
SET @SRG@(SRI)=" Mark is Visible After Prep and Draping: "_SROIN
+9 DO LINE(1)
SET Y=$PIECE(SR("VER"),"^",13)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",Y="NA":"N/A",1:"* NOT ENTERED *")
SET @SRG@(SRI)="Pertinent Medical Images Have Been Confirmed: "_SROIN
+10 SET Y=$PIECE(SR("VER"),"^",14)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Correct Medical Implant(s) is Available: "_SROIN
+11 SET Y=$PIECE(SR("VER"),"^",18)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Availability of Special Equipment: "_SROIN
+12 SET Y=$PIECE(SR("VER"),"^",15)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",Y="NI":"NOT INDICATED",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Appropriate Antibiotic Prophylaxis: "_SROIN
+13 SET Y=$PIECE(SR("VER"),"^",16)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",Y="NI":"NOT INDICATED",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Appropriate Deep Vein Thrombosis Prophylaxis: "_SROIN
+14 SET Y=$PIECE(SR("VER"),"^",17)
SET SROIN=$SELECT(Y="Y":"YES",Y="N":"NO",Y="NA":"NOT APPLICABLE",Y="NI":"NOT INDICATED",1:"* NOT ENTERED *")
DO LINE(1)
SET @SRG@(SRI)="Blood Availability: "_SROIN
+15 SET II=51
DO ENSC
+16 SET SRLF=1
SET Y=$PIECE(SR(.6),"^",9)
SET C=$PIECE(^DD(130,.69,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRUSER=$SELECT(Y="":"N/A",1:Y)
+17 IF 'SRALL
IF SRUSER="N/A"
GOTO TIME
+18 DO LINE(1)
SET @SRG@(SRI)="Time-Out Document Completed By: "_SRUSER
+19 ;
TIME SET Y=$PIECE(SR(.6),"^",12)
SET C=$PIECE(^DD(130,74,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRTME=$SELECT(Y="":"N/A",1:Y)
+1 IF 'SRALL
IF SRTME="N/A"
GOTO PREP
+2 DO LINE(1)
SET @SRG@(SRI)="Time-Out Completed: "_SRTME
+3 SET SRLF=1
+4 ;
PREP NEW SRSKIP
SET SRSKIP=0
+1 SET Y=$PIECE(SR(.1),"^",8)
SET C=$PIECE(^DD(130,.18,0),"^",2)
if Y'=""
DO Y^DIQ
DO N(25)
SET SRUSER=$SELECT(Y="":"N/A",1:Y)
+2 SET Y=$PIECE(SR(.1),"^",7)
SET C=$PIECE(^DD(130,.175,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRAGNT=$SELECT(Y="":"N/A",1:$EXTRACT(Y,1,22))
+3 IF 'SRALL
IF SRUSER="N/A"
IF SRAGNT="N/A"
GOTO PREP2
+4 DO LINE(1)
SET @SRG@(SRI)="Skin Prep By: "_SRUSER
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Skin Prep Agent: "_SRAGNT
+5 SET SRSKIP=1
PREP2 SET Y=$PIECE(SR(.1),"^",12)
SET C=$PIECE(^DD(130,4,0),"^",2)
if Y'=""
DO Y^DIQ
DO N(21)
SET SRUSER=$SELECT(Y="":"N/A",1:Y)
+1 SET Y=$PIECE(SR(31),"^",2)
SET C=$PIECE(^DD(130,8,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRAGNT=$SELECT(Y="":"N/A",1:$EXTRACT(Y,1,18))
+2 IF 'SRALL
IF SRUSER="N/A"
IF SRAGNT="N/A"
GOTO PREOP
+3 DO LINE(1)
SET @SRG@(SRI)="Skin Prep By (2): "_SRUSER
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"2nd Skin Prep Agent: "_SRAGNT
+4 SET SRSKIP=0
DO LINE(1)
PREOP SET Y=$PIECE(SR(.1),"^",2)
SET C=$PIECE(^DD(130,.12,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRUSER=$SELECT(Y="":"N/A",1:Y)
+1 if SRSKIP
DO LINE(1)
DO LINE(1)
SET @SRG@(SRI)="Preop Surgical Site Hair Removal by: "_SRUSER
+2 SET Y=$PIECE(SR("VER"),"^",6)
SET C=$PIECE(^DD(130,506,0),"^",2)
if Y'=""
DO Y^DIQ
SET SRHRM=$SELECT(Y="":"* NOT ENTERED *",1:Y)
+3 DO LINE(1)
SET @SRG@(SRI)="Surgical Site Hair Removal Method: "_$SELECT($LENGTH(SRHRM)>43:"",1:SRHRM)
+4 IF $LENGTH(SRHRM)>43
DO LINE(1)
SET @SRG@(SRI)=$$SPACE(2)_SRHRM
+5 SET II=49
DO ENSC
+6 ;
POS SET SRLF=1
SET SRLINE="Surgery Position(s): "
IF '$ORDER(^SRF(SRTN,42,0))
IF SRALL
DO LINE(1)
SET @SRG@(SRI)=SRLINE_"N/A"
+1 IF $ORDER(^SRF(SRTN,42,0))
DO LINE(1)
SET @SRG@(SRI)=SRLINE
Begin DoDot:1
+2 SET SRP=0
FOR
SET SRP=$ORDER(^SRF(SRTN,42,SRP))
if 'SRP
QUIT
SET X=^SRF(SRTN,42,SRP,0)
SET Z=$PIECE(X,"^")
SET Y=$PIECE(X,"^",2)
Begin DoDot:2
+3 SET SRPOS=$PIECE(^SRO(132,Z,0),"^")
if Y
DO D^DIQ
SET SRTIME=$SELECT(Y'="":$PIECE(Y,"@")_" "_$PIECE(Y,"@",2),1:"N/A")
+4 DO LINE(1)
SET @SRG@(SRI)=" "_SRPOS
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Placed: "_SRTIME
End DoDot:2
End DoDot:1
+5 SET SRLF=1
SET SRLINE="Restraints and Position Aids: "
+6 IF '$ORDER(^SRF(SRTN,20,0))
IF SRALL
DO LINE(1)
SET @SRG@(SRI)=SRLINE_"N/A"
+7 IF $ORDER(^SRF(SRTN,20,0))
NEW SRRP
DO LINE(1)
SET @SRG@(SRI)=SRLINE
SET (SRRP,CNT)=0
FOR
SET SRRP=$ORDER(^SRF(SRTN,20,SRRP))
if 'SRRP
QUIT
SET CNT=CNT+1
SET X=^SRF(SRTN,20,SRRP,0)
SET Z=$PIECE(X,"^")
SET Y=$PIECE(X,"^",2)
SET W=$PIECE(X,"^",3)
Begin DoDot:1
+8 SET SREST=$PIECE(^SRO(132.05,Z,0),"^")
SET C=$PIECE(^DD(130.31,1,0),"^",2)
if Y'=""
DO Y^DIQ
DO N(31)
if Y=""
SET Y="N/A"
+9 DO LINE(1)
SET @SRG@(SRI)=" "_SREST
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(36)_"Applied By: "_Y
+10 IF W'=""
DO LINE(1)
SET @SRG@(SRI)=" Comments: "_W
End DoDot:1
+11 SET SRLF=1
SET X=$PIECE(SR(.7),"^",5)
SET SREL=$SELECT(X'="":X,1:"N/A")
+12 SET X=$PIECE(SR(.5),"^",4)
SET SRELP=$SELECT(X:$PIECE(^SRO(138,X,0),"^"),1:"N/A")
+13 SET X=$PIECE(SR(.5),"^",13)
SET SRELP2=$SELECT(X:$PIECE(^SRO(138,X,0),"^"),1:"")
+14 SET X=$PIECE(SR(.7),"^")
SET SRC=$SELECT(X'="":X,1:"N/A")
SET X=$PIECE(SR(.7),"^",2)
SET SRCT=$SELECT(X'="":X,1:"N/A")
+15 IF 'SRALL
IF SREL="N/A"
IF SRELP="N/A"
IF SRELP2=""
GOTO LAB
+16 DO LINE(1)
SET @SRG@(SRI)="Electrocautery Unit: "_SREL
+17 DO LINE(1)
SET @SRG@(SRI)="ESU Coagulation Range: "_SRC
+18 DO LINE(1)
SET @SRG@(SRI)="ESU Cutting Range: "_SRCT
+19 DO LINE(1)
SET @SRG@(SRI)="Electroground Position(s): "_SRELP
+20 IF SRELP2'=""
DO LINE(1)
SET @SRG@(SRI)=$$SPACE(27)_SRELP2
LAB ;SR212 - add check for CULTURES (41)
SET SRLF=1
IF $ORDER(^SRF(SRTN,9,0))!$ORDER(^SRF(SRTN,41,0))!SRALL
DO LAB1
+1 SET SRLF=1
IF $ORDER(^SRF(SRTN,6,0))
DO LINE(1)
SET @SRG@(SRI)="Anesthesia Technique(s):"
SET ANE=0
FOR
SET ANE=$ORDER(^SRF(SRTN,6,ANE))
if 'ANE
QUIT
DO ANE
+2 IF '$ORDER(^SRF(SRTN,6,0))
IF SRALL
DO LINE(1)
SET @SRG@(SRI)="Anesthesia Technique(s): N/A"
+3 DO ^SRONRPT1
+4 QUIT
NURSE ; nurse info
+1 NEW CNT,CIRC,I,NURSE,SCRU,X,Y,Z
+2 SET (CNT,CIRC)=0
FOR
SET CIRC=$ORDER(^SRF(SRTN,19,CIRC))
if 'CIRC
QUIT
SET CNT=CNT+1
Begin DoDot:1
+3 SET Z=^SRF(SRTN,19,CIRC,0)
SET Y=$PIECE(Z,"^")
SET C=$PIECE(^DD(130.28,.01,0),"^",2)
DO Y^DIQ
DO N(21)
SET SRX=Y
+4 SET Y=$PIECE(Z,"^",3)
SET C=$PIECE(^DD(130.28,3,0),"^",2)
if Y'=""
DO Y^DIQ
SET CIRC(CNT)=SRX_" ("_Y_")"
End DoDot:1
+5 SET (CNT,SCRU)=0
FOR
SET SCRU=$ORDER(^SRF(SRTN,23,SCRU))
if 'SCRU
QUIT
SET CNT=CNT+1
Begin DoDot:1
+6 SET Z=^SRF(SRTN,23,SCRU,0)
SET Y=$PIECE(Z,"^")
SET C=$PIECE(^DD(130.36,.01,0),"^",2)
DO Y^DIQ
DO N(21)
SET SRX=Y
+7 SET Y=$PIECE(Z,"^",3)
SET C=$PIECE(^DD(130.36,3,0),"^",2)
if Y'=""
DO Y^DIQ
SET SCRU(CNT)=SRX_" ("_Y_")"
End DoDot:1
+8 if '$DATA(SCRU(1))
SET SCRU(1)="N/A"
if '$DATA(CIRC(1))
SET CIRC(1)="N/A"
+9 FOR I=1:1
if ('$DATA(SCRU(I))&'$DATA(CIRC(I)))
QUIT
SET NURSE(I)=$SELECT($DATA(SCRU(I)):SCRU(I),1:"")_"^"_$SELECT($DATA(CIRC(I)):CIRC(I),1:"")
+10 SET I=0
FOR
SET I=$ORDER(NURSE(I))
if 'I
QUIT
DO LINE(1)
SET @SRG@(SRI)=$$SPACE(2)_$PIECE(NURSE(I),"^")
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_$PIECE(NURSE(I),"^",2)
+11 QUIT
LAB1 NEW SRSP
SET SRLF=1
DO LINE(1)
SET @SRG@(SRI)="Material Sent to Laboratory for Analysis: "
+1 IF 'SRALL
IF '$ORDER(^SRF(SRTN,9,0))
IF '$ORDER(^SRF(SRTN,41,0))
SET @SRG@(SRI)=@SRG@(SRI)_"N/A"
QUIT
+2 DO LINE(1)
SET @SRG@(SRI)="Specimens: "
Begin DoDot:1
+3 IF '$ORDER(^SRF(SRTN,9,0))
SET @SRG@(SRI)=@SRG@(SRI)_"N/A"
QUIT
+4 SET SRSP=0
FOR
SET SRSP=$ORDER(^SRF(SRTN,9,SRSP))
if 'SRSP
QUIT
DO LINE(1)
SET @SRG@(SRI)=$$SPACE(2)_^SRF(SRTN,9,SRSP,0)
End DoDot:1
+5 DO LINE(1)
SET @SRG@(SRI)="Cultures: "
Begin DoDot:1
+6 IF '$ORDER(^SRF(SRTN,41,0))
SET @SRG@(SRI)=@SRG@(SRI)_"N/A"
QUIT
+7 SET SRSP=0
FOR
SET SRSP=$ORDER(^SRF(SRTN,41,SRSP))
if 'SRSP
QUIT
DO LINE(1)
SET @SRG@(SRI)=$$SPACE(2)_^SRF(SRTN,41,SRSP,0)
End DoDot:1
+8 QUIT
N(SRL) NEW SRN
IF $LENGTH(Y)>SRL
SET SRN=$PIECE(Y,",")_","_$EXTRACT($PIECE(Y,",",2))_"."
SET Y=SRN
+1 QUIT
SPACE(NUM) ; create spaces
+1 ;pass in position returns number of needed spaces
+2 IF '$DATA(@SRG@(SRI))
SET @SRG@(SRI)=""
+3 QUIT $JUSTIFY("",NUM-$LENGTH(@SRG@(SRI)))
LINE(NUM) ; create carriage returns
+1 IF $GET(SRLF)
SET NUM=NUM+1
SET SRLF=0
+2 FOR J=1:1:NUM
SET SRI=SRI+1
SET @SRG@(SRI)=""
+3 QUIT
ANE ; print anesthesia technique
+1 NEW A,AGNT,C,CNT,DRUG
+2 SET A=^SRF(SRTN,6,ANE,0)
SET Y=$PIECE(A,"^")
SET C=$PIECE(^DD(130.06,.01,0),"^",2)
if Y'=""
DO Y^DIQ
DO LINE(1)
SET Y=Y_$SELECT($PIECE(A,"^",3)="Y":" (PRINCIPAL)",1:"")
SET @SRG@(SRI)=$$SPACE(2)_Y
+3 QUIT
ENSC NEW X,SRLINE
+1 DO LINE(1)
SET @SRG@(SRI)=$SELECT(II=51:"Checklist Comment: ",II=49:" Hair Removal Comments: ",II=53:"Wound Sweep Comment: ",II=54:"Intra-Operative X-Ray Comment: ",1:"")
Begin DoDot:1
+2 IF '$ORDER(^SRF(SRTN,II,0))
SET @SRG@(SRI)=@SRG@(SRI)_"NO COMMENTS ENTERED"
QUIT
+3 SET SRLINE=0
FOR
SET SRLINE=$ORDER(^SRF(SRTN,II,SRLINE))
if 'SRLINE
QUIT
SET X=^SRF(SRTN,II,SRLINE,0)
DO COMM^SRONRPT3(X,3)
End DoDot:1
+4 QUIT