SROESHL ;BIR/ADM - E-SIG HL7 UTILITY ; [ 02/06/01 9:28 AM ]
;;3.0; Surgery ;**100**;24 Jun 93
;
;** NOTICE: This routine is part of an implementation of a nationally
;** controlled procedure. Local modifications to this routine
;** are prohibited.
;
N SRESARF,SRESNRF S SRESQ=0 I $G(SRESAR) D Q:SRESQ
.S SRESARF="58,57,21,111,61,15,14,60,54,29,20,69,22,75,68,92,63,62,52,51,53,47,50,45,42,115,96,18,55,19,40,39,49,43,44,23,65,64"
.I SRESARF[IEN D XTMP S SRESQ=1
I $G(SRESNR) D
.S SRESNRF="58,57,54,20,114,22,31,52,51,53,47,50,115,18,55,40,39,34,113,13,49,7,8,10,12,17,33,36,23,35,37"
.I SRESNRF[IEN D XTMP S SRESQ=1
Q
XTMP ; store info for alert in ^XTMP
S SRESCNT=SRESCNT+1 I SRESCNT=1 S XQAID="SRESHL_"_CASE,XQAKILL=0 D DELETEA^XQALERT K ^XTMP("SRESHL_"_CASE)
I '$D(^XTMP("SRESHL_"_CASE,0)) D
.N X,X1,X2 S X1=DT,X2=14 D C^%DTC S ^XTMP("SRESHL_"_CASE,0)=X_"^"_DT_"^Surgery HL7 Transmission Alert"
.S ^XTMP("SRESHL_"_CASE,1,1)="The following data elements are contained on an electronically signed report"
.S ^XTMP("SRESHL_"_CASE,1,2)="and cannot be uploaded to the surgical record in VistA. These data elements"
.S ^XTMP("SRESHL_"_CASE,1,3)="must be entered manually and will require that an addendum be made to the"
.S ^XTMP("SRESHL_"_CASE,1,4)="signed report.",^XTMP("SRESHL_"_CASE,1,5)=""
.N DFN S DFN=$P(^SRF(CASE,0),"^") D DEM^VADPT
.S ^XTMP("SRESHL_"_CASE,1,6)="Patient: "_VADM(1)_" ("_VA("PID")_") - Case #"_CASE,^XTMP("SRESHL_"_CASE,1,7)=""
S SRESFLD=$P(^SRO(133.2,IEN,0),"^"),SRESVAL=$$VALUE^SRHLUI(IEN)
S ^XTMP("SRESHL_"_CASE,2,IEN)=" "_SRESFLD_" : "_SRESVAL
ALERT ; send alert to prin. anesthetist and anes. supervisor
Q:'$O(^XTMP("SRESHL_"_CASE,0)) N X,Y,Z
S XQAID="SRESHL_"_CASE,XQAKILL=0 D DELETEA^XQALERT
S Z=$G(^SRF(CASE,.3)),X=$P(Z,"^"),Y=$P(Z,"^",4) Q:X=""&(Y="")
S:X XQA(X)="" S:Y XQA(Y)="" S XQAMSG="Cannot upload Surgery data on signed report."
S XQAROU="ACTION^SROESHL",XQAID="SRESHL_"_CASE D SETUP^XQALERT
Q
ACTION ; alert action
N SRID S SRID=$P(XQAID,";") Q:'$O(^XTMP(SRID,0))
W @IOF
D EN^DDIOL("","^XTMP(SRID,1)")
D EN^DDIOL("","^XTMP(SRID,2)")
Q
SROESHL ;BIR/ADM - E-SIG HL7 UTILITY ; [ 02/06/01 9:28 AM ]
+1 ;;3.0; Surgery ;**100**;24 Jun 93
+2 ;
+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 NEW SRESARF,SRESNRF
SET SRESQ=0
IF $GET(SRESAR)
Begin DoDot:1
+8 SET SRESARF="58,57,21,111,61,15,14,60,54,29,20,69,22,75,68,92,63,62,52,51,53,47,50,45,42,115,96,18,55,19,40,39,49,43,44,23,65,64"
+9 IF SRESARF[IEN
DO XTMP
SET SRESQ=1
End DoDot:1
IF SRESQ
QUIT
+10 IF $GET(SRESNR)
Begin DoDot:1
+11 SET SRESNRF="58,57,54,20,114,22,31,52,51,53,47,50,115,18,55,40,39,34,113,13,49,7,8,10,12,17,33,36,23,35,37"
+12 IF SRESNRF[IEN
DO XTMP
SET SRESQ=1
End DoDot:1
+13 QUIT
XTMP ; store info for alert in ^XTMP
+1 SET SRESCNT=SRESCNT+1
IF SRESCNT=1
SET XQAID="SRESHL_"_CASE
SET XQAKILL=0
DO DELETEA^XQALERT
KILL ^XTMP("SRESHL_"_CASE)
+2 IF '$DATA(^XTMP("SRESHL_"_CASE,0))
Begin DoDot:1
+3 NEW X,X1,X2
SET X1=DT
SET X2=14
DO C^%DTC
SET ^XTMP("SRESHL_"_CASE,0)=X_"^"_DT_"^Surgery HL7 Transmission Alert"
+4 SET ^XTMP("SRESHL_"_CASE,1,1)="The following data elements are contained on an electronically signed report"
+5 SET ^XTMP("SRESHL_"_CASE,1,2)="and cannot be uploaded to the surgical record in VistA. These data elements"
+6 SET ^XTMP("SRESHL_"_CASE,1,3)="must be entered manually and will require that an addendum be made to the"
+7 SET ^XTMP("SRESHL_"_CASE,1,4)="signed report."
SET ^XTMP("SRESHL_"_CASE,1,5)=""
+8 NEW DFN
SET DFN=$PIECE(^SRF(CASE,0),"^")
DO DEM^VADPT
+9 SET ^XTMP("SRESHL_"_CASE,1,6)="Patient: "_VADM(1)_" ("_VA("PID")_") - Case #"_CASE
SET ^XTMP("SRESHL_"_CASE,1,7)=""
End DoDot:1
+10 SET SRESFLD=$PIECE(^SRO(133.2,IEN,0),"^")
SET SRESVAL=$$VALUE^SRHLUI(IEN)
+11 SET ^XTMP("SRESHL_"_CASE,2,IEN)=" "_SRESFLD_" : "_SRESVAL
ALERT ; send alert to prin. anesthetist and anes. supervisor
+1 IF '$ORDER(^XTMP("SRESHL_"_CASE,0))
QUIT
NEW X,Y,Z
+2 SET XQAID="SRESHL_"_CASE
SET XQAKILL=0
DO DELETEA^XQALERT
+3 SET Z=$GET(^SRF(CASE,.3))
SET X=$PIECE(Z,"^")
SET Y=$PIECE(Z,"^",4)
IF X=""&(Y="")
QUIT
+4 IF X
SET XQA(X)=""
IF Y
SET XQA(Y)=""
SET XQAMSG="Cannot upload Surgery data on signed report."
+5 SET XQAROU="ACTION^SROESHL"
SET XQAID="SRESHL_"_CASE
DO SETUP^XQALERT
+6 QUIT
ACTION ; alert action
+1 NEW SRID
SET SRID=$PIECE(XQAID,";")
IF '$ORDER(^XTMP(SRID,0))
QUIT
+2 WRITE @IOF
+3 DO EN^DDIOL("","^XTMP(SRID,1)")
+4 DO EN^DDIOL("","^XTMP(SRID,2)")
+5 QUIT