SROARPT ;B'HAM ISC/MAM,ADM - ANESTHESIA REPORT ;10/21/04
;;3.0; Surgery ;**100,134**;24 Jun 93
;** NOTICE: This routine is part of an implementation of a nationally
;** controlled procedure. Local modifications to this routine
;** are prohibited.
;
; Reference to UPDATE^TIUSRVP supported by DBIA #3535
; Reference to ES^TIUSROI supported by DBIA #3537
;
I '$D(SRSITE) D ^SROVAR G:'$D(SRSITE) END S SRSITE("KILL")=1
I '$D(SRTN) K SRNEWOP D ^SROPS G:'$D(SRTN) END S SRTN("KILL")=1
N SRDIV,SRDO,SRFUNCT,SRHDR,SRINUSE,SRLEAVE,SRLOC,SRPARAM,SRPRINT,SRSEL,SRSINED,SRDTITL,SRTIU,SRXX
S SRDTITL="Anesthesia Report"
S (SRFUNCT,SRLEAVE,SRSINED)=0,SRTIU=$P($G(^SRF(SRTN,"TIU")),"^",4)
I SRTIU,$$STATUS^SROESUTL(SRTIU)=7 S SRSINED=1
D:SRSINED FUNCT D:'SRSINED EN
ENF I 'SRLEAVE,SRFUNCT S SRSEL="" D FUNCT
D END
Q
DISPLY I SRSINED S SRTIU=$P($G(^SRF(SRTN,"TIU")),"^",4) I SRTIU D PRNT^SROESPR(SRTN,SRTIU,SRDTITL) S SRLEAVE=1 Q
K %ZIS,IO("Q") S %ZIS="Q" D ^%ZIS I POP S SRLEAVE=1 Q
I $D(IO("Q")) K IO("Q") N ZTRTN,ZTDESC,ZTSAVE,ZTQUEUED S ZTRTN="PRNT^SROARPT",ZTDESC=SRDTITL,(ZTSAVE("SRTN"),ZTSAVE("SRSITE*"))="" D ^%ZTLOAD,^%ZISC Q
EN D RPT^SROANR(SRTN) S DFN=$P(^SRF(SRTN,0),"^"),VAINDT=$P(^SRF(SRTN,0),"^",9)
S Y=$E(VAINDT,1,7) D D^DIQ S SRSDATE=Y D OERR^VADPT
S SRHDR=" "_VADM(1)_" ("_VA("PID")_") Case #"_SRTN_" - "_SRSDATE
S Y=$E($$NOW^XLFDT,1,12) D DD^%DT S SRPRINT="Printed: "_Y
S SRLOC=" Pt Loc: "_$P(VAIN(4),"^",2)_" "_VAIN(5)
S SRAGE="",Z=$P(VADM(3),"^") I Z S X=$E($P(^SRF(SRTN,0),"^",9),1,12),Y=$E(X,1,7),SRAGE=$E(Y,1,3)-$E(Z,1,3)-($E(Y,4,7)<$E(Z,4,7))
S SRPARAM=$$SITE^SROUTL0(SRTN) I SRPARAM S X=$P(^SRO(133,SRPARAM,0),"^"),SRDIV=$$EXTERNAL^DILFD(133,.01,"",X)
S SRDIV=$S(SRDIV'="":SRDIV,1:SRSITE("SITE"))
S SRINUSE=$P($G(^SRO(133,SRPARAM,.1)),"^",4)
U IO S (SRPAGE,SRSOUT)=0,$P(SRLINE,"-",80)="" D HDR
S SRI=0 F S SRI=$O(^TMP("SRANE",$J,SRTN,SRI)) Q:'SRI D Q:SRSOUT
.I $E(IOST)="P",$Y+11>IOSL D FOOT Q:SRSOUT D HDR
.I $E(IOST)'="P",$Y+4>IOSL D FOOT Q:SRSOUT D HDR
.W !,^TMP("SRANE",$J,SRTN,SRI)
I SRSOUT D ^%ZISC Q
D FOOT D D ^%ZISC
.I $D(SRALRT) S SRFUNCT=1 Q
.I '$G(SRFUNCT) S SRLEAVE=1
Q
SRHDR S DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT
S Y=$E($P(^SRF(SRTN,0),"^",9),1,7) D D^DIQ S SRSDATE=Y
S SRHDR=" "_VADM(1)_" ("_VA("PID")_") Case #"_SRTN_" - "_SRSDATE
Q
PRNT N SRDIV,SRFUNCT,SRLEAVE D EN
END K ^TMP("SRANE",$J)
W @IOF I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
D ^SRSKILL K VAIN,VAINDT I $D(SRSITE("KILL")) K SRSITE
I $D(SRTN("KILL")) K SRTN
Q
PAGE I 'SRINUSE!'$D(^XUSEC("SROANES",DUZ)) D LAST Q
S (SRFUNCT,SRSOUT)=0
W ! K DIR S DIR(0)="FOA",DIR("A",1)=" Press <return> to continue, 'A' to access Anesthesia Report functions",DIR("A")=" or '^' to exit: " D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S (SRLEAVE,SRSOUT)=1 Q
I X="A"!(X="a") S (SRFUNCT,SRSOUT)=1
Q
LAST W ! K DIR S DIR(0)="E" D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1
Q
Q:SRSOUT I $E(IOST)'="P" D PAGE Q
I IOSL-9>$Y F X=$Y:1:(IOSL-10) W !
W !,SRLINE,!,VADM(1),?50,SRPRINT,!,VA("PID")_" Age: "_SRAGE,?50,SRLOC,!,SRDIV,?59,"Vice SF 509",!,SRLINE
Q
HDR ; heading
I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
S SRPAGE=SRPAGE+1 I $Y'=0 W @IOF
I $E(IOST)'="P",SRPAGE=1 S DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT S SRXX=VADM(1)_" ("_VA("PID")_")" W !,?(80-$L(SRXX)\2),SRXX
W:$E(IOST)="P" !!!!,SRLINE W !,?4,"MEDICAL RECORD ANESTHESIA REPORT - CASE #"_SRTN,?(79-$L("PAGE "_SRPAGE)),"PAGE "_SRPAGE,!
W:$E(IOST)="P" SRLINE,!
Q
FUNCT ; anethesia report functions
D:'$D(SRHDR) SRHDR S SRSOUT=0,SRTIU=$P($G(^SRF(SRTN,"TIU")),"^",4)
I 'SRSINED,SRTIU,$$STATUS^SROESUTL(SRTIU)=7 S SRSINED=1
W:$Y>0 @IOF W !,SRHDR I SRSINED W !!," * * The Anesthesia Report has been electronically signed. * *"
W !!," Anesthesia Report Functions:",!
S DIR("A",1)=" 1. Edit report information",DIR("A",2)=" 2. Print/View report from beginning"
S DIR("A",3)=$S('SRTIU:"",'SRSINED:" 3. Sign the report electronically",1:"") I SRTIU,'SRSINED S DIR("A",4)=""
S DIR("A")="Select number: ",DIR("B")=2,DIR(0)="SAM^1:Edit report information;2:Print/View report from beginning"_$S(('SRSINED&SRTIU):";3:Sign the report electronically",1:"")
D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S (SRLEAVE,SRSOUT)=1 D END Q
S SRSEL=Y,SRDO=$S(SRSEL=1:"EDIT",SRSEL=3:"SIGN",1:"DISPLY")
D @SRDO D UNLOCK^SROUTL(SRTN)
S SRSOUT=0,SRFUNCT=1 D ENF
Q
EDIT ; edit report data fields
D CHECK^SROES I SRSOUT Q
N SROLOCK,SRX,SRZ D ^SROLOCK I SROLOCK S Q3("VIEW")=""
N SRLCK S SRLCK=$$LOCK^SROUTL(SRTN) I 'SRLCK Q
K DA,DR,DIE S SRDTIME=DTIME,DTIME=3600,DIE=130,DA=SRTN,DR="[SROARPT]",ST="ANESTHESIA REPORT"_$S(SROLOCK:" **LOCKED",1:"") D EN2^SROVAR,^SRCUSS S DTIME=SRDTIME K Q3("VIEW")
I '$P(^SRF(SRTN,0),"^",20) D ^SROPCE1
I $D(SRODR) D ^SROCON1
S SROERR=SRTN D ^SROERR0
D EXIT^SROES
Q
SIGN ; sign report if appropriate user
N SRTIU S SRTIU=$P($G(^SRF(SRTN,"TIU")),"^",4) I SRTIU,$$STATUS^SROESUTL(SRTIU)=7 W !!,"This report is already signed." H 2 Q
N SRLCK,SRESIG S SRESIG=1,SRLCK=$$LOCK^SROUTL(SRTN) I 'SRLCK Q
N SRA,SRMISS,SROK,X,Y S SROK=0,X=$G(^SRF(SRTN,.3)) F Y=1,2,3,4 I $P(X,"^",Y)=DUZ S SROK=1 Q
I 'SROK W !!,"Sorry, you are not authorized to sign this report." H 2 Q
S SRMISS=0 D ALLIN Q:SRSOUT!SRMISS
ES D RPT^SROANR(SRTN)
N SRAY,SRERR,SRI,SRP,SRSIG,X1
S SRTIU=$P($G(^SRF(SRTN,"TIU")),"^",4)
D SIG^XUSESIG I X1="" W !!,"Signature failed." H 2 Q
F I=1:1 Q:'$D(^TMP("SRANE",$J,SRTN,I)) S SRAY("TEXT",I,0)=^TMP("SRANE",$J,SRTN,I)
S SRAY(.05)=5 D UPDATE^TIUSRVP(.SRERR,SRTIU,.SRAY,1) K SRAY
I +SRERR S SRSINED=1 D
.D ES^TIUSROI(SRTIU,DUZ)
.S XQAID="SRAR-"_SRTN,XQAKILL=0 D DELETEA^XQALERT
W ! K DIR S DIR(0)="FOA",DIR("A")="Press RETURN to continue... " D ^DIR K DIR
Q
ALLIN N SRFLD,SRI,SRP,SRX,SRY,SRZ
K DA,DIC,DIQ,DR S (SREDIT,SRMISS,SRSOUT)=0
S DIC="^SRF(",DA=SRTN,DIQ="SRY",DIQ(0)="I",DR=".21;.24;1.13;.46;.31" D EN^DIQ1 K DA,DIC,DIQ,DR D LIST
K SRY,SRZ D TECH^SROPRIN I SRTECH="NOT ENTERED" D
.I $O(^SRF(SRTN,6,0)) S SRX(.37)="PRINCIPAL ANESTHESIA TECHNIQUE NOT SELECTED" Q
.S SRX(.37)="ANESTHESIA TECHNIQUE"
S SRZ=0 F S SRZ=$O(SRX(SRZ)) Q:'SRZ S SRMISS=1 Q
I SRMISS D MESS Q:SRSOUT D:SREDIT EDIT
Q
MESS ; display list of missing items
W @IOF,!,"The following information is required before this report may be signed:",!
S SRZ=0 F S SRZ=$O(SRX(SRZ)) Q:'SRZ W !,?5,SRX(SRZ)
W ! K DIR S DIR("A")="Do you want to enter this information",DIR("B")="YES",DIR(0)="Y" D ^DIR K DIR,SRX I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 Q
I Y S SREDIT=1
Q
LIST S SRZ=0 F S SRZ=$O(SRY(130,SRTN,SRZ)) Q:'SRZ I SRY(130,SRTN,SRZ,"I")="" D TR S X=$T(@SRP),SRFLD=$P(X,";;",2),SRX(SRZ)=$P(SRFLD,"^",2)
Q
TR S SRP=SRZ,SRP=$TR(SRP,"1234567890.","ABCDEFGHIJP")
Q
PBA ;;.21^ANES CARE START TIME
PBD ;;.24^ANES CARE END TIME
APAC ;;1.13^ASA CLASS
PDF ;;.46^OP DISPOSITION
PCA ;;.31^PRINC ANESTHETIST
SROARPT ;B'HAM ISC/MAM,ADM - ANESTHESIA REPORT ;10/21/04
+1 ;;3.0; Surgery ;**100,134**;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 ; Reference to UPDATE^TIUSRVP supported by DBIA #3535
+7 ; Reference to ES^TIUSROI supported by DBIA #3537
+8 ;
+9 IF '$DATA(SRSITE)
DO ^SROVAR
IF '$DATA(SRSITE)
GOTO END
SET SRSITE("KILL")=1
+10 IF '$DATA(SRTN)
KILL SRNEWOP
DO ^SROPS
IF '$DATA(SRTN)
GOTO END
SET SRTN("KILL")=1
+11 NEW SRDIV,SRDO,SRFUNCT,SRHDR,SRINUSE,SRLEAVE,SRLOC,SRPARAM,SRPRINT,SRSEL,SRSINED,SRDTITL,SRTIU,SRXX
+12 SET SRDTITL="Anesthesia Report"
+13 SET (SRFUNCT,SRLEAVE,SRSINED)=0
SET SRTIU=$PIECE($GET(^SRF(SRTN,"TIU")),"^",4)
+14 IF SRTIU
IF $$STATUS^SROESUTL(SRTIU)=7
SET SRSINED=1
+15 IF SRSINED
DO FUNCT
IF 'SRSINED
DO EN
ENF IF 'SRLEAVE
IF SRFUNCT
SET SRSEL=""
DO FUNCT
+1 DO END
+2 QUIT
DISPLY IF SRSINED
SET SRTIU=$PIECE($GET(^SRF(SRTN,"TIU")),"^",4)
IF SRTIU
DO PRNT^SROESPR(SRTN,SRTIU,SRDTITL)
SET SRLEAVE=1
QUIT
+1 KILL %ZIS,IO("Q")
SET %ZIS="Q"
DO ^%ZIS
IF POP
SET SRLEAVE=1
QUIT
+2 IF $DATA(IO("Q"))
KILL IO("Q")
NEW ZTRTN,ZTDESC,ZTSAVE,ZTQUEUED
SET ZTRTN="PRNT^SROARPT"
SET ZTDESC=SRDTITL
SET (ZTSAVE("SRTN"),ZTSAVE("SRSITE*"))=""
DO ^%ZTLOAD
DO ^%ZISC
QUIT
EN DO RPT^SROANR(SRTN)
SET DFN=$PIECE(^SRF(SRTN,0),"^")
SET VAINDT=$PIECE(^SRF(SRTN,0),"^",9)
+1 SET Y=$EXTRACT(VAINDT,1,7)
DO D^DIQ
SET SRSDATE=Y
DO OERR^VADPT
+2 SET SRHDR=" "_VADM(1)_" ("_VA("PID")_") Case #"_SRTN_" - "_SRSDATE
+3 SET Y=$EXTRACT($$NOW^XLFDT,1,12)
DO DD^%DT
SET SRPRINT="Printed: "_Y
+4 SET SRLOC=" Pt Loc: "_$PIECE(VAIN(4),"^",2)_" "_VAIN(5)
+5 SET SRAGE=""
SET Z=$PIECE(VADM(3),"^")
IF Z
SET X=$EXTRACT($PIECE(^SRF(SRTN,0),"^",9),1,12)
SET Y=$EXTRACT(X,1,7)
SET SRAGE=$EXTRACT(Y,1,3)-$EXTRACT(Z,1,3)-($EXTRACT(Y,4,7)<$EXTRACT(Z,4,7))
+6 SET SRPARAM=$$SITE^SROUTL0(SRTN)
IF SRPARAM
SET X=$PIECE(^SRO(133,SRPARAM,0),"^")
SET SRDIV=$$EXTERNAL^DILFD(133,.01,"",X)
+7 SET SRDIV=$SELECT(SRDIV'="":SRDIV,1:SRSITE("SITE"))
+8 SET SRINUSE=$PIECE($GET(^SRO(133,SRPARAM,.1)),"^",4)
+9 USE IO
SET (SRPAGE,SRSOUT)=0
SET $PIECE(SRLINE,"-",80)=""
DO HDR
+10 SET SRI=0
FOR
SET SRI=$ORDER(^TMP("SRANE",$JOB,SRTN,SRI))
IF 'SRI
QUIT
Begin DoDot:1
+11 IF $EXTRACT(IOST)="P"
IF $Y+11>IOSL
DO FOOT
IF SRSOUT
QUIT
DO HDR
+12 IF $EXTRACT(IOST)'="P"
IF $Y+4>IOSL
DO FOOT
IF SRSOUT
QUIT
DO HDR
+13 WRITE !,^TMP("SRANE",$JOB,SRTN,SRI)
End DoDot:1
IF SRSOUT
QUIT
+14 IF SRSOUT
DO ^%ZISC
QUIT
+15 DO FOOT
Begin DoDot:1
+16 IF $DATA(SRALRT)
SET SRFUNCT=1
QUIT
+17 IF '$GET(SRFUNCT)
SET SRLEAVE=1
End DoDot:1
DO ^%ZISC
+18 QUIT
SRHDR SET DFN=$PIECE(^SRF(SRTN,0),"^")
DO DEM^VADPT
+1 SET Y=$EXTRACT($PIECE(^SRF(SRTN,0),"^",9),1,7)
DO D^DIQ
SET SRSDATE=Y
+2 SET SRHDR=" "_VADM(1)_" ("_VA("PID")_") Case #"_SRTN_" - "_SRSDATE
+3 QUIT
PRNT NEW SRDIV,SRFUNCT,SRLEAVE
DO EN
END KILL ^TMP("SRANE",$JOB)
+1 WRITE @IOF
IF $DATA(ZTQUEUED)
IF $GET(ZTSTOP)
QUIT
SET ZTREQ="@"
QUIT
+2 DO ^SRSKILL
KILL VAIN,VAINDT
IF $DATA(SRSITE("KILL"))
KILL SRSITE
+3 IF $DATA(SRTN("KILL"))
KILL SRTN
+4 QUIT
PAGE IF 'SRINUSE!'$DATA(^XUSEC("SROANES",DUZ))
DO LAST
QUIT
+1 SET (SRFUNCT,SRSOUT)=0
+2 WRITE !
KILL DIR
SET DIR(0)="FOA"
SET DIR("A",1)=" Press <return> to continue, 'A' to access Anesthesia Report functions"
SET DIR("A")=" or '^' to exit: "
DO ^DIR
KILL DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
SET (SRLEAVE,SRSOUT)=1
QUIT
+3 IF X="A"!(X="a")
SET (SRFUNCT,SRSOUT)=1
+4 QUIT
LAST WRITE !
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
SET SRSOUT=1
+1 QUIT
+1 IF SRSOUT
QUIT
IF $EXTRACT(IOST)'="P"
DO PAGE
QUIT
+2 IF IOSL-9>$Y
FOR X=$Y:1:(IOSL-10)
WRITE !
+3 WRITE !,SRLINE,!,VADM(1),?50,SRPRINT,!,VA("PID")_" Age: "_SRAGE,?50,SRLOC,!,SRDIV,?59,"Vice SF 509",!,SRLINE
+4 QUIT
HDR ; heading
+1 IF $DATA(ZTQUEUED)
DO ^SROSTOP
IF SRHALT
SET SRSOUT=1
QUIT
+2 SET SRPAGE=SRPAGE+1
IF $Y'=0
WRITE @IOF
+3 IF $EXTRACT(IOST)'="P"
IF SRPAGE=1
SET DFN=$PIECE(^SRF(SRTN,0),"^")
DO DEM^VADPT
SET SRXX=VADM(1)_" ("_VA("PID")_")"
WRITE !,?(80-$LENGTH(SRXX)\2),SRXX
+4 IF $EXTRACT(IOST)="P"
WRITE !!!!,SRLINE
WRITE !,?4,"MEDICAL RECORD ANESTHESIA REPORT - CASE #"_SRTN,?(79-$LENGTH("PAGE "_SRPAGE)),"PAGE "_SRPAGE,!
+5 IF $EXTRACT(IOST)="P"
WRITE SRLINE,!
+6 QUIT
FUNCT ; anethesia report functions
+1 IF '$DATA(SRHDR)
DO SRHDR
SET SRSOUT=0
SET SRTIU=$PIECE($GET(^SRF(SRTN,"TIU")),"^",4)
+2 IF 'SRSINED
IF SRTIU
IF $$STATUS^SROESUTL(SRTIU)=7
SET SRSINED=1
+3 IF $Y>0
WRITE @IOF
WRITE !,SRHDR
IF SRSINED
WRITE !!," * * The Anesthesia Report has been electronically signed. * *"
+4 WRITE !!," Anesthesia Report Functions:",!
+5 SET DIR("A",1)=" 1. Edit report information"
SET DIR("A",2)=" 2. Print/View report from beginning"
+6 SET DIR("A",3)=$SELECT('SRTIU:"",'SRSINED:" 3. Sign the report electronically",1:"")
IF SRTIU
IF 'SRSINED
SET DIR("A",4)=""
+7 SET DIR("A")="Select number: "
SET DIR("B")=2
SET DIR(0)="SAM^1:Edit report information;2:Print/View report from beginning"_$SELECT(('SRSINED&SRTIU):";3:Sign the report electronically",1:"")
+8 DO ^DIR
KILL DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
SET (SRLEAVE,SRSOUT)=1
DO END
QUIT
+9 SET SRSEL=Y
SET SRDO=$SELECT(SRSEL=1:"EDIT",SRSEL=3:"SIGN",1:"DISPLY")
+10 DO @SRDO
DO UNLOCK^SROUTL(SRTN)
+11 SET SRSOUT=0
SET SRFUNCT=1
DO ENF
+12 QUIT
EDIT ; edit report data fields
+1 DO CHECK^SROES
IF SRSOUT
QUIT
+2 NEW SROLOCK,SRX,SRZ
DO ^SROLOCK
IF SROLOCK
SET Q3("VIEW")=""
+3 NEW SRLCK
SET SRLCK=$$LOCK^SROUTL(SRTN)
IF 'SRLCK
QUIT
+4 KILL DA,DR,DIE
SET SRDTIME=DTIME
SET DTIME=3600
SET DIE=130
SET DA=SRTN
SET DR="[SROARPT]"
SET ST="ANESTHESIA REPORT"_$SELECT(SROLOCK:" **LOCKED",1:"")
DO EN2^SROVAR
DO ^SRCUSS
SET DTIME=SRDTIME
KILL Q3("VIEW")
+5 IF '$PIECE(^SRF(SRTN,0),"^",20)
DO ^SROPCE1
+6 IF $DATA(SRODR)
DO ^SROCON1
+7 SET SROERR=SRTN
DO ^SROERR0
+8 DO EXIT^SROES
+9 QUIT
SIGN ; sign report if appropriate user
+1 NEW SRTIU
SET SRTIU=$PIECE($GET(^SRF(SRTN,"TIU")),"^",4)
IF SRTIU
IF $$STATUS^SROESUTL(SRTIU)=7
WRITE !!,"This report is already signed."
HANG 2
QUIT
+2 NEW SRLCK,SRESIG
SET SRESIG=1
SET SRLCK=$$LOCK^SROUTL(SRTN)
IF 'SRLCK
QUIT
+3 NEW SRA,SRMISS,SROK,X,Y
SET SROK=0
SET X=$GET(^SRF(SRTN,.3))
FOR Y=1,2,3,4
IF $PIECE(X,"^",Y)=DUZ
SET SROK=1
QUIT
+4 IF 'SROK
WRITE !!,"Sorry, you are not authorized to sign this report."
HANG 2
QUIT
+5 SET SRMISS=0
DO ALLIN
IF SRSOUT!SRMISS
QUIT
ES DO RPT^SROANR(SRTN)
+1 NEW SRAY,SRERR,SRI,SRP,SRSIG,X1
+2 SET SRTIU=$PIECE($GET(^SRF(SRTN,"TIU")),"^",4)
+3 DO SIG^XUSESIG
IF X1=""
WRITE !!,"Signature failed."
HANG 2
QUIT
+4 FOR I=1:1
IF '$DATA(^TMP("SRANE",$JOB,SRTN,I))
QUIT
SET SRAY("TEXT",I,0)=^TMP("SRANE",$JOB,SRTN,I)
+5 SET SRAY(.05)=5
DO UPDATE^TIUSRVP(.SRERR,SRTIU,.SRAY,1)
KILL SRAY
+6 IF +SRERR
SET SRSINED=1
Begin DoDot:1
+7 DO ES^TIUSROI(SRTIU,DUZ)
+8 SET XQAID="SRAR-"_SRTN
SET XQAKILL=0
DO DELETEA^XQALERT
End DoDot:1
+9 WRITE !
KILL DIR
SET DIR(0)="FOA"
SET DIR("A")="Press RETURN to continue... "
DO ^DIR
KILL DIR
+10 QUIT
ALLIN NEW SRFLD,SRI,SRP,SRX,SRY,SRZ
+1 KILL DA,DIC,DIQ,DR
SET (SREDIT,SRMISS,SRSOUT)=0
+2 SET DIC="^SRF("
SET DA=SRTN
SET DIQ="SRY"
SET DIQ(0)="I"
SET DR=".21;.24;1.13;.46;.31"
DO EN^DIQ1
KILL DA,DIC,DIQ,DR
DO LIST
+3 KILL SRY,SRZ
DO TECH^SROPRIN
IF SRTECH="NOT ENTERED"
Begin DoDot:1
+4 IF $ORDER(^SRF(SRTN,6,0))
SET SRX(.37)="PRINCIPAL ANESTHESIA TECHNIQUE NOT SELECTED"
QUIT
+5 SET SRX(.37)="ANESTHESIA TECHNIQUE"
End DoDot:1
+6 SET SRZ=0
FOR
SET SRZ=$ORDER(SRX(SRZ))
IF 'SRZ
QUIT
SET SRMISS=1
QUIT
+7 IF SRMISS
DO MESS
IF SRSOUT
QUIT
IF SREDIT
DO EDIT
+8 QUIT
MESS ; display list of missing items
+1 WRITE @IOF,!,"The following information is required before this report may be signed:",!
+2 SET SRZ=0
FOR
SET SRZ=$ORDER(SRX(SRZ))
IF 'SRZ
QUIT
WRITE !,?5,SRX(SRZ)
+3 WRITE !
KILL DIR
SET DIR("A")="Do you want to enter this information"
SET DIR("B")="YES"
SET DIR(0)="Y"
DO ^DIR
KILL DIR,SRX
IF $DATA(DTOUT)!$DATA(DUOUT)
SET SRSOUT=1
QUIT
+4 IF Y
SET SREDIT=1
+5 QUIT
LIST SET SRZ=0
FOR
SET SRZ=$ORDER(SRY(130,SRTN,SRZ))
IF 'SRZ
QUIT
IF SRY(130,SRTN,SRZ,"I")=""
DO TR
SET X=$TEXT(@SRP)
SET SRFLD=$PIECE(X,";;",2)
SET SRX(SRZ)=$PIECE(SRFLD,"^",2)
+1 QUIT
TR SET SRP=SRZ
SET SRP=$TRANSLATE(SRP,"1234567890.","ABCDEFGHIJP")
+1 QUIT
PBA ;;.21^ANES CARE START TIME
PBD ;;.24^ANES CARE END TIME
APAC ;;1.13^ASA CLASS
PDF ;;.46^OP DISPOSITION
PCA ;;.31^PRINC ANESTHETIST