SROCVER ;BIR/SJA - CODE SET VERSIONING UTILITY ;16 Oct 2013 3:23 PM
;;3.0;Surgery;**116,177**;24 Jun 93;Build 89
;
;Reference to $$CPT^ICPTCOD supported by DBIA #1995
;Reference to ^TMP("CSLSUR1" supported by DBIA #3498
;Reference to $$CODEC^ICDEX supported by DBIA #5747
;
VALIDAT N ATTD,SRBB,SRCC,DLN,SRII,SRJJ,SLN,OCOD,SRAA,SRCODE,SRDATE,SRMOD,SRND0,SRND1,SRND34,SRNON,SRJ,SROP,SRPD,SRT,SRY,SRX,SRX1,SRYY,XMY,Y
K ^TMP("SRCVER",$J) S $P(DLN,"-",78)=""
S SRTN=$S($D(SRTN):SRTN,1:DA),SRND0=$G(^SRF(SRTN,0)),SROP=$G(^SRF(SRTN,"OP")),SRND1=$G(^SRF(SRTN,.1)),SRNON=$G(^SRF(SRTN,"NON"))
S SRPD=$S($D(^SRF(SRTN,"NON")):$P(SRNON,"^",6),1:$P(SRND1,"^",4)),ATTD=$S($D(^SRF(SRTN,"NON")):$P(SRNON,"^",7),1:$P(SRND1,"^",13)),SRND34=$G(^SRF(SRTN,34))
S SRDATE=$S($P(SRND0,"^",9):$P(SRND0,"^",9),1:DT)
;
S SRCODE=$P(SROP,"^",2) I SRCODE S SRT=$$CPT^ICPTCOD(SRCODE,SRDATE) I $P(SRT,"^",7)=0 S ^TMP("SRCVER",$J,"1;!;PRINCIPAL CPT CODE",$P(SRT,"^",2))=SRCODE D
.S (SRJJ,SRII)=0 F S SRII=$O(^SRF(SRTN,"OPMOD",SRII)) Q:'SRII S SRMOD="" S (Y,SRT)=$P($G(^SRF(SRTN,"OPMOD",SRII,0)),"^") D DISPLAY^SROMOD S SRMOD=$S($G(SRMOD):SRMOD_","_Y,1:Y) D
..S ^TMP("SRCVER",$J,"1_1;; CPT MODIFIER",SRMOD)=SRT_"^"_SRII
;
S (SRT,SRAA)=0 F S SRAA=$O(^SRF(SRTN,13,SRAA)) Q:'SRAA S OCOD=+$G(^(SRAA,2)) I OCOD S SRT=$$CPT^ICPTCOD(OCOD,SRDATE) I $P(SRT,"^",7)=0 S ^TMP("SRCVER",$J,"2;!;OTHER PROCEDURE CPT CODE",$P(SRT,"^",2))=OCOD_"^"_SRAA D
.S SRBB=0 F S SRBB=$O(^SRF(SRTN,13,SRAA,"MOD",SRBB)) Q:'SRBB S SRMOD="" S (SRT,Y)=$P($G(^SRF(SRTN,13,SRAA,"MOD",SRBB,0)),"^") D DISPLAY^SROMOD S SRMOD=$S($G(SRMOD):SRMOD_","_Y,1:Y) D
..S ^TMP("SRCVER",$J,"2_1;; CPT MODIFIER",SRMOD)=$P(SRT,"^")_"^"_SRAA
;
; RBD - 10/15/13 - PATCH 177 - Logic expanded to include ICD-10
I $P(SRND34,"^",3)'="" S SRT=$$ICD^SROICD(SRTN,$P(SRND34,"^",3)) I +$P(SRT,"^",10)=0 S ^TMP("SRCVER",$J,"3;!;PRIN DIAGNOSIS CODE",$$CODEC^ICDEX(80,$P(SRND34,"^",3)))=$P(SRND34,"^",3)
;
S SRAA=0 F S SRAA=$O(^SRF(SRTN,14,SRAA)) Q:'SRAA S OCOD=$P(^SRF(SRTN,14,SRAA,0),"^",3) I OCOD S SRT=$$ICD^SROICD(SRTN,OCOD) I +$P(SRT,"^",10)=0 S ^TMP("SRCVER",$J,"4;!;OTHER PREOP DIAGNOSIS",$$CODEC^ICDEX(80,OCOD))=OCOD_"^"_SRAA
; End 177
;
DISP Q:'$D(^TMP("SRCVER",$J))
W !!,DLN
D EN^DDIOL("The following codes are no longer active and will be deleted for case #:"_SRTN,,"!")
S SRAA="" F S SRAA=$O(^TMP("SRCVER",$J,SRAA)) Q:SRAA="" W:SRAA["!" ! S (SRBB,SRCC)="" F S SRBB=$O(^TMP("SRCVER",$J,SRAA,SRBB)) Q:SRBB="" S SRCC=SRCC+1 D
.; RBD - 10/15/13 - PATCH 177 - Display Code Set Version also
.W:SRCC=1 !,?10,$P(SRAA,";",3)_$S($P(SRAA,";",3)["DIAGNOSIS":" "_SRICDV,1:"")_": ",?40,SRBB W:SRCC>1 !,?40,SRBB
D EN^DDIOL("New active codes must be re-entered. A MailMan message will be sent to",,"!!")
D EN^DDIOL("the "_$S(SRNON'="":"provider and attending provider",1:"surgeon and attending surgeon")_" of record and to the user who edited",,"!")
D EN^DDIOL("the record with case details for follow-up.",,"!")
W !!,DLN
W !!,"Press RETURN to continue " R SRX:DTIME
D SENDMSG
Q
SENDMSG ;Send mail message when check is complete.
Q:'$D(^TMP("SRCVER",$J))
; RBD - 10/15/13 - PATCH 177 - Logic expanded to include ICD-10
K SR,XMY S XMDUZ="SURGERY PACKAGE",XMSUB="ICD"_$S($$ICD910^SROICD(SRTN)["10":"-9",1:"")_" OR CPT CODE DELETION",XMY(DUZ)="",SLN=0 D NOW^%DTC S Y=% X ^DD("DD")
; End 177
F SRJJ=SRPD,ATTD,DUZ S:$G(SRJJ) XMY(SRJJ)=""
S DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT
S SR(1)="Patient: "_$E(VADM(1),1,20)_$J("",30-$L(VADM(1)))_" Case #: "_SRTN
S Y=SRDATE D DD^%DT
S SR(2)=$S(SRNON'="":"Procedure Date: ",1:"Operation Date: ")_Y_" "_$P(SROP,"^"),SR(3)=""
S SR(5)="The following codes are no longer active and were deleted for this"
S SR(6)="case when the "_$S(SRNON'="":"Time Procedure Began",1:"Time Patient in OR")_" was entered."
S SR(7)="",SLN=8
S SRX=$J("",8),SRX1=$J("",40)
;
PCPT S SRAA=0,SRAA=$O(^TMP("SRCVER",$J,"1;!;PRINCIPAL CPT CODE",SRAA)) I SRAA S SR(SLN)=SRX_"PRINCIPAL CPT CODE: "_SRAA D
.K SRY S SRY(130,SRTN_",",27)="@" D FILE^DIE("","SRY")
.S SRMOD="",SRJJ=0 F S SRMOD=$O(^TMP("SRCVER",$J,"1_1;; CPT MODIFIER",SRMOD)) Q:SRMOD="" D
..S SRJJ=SRJJ+1,SLN=SLN+1 S:SRJJ=1 SR(SLN)=SRX_" CPT MODIFIER:"_$J("",14)_SRMOD S:SRJJ>1 SR(SLN)=$J("",36)_SRMOD
..K SRY S SRY(130,SRTN_",",28)="@" D FILE^DIE("","SRY")
S SLN=SLN+1,SR(SLN)=""
;
OCPT S SRAA=0,SLN=SLN+1 F S SRAA=$O(^TMP("SRCVER",$J,"2;!;OTHER PROCEDURE CPT CODE",SRAA)) Q:'SRAA S SR(SLN)=SRX_"OTHER PROCEDURE CPT CODE: "_SRAA,SRJ=$P($G(^(SRAA)),"^",2) D
.K SRY S SRY(130.16,SRJ_","_SRTN_",",3)="@" D FILE^DIE("","SRY")
.S SRMOD="",SRJJ=0 F S SRMOD=$O(^TMP("SRCVER",$J,"2_1;; CPT MODIFIER",SRMOD)) Q:SRMOD="" S SRJ=$G(^(SRMOD)) D
..S SRJJ=SRJJ+1,SLN=SLN+1 S:SRJJ=1 SR(SLN)=SRX_" CPT MODIFIER:"_$J("",14)_SRMOD S:SRJJ>1 SR(SLN)=$J("",36)_SRMOD
..K SRY S SRY(130.16,SRJ_","_SRTN_",",4)="@" D FILE^DIE("","SRY")
;
PD ; RBD - 10/15/13 - PATCH 177 - Expanded to include ICD-10
S SRAA=0,SLN=SLN+1,SRAA=$O(^TMP("SRCVER",$J,"3;!;PRIN DIAGNOSIS CODE",SRAA)) I SRAA'="" S SR(SLN)=SRX_"PRIN DIAGNOSIS CODE "_SRICDV_":"_SRX_SRAA K SRY S SRY(130,SRTN_",",32.5)="@" D FILE^DIE("","SRY") D
.I +$P($$ICD^SROICD(SRTN,$P(SRND34,"^",2)),"^",10)=0 D
..K SRY S SRY(130,SRTN_",",66)="@" D FILE^DIE("","SRY")
;
OPD S (SRJJ,SRAA)=0 F S SRAA=$O(^TMP("SRCVER",$J,"4;!;OTHER PREOP DIAGNOSIS",SRAA)) Q:SRAA="" S SLN=SLN+1,SRJJ=SRJJ+1 S SRYY=$P($G(^(SRAA)),"^",2) D
.S:SRJJ=1 SR(SLN)=SRX_"OTHER PREOP DIAGNOSIS "_SRICDV_":"_$J("",6)_SRAA S:SRJJ>1 SR(SLN)=$J("",36)_SRAA
.K SRY S SRY(130.17,SRYY_","_SRTN_",",3)="@" D FILE^DIE("","SRY")
; End 177
S (SR(SLN+1),SR(SLN+2))=""
S SR(SLN+3)="New active codes must be re-entered."
S XMTEXT="SR(" D ^XMD
; RBD - 10/15/13 - PATCH 177 - Date change so re-acquire Code Set Version
S SRICDV=$$ICDSTR^SROICD(SRTN)
; End 177
;
CFLS ;This line of code to update Surgery-CoreFLS changes
Q:'$D(^TMP("CSLSUR1",$J))
S SRSITE=$S($D(SRSITE):SRSITE,1:$$SITE^SROUTL0(SRTN))
;JAS - 11/07/14 - PATCH 177 - Added code to preserve Fileman variables since ^SROERR0 was intermittently killing them
N SRFMTMP
S SRFMTMP("DC")=DC,SRFMTMP("DL")=DL,SRFMTMP("DP")=DP,SRFMTMP("DA")=DA,SRFMTMP("DR")=DR
S SROERR=SRTN D ^SROERR0
I $G(DC)="" S DC=SRFMTMP("DC")
I $G(DL)="" S DL=SRFMTMP("DL")
I $G(DP)="" S DP=SRFMTMP("DP")
I $G(DA)="" S DA=SRFMTMP("DA")
I $G(DR)="" S DR=SRFMTMP("DR")
K SRFMTMP
;END 177
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROCVER 6479 printed Oct 16, 2024@18:43:41 Page 2
SROCVER ;BIR/SJA - CODE SET VERSIONING UTILITY ;16 Oct 2013 3:23 PM
+1 ;;3.0;Surgery;**116,177**;24 Jun 93;Build 89
+2 ;
+3 ;Reference to $$CPT^ICPTCOD supported by DBIA #1995
+4 ;Reference to ^TMP("CSLSUR1" supported by DBIA #3498
+5 ;Reference to $$CODEC^ICDEX supported by DBIA #5747
+6 ;
VALIDAT NEW ATTD,SRBB,SRCC,DLN,SRII,SRJJ,SLN,OCOD,SRAA,SRCODE,SRDATE,SRMOD,SRND0,SRND1,SRND34,SRNON,SRJ,SROP,SRPD,SRT,SRY,SRX,SRX1,SRYY,XMY,Y
+1 KILL ^TMP("SRCVER",$JOB)
SET $PIECE(DLN,"-",78)=""
+2 SET SRTN=$SELECT($DATA(SRTN):SRTN,1:DA)
SET SRND0=$GET(^SRF(SRTN,0))
SET SROP=$GET(^SRF(SRTN,"OP"))
SET SRND1=$GET(^SRF(SRTN,.1))
SET SRNON=$GET(^SRF(SRTN,"NON"))
+3 SET SRPD=$SELECT($DATA(^SRF(SRTN,"NON")):$PIECE(SRNON,"^",6),1:$PIECE(SRND1,"^",4))
SET ATTD=$SELECT($DATA(^SRF(SRTN,"NON")):$PIECE(SRNON,"^",7),1:$PIECE(SRND1,"^",13))
SET SRND34=$GET(^SRF(SRTN,34))
+4 SET SRDATE=$SELECT($PIECE(SRND0,"^",9):$PIECE(SRND0,"^",9),1:DT)
+5 ;
+6 SET SRCODE=$PIECE(SROP,"^",2)
IF SRCODE
SET SRT=$$CPT^ICPTCOD(SRCODE,SRDATE)
IF $PIECE(SRT,"^",7)=0
SET ^TMP("SRCVER",$JOB,"1;!;PRINCIPAL CPT CODE",$PIECE(SRT,"^",2))=SRCODE
Begin DoDot:1
+7 SET (SRJJ,SRII)=0
FOR
SET SRII=$ORDER(^SRF(SRTN,"OPMOD",SRII))
if 'SRII
QUIT
SET SRMOD=""
SET (Y,SRT)=$PIECE($GET(^SRF(SRTN,"OPMOD",SRII,0)),"^")
DO DISPLAY^SROMOD
SET SRMOD=$SELECT($GET(SRMOD):SRMOD_","_Y,1:Y)
Begin DoDot:2
+8 SET ^TMP("SRCVER",$JOB,"1_1;; CPT MODIFIER",SRMOD)=SRT_"^"_SRII
End DoDot:2
End DoDot:1
+9 ;
+10 SET (SRT,SRAA)=0
FOR
SET SRAA=$ORDER(^SRF(SRTN,13,SRAA))
if 'SRAA
QUIT
SET OCOD=+$GET(^(SRAA,2))
IF OCOD
SET SRT=$$CPT^ICPTCOD(OCOD,SRDATE)
IF $PIECE(SRT,"^",7)=0
SET ^TMP("SRCVER",$JOB,"2;!;OTHER PROCEDURE CPT CODE",$PIECE(SRT,"^",2))=OCOD_"^"_SRAA
Begin DoDot:1
+11 SET SRBB=0
FOR
SET SRBB=$ORDER(^SRF(SRTN,13,SRAA,"MOD",SRBB))
if 'SRBB
QUIT
SET SRMOD=""
SET (SRT,Y)=$PIECE($GET(^SRF(SRTN,13,SRAA,"MOD",SRBB,0)),"^")
DO DISPLAY^SROMOD
SET SRMOD=$SELECT($GET(SRMOD):SRMOD_","_Y,1:Y)
Begin DoDot:2
+12 SET ^TMP("SRCVER",$JOB,"2_1;; CPT MODIFIER",SRMOD)=$PIECE(SRT,"^")_"^"_SRAA
End DoDot:2
End DoDot:1
+13 ;
+14 ; RBD - 10/15/13 - PATCH 177 - Logic expanded to include ICD-10
+15 IF $PIECE(SRND34,"^",3)'=""
SET SRT=$$ICD^SROICD(SRTN,$PIECE(SRND34,"^",3))
IF +$PIECE(SRT,"^",10)=0
SET ^TMP("SRCVER",$JOB,"3;!;PRIN DIAGNOSIS CODE",$$CODEC^ICDEX(80,$PIECE(SRND34,"^",3)))=$PIECE(SRND34,"^",3)
+16 ;
+17 SET SRAA=0
FOR
SET SRAA=$ORDER(^SRF(SRTN,14,SRAA))
if 'SRAA
QUIT
SET OCOD=$PIECE(^SRF(SRTN,14,SRAA,0),"^",3)
IF OCOD
SET SRT=$$ICD^SROICD(SRTN,OCOD)
IF +$PIECE(SRT,"^",10)=0
SET ^TMP("SRCVER",$JOB,"4;!;OTHER PREOP DIAGNOSIS",$$CODEC^ICDEX(80,OCOD))=OCOD_"^"_SRAA
+18 ; End 177
+19 ;
DISP if '$DATA(^TMP("SRCVER",$JOB))
QUIT
+1 WRITE !!,DLN
+2 DO EN^DDIOL("The following codes are no longer active and will be deleted for case #:"_SRTN,,"!")
+3 SET SRAA=""
FOR
SET SRAA=$ORDER(^TMP("SRCVER",$JOB,SRAA))
if SRAA=""
QUIT
if SRAA["!"
WRITE !
SET (SRBB,SRCC)=""
FOR
SET SRBB=$ORDER(^TMP("SRCVER",$JOB,SRAA,SRBB))
if SRBB=""
QUIT
SET SRCC=SRCC+1
Begin DoDot:1
+4 ; RBD - 10/15/13 - PATCH 177 - Display Code Set Version also
+5 if SRCC=1
WRITE !,?10,$PIECE(SRAA,";",3)_$SELECT($PIECE(SRAA,";",3)["DIAGNOSIS":" "_SRICDV,1:"")_": ",?40,SRBB
if SRCC>1
WRITE !,?40,SRBB
End DoDot:1
+6 DO EN^DDIOL("New active codes must be re-entered. A MailMan message will be sent to",,"!!")
+7 DO EN^DDIOL("the "_$SELECT(SRNON'="":"provider and attending provider",1:"surgeon and attending surgeon")_" of record and to the user who edited",,"!")
+8 DO EN^DDIOL("the record with case details for follow-up.",,"!")
+9 WRITE !!,DLN
+10 WRITE !!,"Press RETURN to continue "
READ SRX:DTIME
+11 DO SENDMSG
+12 QUIT
SENDMSG ;Send mail message when check is complete.
+1 if '$DATA(^TMP("SRCVER",$JOB))
QUIT
+2 ; RBD - 10/15/13 - PATCH 177 - Logic expanded to include ICD-10
+3 KILL SR,XMY
SET XMDUZ="SURGERY PACKAGE"
SET XMSUB="ICD"_$SELECT($$ICD910^SROICD(SRTN)["10":"-9",1:"")_" OR CPT CODE DELETION"
SET XMY(DUZ)=""
SET SLN=0
DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
+4 ; End 177
+5 FOR SRJJ=SRPD,ATTD,DUZ
if $GET(SRJJ)
SET XMY(SRJJ)=""
+6 SET DFN=$PIECE(^SRF(SRTN,0),"^")
DO DEM^VADPT
+7 SET SR(1)="Patient: "_$EXTRACT(VADM(1),1,20)_$JUSTIFY("",30-$LENGTH(VADM(1)))_" Case #: "_SRTN
+8 SET Y=SRDATE
DO DD^%DT
+9 SET SR(2)=$SELECT(SRNON'="":"Procedure Date: ",1:"Operation Date: ")_Y_" "_$PIECE(SROP,"^")
SET SR(3)=""
+10 SET SR(5)="The following codes are no longer active and were deleted for this"
+11 SET SR(6)="case when the "_$SELECT(SRNON'="":"Time Procedure Began",1:"Time Patient in OR")_" was entered."
+12 SET SR(7)=""
SET SLN=8
+13 SET SRX=$JUSTIFY("",8)
SET SRX1=$JUSTIFY("",40)
+14 ;
PCPT SET SRAA=0
SET SRAA=$ORDER(^TMP("SRCVER",$JOB,"1;!;PRINCIPAL CPT CODE",SRAA))
IF SRAA
SET SR(SLN)=SRX_"PRINCIPAL CPT CODE: "_SRAA
Begin DoDot:1
+1 KILL SRY
SET SRY(130,SRTN_",",27)="@"
DO FILE^DIE("","SRY")
+2 SET SRMOD=""
SET SRJJ=0
FOR
SET SRMOD=$ORDER(^TMP("SRCVER",$JOB,"1_1;; CPT MODIFIER",SRMOD))
if SRMOD=""
QUIT
Begin DoDot:2
+3 SET SRJJ=SRJJ+1
SET SLN=SLN+1
if SRJJ=1
SET SR(SLN)=SRX_" CPT MODIFIER:"_$JUSTIFY("",14)_SRMOD
if SRJJ>1
SET SR(SLN)=$JUSTIFY("",36)_SRMOD
+4 KILL SRY
SET SRY(130,SRTN_",",28)="@"
DO FILE^DIE("","SRY")
End DoDot:2
End DoDot:1
+5 SET SLN=SLN+1
SET SR(SLN)=""
+6 ;
OCPT SET SRAA=0
SET SLN=SLN+1
FOR
SET SRAA=$ORDER(^TMP("SRCVER",$JOB,"2;!;OTHER PROCEDURE CPT CODE",SRAA))
if 'SRAA
QUIT
SET SR(SLN)=SRX_"OTHER PROCEDURE CPT CODE: "_SRAA
SET SRJ=$PIECE($GET(^(SRAA)),"^",2)
Begin DoDot:1
+1 KILL SRY
SET SRY(130.16,SRJ_","_SRTN_",",3)="@"
DO FILE^DIE("","SRY")
+2 SET SRMOD=""
SET SRJJ=0
FOR
SET SRMOD=$ORDER(^TMP("SRCVER",$JOB,"2_1;; CPT MODIFIER",SRMOD))
if SRMOD=""
QUIT
SET SRJ=$GET(^(SRMOD))
Begin DoDot:2
+3 SET SRJJ=SRJJ+1
SET SLN=SLN+1
if SRJJ=1
SET SR(SLN)=SRX_" CPT MODIFIER:"_$JUSTIFY("",14)_SRMOD
if SRJJ>1
SET SR(SLN)=$JUSTIFY("",36)_SRMOD
+4 KILL SRY
SET SRY(130.16,SRJ_","_SRTN_",",4)="@"
DO FILE^DIE("","SRY")
End DoDot:2
End DoDot:1
+5 ;
PD ; RBD - 10/15/13 - PATCH 177 - Expanded to include ICD-10
+1 SET SRAA=0
SET SLN=SLN+1
SET SRAA=$ORDER(^TMP("SRCVER",$JOB,"3;!;PRIN DIAGNOSIS CODE",SRAA))
IF SRAA'=""
SET SR(SLN)=SRX_"PRIN DIAGNOSIS CODE "_SRICDV_":"_SRX_SRAA
KILL SRY
SET SRY(130,SRTN_",",32.5)="@"
DO FILE^DIE("","SRY")
Begin DoDot:1
+2 IF +$PIECE($$ICD^SROICD(SRTN,$PIECE(SRND34,"^",2)),"^",10)=0
Begin DoDot:2
+3 KILL SRY
SET SRY(130,SRTN_",",66)="@"
DO FILE^DIE("","SRY")
End DoDot:2
End DoDot:1
+4 ;
OPD SET (SRJJ,SRAA)=0
FOR
SET SRAA=$ORDER(^TMP("SRCVER",$JOB,"4;!;OTHER PREOP DIAGNOSIS",SRAA))
if SRAA=""
QUIT
SET SLN=SLN+1
SET SRJJ=SRJJ+1
SET SRYY=$PIECE($GET(^(SRAA)),"^",2)
Begin DoDot:1
+1 if SRJJ=1
SET SR(SLN)=SRX_"OTHER PREOP DIAGNOSIS "_SRICDV_":"_$JUSTIFY("",6)_SRAA
if SRJJ>1
SET SR(SLN)=$JUSTIFY("",36)_SRAA
+2 KILL SRY
SET SRY(130.17,SRYY_","_SRTN_",",3)="@"
DO FILE^DIE("","SRY")
End DoDot:1
+3 ; End 177
+4 SET (SR(SLN+1),SR(SLN+2))=""
+5 SET SR(SLN+3)="New active codes must be re-entered."
+6 SET XMTEXT="SR("
DO ^XMD
+7 ; RBD - 10/15/13 - PATCH 177 - Date change so re-acquire Code Set Version
+8 SET SRICDV=$$ICDSTR^SROICD(SRTN)
+9 ; End 177
+10 ;
CFLS ;This line of code to update Surgery-CoreFLS changes
+1 if '$DATA(^TMP("CSLSUR1",$JOB))
QUIT
+2 SET SRSITE=$SELECT($DATA(SRSITE):SRSITE,1:$$SITE^SROUTL0(SRTN))
+3 ;JAS - 11/07/14 - PATCH 177 - Added code to preserve Fileman variables since ^SROERR0 was intermittently killing them
+4 NEW SRFMTMP
+5 SET SRFMTMP("DC")=DC
SET SRFMTMP("DL")=DL
SET SRFMTMP("DP")=DP
SET SRFMTMP("DA")=DA
SET SRFMTMP("DR")=DR
+6 SET SROERR=SRTN
DO ^SROERR0
+7 IF $GET(DC)=""
SET DC=SRFMTMP("DC")
+8 IF $GET(DL)=""
SET DL=SRFMTMP("DL")
+9 IF $GET(DP)=""
SET DP=SRFMTMP("DP")
+10 IF $GET(DA)=""
SET DA=SRFMTMP("DA")
+11 IF $GET(DR)=""
SET DR=SRFMTMP("DR")
+12 KILL SRFMTMP
+13 ;END 177
+14 QUIT