SRONRPT ;BIR/ADM - NURSE INTRAOP REPORT ; [ 06/16/04 10:12 AM ]
;;3.0; Surgery ;**100,129**;24 Jun 93
;** NOTICE: This routine is part of an implementation of a nationally
;** controlled procedure. Local modifications to this routine
;** are prohibited.
;
D:'$D(SRTN) ^SROPS Q:'$D(SRTN)
D RPT^SRONRPT(SRTN)
Q
RPT(SRTN) ; send text of nurse intraoperative report to ^TMP
N ANE,C,CNT,I,J,K,SR,SRAGNT,SRALL,SRANES,SRANESA,SRC,SRCT,SRCASE,SRCONS,SRCONV,SRDISP,SRDIV,SRDT,SREL,SRELP,SRELP2,SRG,SRI,SRL,SRLF,SRLINE,SRMOOD,SROP,SROPER,SROPS,SROR,SRSCAN,SRSKIN,SRTIME,SRTYPE,SRUSER,SRX,SRZ,VIA,X,Y,Z
N SROIM,SROUT
S SRCASE=SRTN,SRG=$NA(^TMP("SRNIR",$J,SRCASE)),SRI=0 K @SRG
S SRDIV=$$SITE^SROUTL0(SRTN),SRALL=$S(SRDIV:$P(^SRO(133,SRDIV,0),"^",6),1:1)
I $P($G(^SRF(SRTN,30)),"^")!$P($G(^SRF(SRTN,31)),"^",8) D LINE(1) S @SRG@(SRI)=" * * OPERATION ABORTED * *" D LINE(1)
F X=0:.1:1.1,31,"1.0","VER" S SR(X)=$G(^SRF(SRTN,X))
S SROR=$P(SR(0),"^",2) I SROR S SROR=$P(^SRS(SROR,0),"^"),SROR=$P(^SC(SROR,0),"^")
I SROR="" S SROR="NOT ENTERED"
S Y=$P(SR(0),"^",10),C=$P(^DD(130,.035,0),"^",2) D:Y'="" Y^DIQ S SRTYPE=$S(Y="":"NOT ENTERED",1:Y)
D LINE(1) S @SRG@(SRI)="Operating Room: "_SROR S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Surgical Priority: "_SRTYPE
S Y=$P(SR(.2),"^",15) I Y D D^DIQ S SRTIME=$P(Y,"@")_" "_$P(Y,"@",2)
S:Y="" SRTIME="NOT ENTERED" D LINE(2) S @SRG@(SRI)="Patient in Hold: "_SRTIME
S Y=$P(SR(.2),"^",10) I Y D D^DIQ S SRTIME=$P(Y,"@")_" "_$P(Y,"@",2)
S:Y="" SRTIME="* NOT ENTERED *" S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Patient in OR: "_SRTIME
S Y=$P(SR(.2),"^",2) I Y D D^DIQ S SRTIME=$P(Y,"@")_" "_$P(Y,"@",2)
S:Y="" SRTIME="NOT ENTERED" D LINE(1) S @SRG@(SRI)="Operation Begin: "_SRTIME
S Y=$P(SR(.2),"^",3) I Y D D^DIQ S SRTIME=$P(Y,"@")_" "_$P(Y,"@",2)
S:Y="" SRTIME="NOT ENTERED" S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Operation End: "_SRTIME
D LINE(1) S @SRG@(SRI)="",Y=$P(SR(.2),"^",9) I Y D
.D D^DIQ S SRTIME=$P(Y,"@")_" "_$P(Y,"@",2)
.S:Y="" SRTIME="NOT ENTERED" S @SRG@(SRI)=@SRG@(SRI)_"Surgeon in OR: "_SRTIME
S Y=$P(SR(.2),"^",12) I Y D D^DIQ S SRTIME=$P(Y,"@")_" "_$P(Y,"@",2)
S:Y="" SRTIME="* NOT ENTERED *" S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Patient Out OR: "_SRTIME
D PROC I $O(^SRF(SRTN,13,0)) D OTHER
S Y=$P(SR("1.0"),"^",8),C=$P(^DD(130,1.09,0),"^",2) D:Y'="" Y^DIQ D LINE(2) S @SRG@(SRI)="Wound Classification: "_$S(Y'="":Y,1:"NOT ENTERED")
S Y=$P(SR(.4),"^",6),C=$P(^DD(130,.46,0),"^",2) D:Y'="" Y^DIQ S SRDISP=$S(Y'="":Y,1:"N/A")
I (SRDISP="N/A"&SRALL)!(SRDISP'="N/A") D LINE(1) S @SRG@(SRI)="Operation Disposition: "_SRDISP
S Y=$P(SR(.7),"^",4),C=$P(^DD(130,25,0),"^",2) D:Y'="" Y^DIQ S VIA=$S(Y'="":Y,1:"N/A")
I (VIA="N/A"&SRALL)!(VIA'="N/A") D LINE(1) S @SRG@(SRI)="Discharged Via: "_VIA
S Y=$P(SR(.1),"^",4),C=$P(^DD(130,.14,0),"^",2) D:Y'="" Y^DIQ,N(30) S:Y="" Y="NOT ENTERED" D LINE(2) S @SRG@(SRI)="Surgeon: "_Y
S Y=$P(SR(.1),"^",5),C=$P(^DD(130,.15,0),"^",2) D:Y'="" Y^DIQ,N(25) S:Y="" Y="N/A" S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"First Assist: "_Y
S Y=$P(SR(.1),"^",13),C=$P(^DD(130,.164,0),"^",2) D:Y'="" Y^DIQ,N(26) S:Y="" Y="N/A" D LINE(1) S @SRG@(SRI)="Attend Surg: "_Y
S Y=$P(SR(.1),"^",6),C=$P(^DD(130,.16,0),"^",2) D:Y'="" Y^DIQ,N(24) S:Y="" Y="N/A" S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Second Assist: "_Y
S Y=$P(SR(.3),"^"),C=$P(^DD(130,.31,0),"^",2) D:Y'="" Y^DIQ,N(26) S SRANES=$S(Y="":"NOT ENTERED",1:Y)
S Y=$P(SR(.3),"^",3),C=$P(^DD(130,.33,0),"^",2) D:Y'="" Y^DIQ,N(21) S SRANESA=$S(Y="":"N/A",1:Y)
I 'SRALL,SRANES="NOT ENTERED",SRANESA="N/A" G OSA
D LINE(1) S @SRG@(SRI)="Anesthetist: "_SRANES,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Assistant Anesth: "_SRANESA
OSA S SRLINE="Other Scrubbed Assistants: "
I '$O(^SRF(SRTN,28,0)),SRALL D LINE(2) S @SRG@(SRI)=SRLINE_"N/A"
I $O(^SRF(SRTN,28,0)) D LINE(2) S @SRG@(SRI)=SRLINE,OTH=0 F S OTH=$O(^SRF(SRTN,28,OTH)) Q:'OTH D
.S Y=$P(^SRF(SRTN,28,OTH,0),"^"),C=$P(^DD(130.23,.01,0),"^",2) D:Y'="" Y^DIQ D LINE(1) S @SRG@(SRI)=" "_Y
.I $O(^SRF(SRTN,28,OTH,1,0)) D
..S SRLINE=0,SRL=4 D LINE(1) S @SRG@(SRI)=" Comments:"
..F S SRLINE=$O(^SRF(SRTN,28,OTH,1,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,28,OTH,1,SRLINE,0) D COMM^SRONRPT3(X,SRL)
D ^SRONRPT0
Q
PROC ; print procedure informatiom
N I,M,MM,SRJ,SRMAJ,SROPER,SROPS,SRX,SRY,X,Z
S SRMAJ=$P(SR(0),"^",3),SRMAJ=$S(SRMAJ="J":"Major",SRMAJ="N":"Minor",1:"Major")
D LINE(2) S @SRG@(SRI)=SRMAJ_" Operations Performed:"
S SROPER=$P(^SRF(SRTN,"OP"),"^")
I $P($G(^SRF(SRTN,30)),"^")&$P($G(^SRF(SRTN,.2)),"^",10) S SROPER="** ABORTED ** "_SROPER
K SROPS,MM,MMM S:$L(SROPER)<70 SROPS(1)=SROPER I $L(SROPER)>69 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
F I=1:1 Q:'$D(SROPS(I)) D LINE(1) S @SRG@(SRI)=$S(I=1:"Primary: ",1:" ")_SROPS(I)
Q
OTHER ; other procedures
N CNT,OTH,OTHER,SRJ,SRX,SRY
S (OTH,CNT)=0 F S OTH=$O(^SRF(SRTN,13,OTH)) Q:'OTH S CNT=CNT+1 D OTH
Q
OTH S OTHER=$P(^SRF(SRTN,13,OTH,0),"^")
D LINE(1) S @SRG@(SRI)="Other: "_OTHER
Q
LOOP ; break procedure if greater than 70 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)'<70 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
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
F J=1:1:NUM S SRI=SRI+1,@SRG@(SRI)=""
Q
SRONRPT ;BIR/ADM - NURSE INTRAOP REPORT ; [ 06/16/04 10:12 AM ]
+1 ;;3.0; Surgery ;**100,129**;24 Jun 93
+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 IF '$DATA(SRTN)
DO ^SROPS
IF '$DATA(SRTN)
QUIT
+7 DO RPT^SRONRPT(SRTN)
+8 QUIT
RPT(SRTN) ; send text of nurse intraoperative report to ^TMP
+1 NEW ANE,C,CNT,I,J,K,SR,SRAGNT,SRALL,SRANES,SRANESA,SRC,SRCT,SRCASE,SRCONS,SRCONV,SRDISP,SRDIV,SRDT,SREL,SRELP,SRELP2,SRG,SRI,SRL,SRLF,SRLINE,SRMOOD,SROP,SROPER,SROPS,SROR,SRSCAN,SRSKIN,SRTIME,SRTYPE,SRUSER,SRX,SRZ,VIA,X,Y,Z
+2 NEW SROIM,SROUT
+3 SET SRCASE=SRTN
SET SRG=$NAME(^TMP("SRNIR",$JOB,SRCASE))
SET SRI=0
KILL @SRG
+4 SET SRDIV=$$SITE^SROUTL0(SRTN)
SET SRALL=$SELECT(SRDIV:$PIECE(^SRO(133,SRDIV,0),"^",6),1:1)
+5 IF $PIECE($GET(^SRF(SRTN,30)),"^")!$PIECE($GET(^SRF(SRTN,31)),"^",8)
DO LINE(1)
SET @SRG@(SRI)=" * * OPERATION ABORTED * *"
DO LINE(1)
+6 FOR X=0:.1:1.1,31,"1.0","VER"
SET SR(X)=$GET(^SRF(SRTN,X))
+7 SET SROR=$PIECE(SR(0),"^",2)
IF SROR
SET SROR=$PIECE(^SRS(SROR,0),"^")
SET SROR=$PIECE(^SC(SROR,0),"^")
+8 IF SROR=""
SET SROR="NOT ENTERED"
+9 SET Y=$PIECE(SR(0),"^",10)
SET C=$PIECE(^DD(130,.035,0),"^",2)
IF Y'=""
DO Y^DIQ
SET SRTYPE=$SELECT(Y="":"NOT ENTERED",1:Y)
+10 DO LINE(1)
SET @SRG@(SRI)="Operating Room: "_SROR
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Surgical Priority: "_SRTYPE
+11 SET Y=$PIECE(SR(.2),"^",15)
IF Y
DO D^DIQ
SET SRTIME=$PIECE(Y,"@")_" "_$PIECE(Y,"@",2)
+12 IF Y=""
SET SRTIME="NOT ENTERED"
DO LINE(2)
SET @SRG@(SRI)="Patient in Hold: "_SRTIME
+13 SET Y=$PIECE(SR(.2),"^",10)
IF Y
DO D^DIQ
SET SRTIME=$PIECE(Y,"@")_" "_$PIECE(Y,"@",2)
+14 IF Y=""
SET SRTIME="* NOT ENTERED *"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Patient in OR: "_SRTIME
+15 SET Y=$PIECE(SR(.2),"^",2)
IF Y
DO D^DIQ
SET SRTIME=$PIECE(Y,"@")_" "_$PIECE(Y,"@",2)
+16 IF Y=""
SET SRTIME="NOT ENTERED"
DO LINE(1)
SET @SRG@(SRI)="Operation Begin: "_SRTIME
+17 SET Y=$PIECE(SR(.2),"^",3)
IF Y
DO D^DIQ
SET SRTIME=$PIECE(Y,"@")_" "_$PIECE(Y,"@",2)
+18 IF Y=""
SET SRTIME="NOT ENTERED"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Operation End: "_SRTIME
+19 DO LINE(1)
SET @SRG@(SRI)=""
SET Y=$PIECE(SR(.2),"^",9)
IF Y
Begin DoDot:1
+20 DO D^DIQ
SET SRTIME=$PIECE(Y,"@")_" "_$PIECE(Y,"@",2)
+21 IF Y=""
SET SRTIME="NOT ENTERED"
SET @SRG@(SRI)=@SRG@(SRI)_"Surgeon in OR: "_SRTIME
End DoDot:1
+22 SET Y=$PIECE(SR(.2),"^",12)
IF Y
DO D^DIQ
SET SRTIME=$PIECE(Y,"@")_" "_$PIECE(Y,"@",2)
+23 IF Y=""
SET SRTIME="* NOT ENTERED *"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Patient Out OR: "_SRTIME
+24 DO PROC
IF $ORDER(^SRF(SRTN,13,0))
DO OTHER
+25 SET Y=$PIECE(SR("1.0"),"^",8)
SET C=$PIECE(^DD(130,1.09,0),"^",2)
IF Y'=""
DO Y^DIQ
DO LINE(2)
SET @SRG@(SRI)="Wound Classification: "_$SELECT(Y'="":Y,1:"NOT ENTERED")
+26 SET Y=$PIECE(SR(.4),"^",6)
SET C=$PIECE(^DD(130,.46,0),"^",2)
IF Y'=""
DO Y^DIQ
SET SRDISP=$SELECT(Y'="":Y,1:"N/A")
+27 IF (SRDISP="N/A"&SRALL)!(SRDISP'="N/A")
DO LINE(1)
SET @SRG@(SRI)="Operation Disposition: "_SRDISP
+28 SET Y=$PIECE(SR(.7),"^",4)
SET C=$PIECE(^DD(130,25,0),"^",2)
IF Y'=""
DO Y^DIQ
SET VIA=$SELECT(Y'="":Y,1:"N/A")
+29 IF (VIA="N/A"&SRALL)!(VIA'="N/A")
DO LINE(1)
SET @SRG@(SRI)="Discharged Via: "_VIA
+30 SET Y=$PIECE(SR(.1),"^",4)
SET C=$PIECE(^DD(130,.14,0),"^",2)
IF Y'=""
DO Y^DIQ
DO N(30)
IF Y=""
SET Y="NOT ENTERED"
DO LINE(2)
SET @SRG@(SRI)="Surgeon: "_Y
+31 SET Y=$PIECE(SR(.1),"^",5)
SET C=$PIECE(^DD(130,.15,0),"^",2)
IF Y'=""
DO Y^DIQ
DO N(25)
IF Y=""
SET Y="N/A"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"First Assist: "_Y
+32 SET Y=$PIECE(SR(.1),"^",13)
SET C=$PIECE(^DD(130,.164,0),"^",2)
IF Y'=""
DO Y^DIQ
DO N(26)
IF Y=""
SET Y="N/A"
DO LINE(1)
SET @SRG@(SRI)="Attend Surg: "_Y
+33 SET Y=$PIECE(SR(.1),"^",6)
SET C=$PIECE(^DD(130,.16,0),"^",2)
IF Y'=""
DO Y^DIQ
DO N(24)
IF Y=""
SET Y="N/A"
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Second Assist: "_Y
+34 SET Y=$PIECE(SR(.3),"^")
SET C=$PIECE(^DD(130,.31,0),"^",2)
IF Y'=""
DO Y^DIQ
DO N(26)
SET SRANES=$SELECT(Y="":"NOT ENTERED",1:Y)
+35 SET Y=$PIECE(SR(.3),"^",3)
SET C=$PIECE(^DD(130,.33,0),"^",2)
IF Y'=""
DO Y^DIQ
DO N(21)
SET SRANESA=$SELECT(Y="":"N/A",1:Y)
+36 IF 'SRALL
IF SRANES="NOT ENTERED"
IF SRANESA="N/A"
GOTO OSA
+37 DO LINE(1)
SET @SRG@(SRI)="Anesthetist: "_SRANES
SET @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Assistant Anesth: "_SRANESA
OSA SET SRLINE="Other Scrubbed Assistants: "
+1 IF '$ORDER(^SRF(SRTN,28,0))
IF SRALL
DO LINE(2)
SET @SRG@(SRI)=SRLINE_"N/A"
+2 IF $ORDER(^SRF(SRTN,28,0))
DO LINE(2)
SET @SRG@(SRI)=SRLINE
SET OTH=0
FOR
SET OTH=$ORDER(^SRF(SRTN,28,OTH))
IF 'OTH
QUIT
Begin DoDot:1
+3 SET Y=$PIECE(^SRF(SRTN,28,OTH,0),"^")
SET C=$PIECE(^DD(130.23,.01,0),"^",2)
IF Y'=""
DO Y^DIQ
DO LINE(1)
SET @SRG@(SRI)=" "_Y
+4 IF $ORDER(^SRF(SRTN,28,OTH,1,0))
Begin DoDot:2
+5 SET SRLINE=0
SET SRL=4
DO LINE(1)
SET @SRG@(SRI)=" Comments:"
+6 FOR
SET SRLINE=$ORDER(^SRF(SRTN,28,OTH,1,SRLINE))
IF 'SRLINE
QUIT
SET X=^SRF(SRTN,28,OTH,1,SRLINE,0)
DO COMM^SRONRPT3(X,SRL)
End DoDot:2
End DoDot:1
+7 DO ^SRONRPT0
+8 QUIT
PROC ; print procedure informatiom
+1 NEW I,M,MM,SRJ,SRMAJ,SROPER,SROPS,SRX,SRY,X,Z
+2 SET SRMAJ=$PIECE(SR(0),"^",3)
SET SRMAJ=$SELECT(SRMAJ="J":"Major",SRMAJ="N":"Minor",1:"Major")
+3 DO LINE(2)
SET @SRG@(SRI)=SRMAJ_" Operations Performed:"
+4 SET SROPER=$PIECE(^SRF(SRTN,"OP"),"^")
+5 IF $PIECE($GET(^SRF(SRTN,30)),"^")&$PIECE($GET(^SRF(SRTN,.2)),"^",10)
SET SROPER="** ABORTED ** "_SROPER
+6 KILL SROPS,MM,MMM
IF $LENGTH(SROPER)<70
SET SROPS(1)=SROPER
IF $LENGTH(SROPER)>69
SET SROPER=SROPER_" "
FOR M=1:1
DO LOOP
IF MMM=""
QUIT
+7 FOR I=1:1
IF '$DATA(SROPS(I))
QUIT
DO LINE(1)
SET @SRG@(SRI)=$SELECT(I=1:"Primary: ",1:" ")_SROPS(I)
+8 QUIT
OTHER ; other procedures
+1 NEW CNT,OTH,OTHER,SRJ,SRX,SRY
+2 SET (OTH,CNT)=0
FOR
SET OTH=$ORDER(^SRF(SRTN,13,OTH))
IF 'OTH
QUIT
SET CNT=CNT+1
DO OTH
+3 QUIT
OTH SET OTHER=$PIECE(^SRF(SRTN,13,OTH,0),"^")
+1 DO LINE(1)
SET @SRG@(SRI)="Other: "_OTHER
+2 QUIT
LOOP ; break procedure if greater than 70 characters
+1 SET SROPS(M)=""
FOR LOOP=1:1
SET MM=$PIECE(SROPER," ")
SET MMM=$PIECE(SROPER," ",2,200)
IF MMM=""
QUIT
IF $LENGTH(SROPS(M))+$LENGTH(MM)'<70
QUIT
SET SROPS(M)=SROPS(M)_MM_" "
SET SROPER=MMM
+2 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 FOR J=1:1:NUM
SET SRI=SRI+1
SET @SRG@(SRI)=""
+2 QUIT