HMPEHL7 ;SLC/MJK,ASMR/RRB,BL - HMP HL7 ADT Message Processor;May 15, 2016 14:15
;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**1**;May 15, 2016;Build 4
;Per VA Directive 6402, this routine should not be modified.
;
; DE2818 SQA Findings. Changed ADT entry to accept parameters ASMR/RRB
; DE4781 HL7 Delimiters. Add guards to check for delimiter values
Q
;
ADT(HLFS,HLNEXT,HLNODE,HLQUIT) ; -- main entry point for the following HMP ADT client/router protocols:
; - HMP ADT-A04 CLIENT protocol
; o subscribes to VAFC ADT-A04 SERVER
; - HMP ADT-A08 CLIENT protocol
; o subscribes to VAFC ADT-A08 SERVER
;
; Note: These variables are provided by the VistA HL7 system when a
; subscriber protocol's ROUTING LOGIC is called:
; - HLNEXT
; - HLQUIT
; - HLNODE
; - HL("FS")
; - HL("ECH")
;
; -- Filters ADT/A04(registration) & A08 (patient security level change) events
; Scans for PID segment and uses embedded DFN
; Sets ^XTMP("HMPFS~... freshness queue
;
NEW DONE,HMPSEG,HMPEVT
SET DONE=0
FOR XECUTE HLNEXT QUIT:HLQUIT'>0 DO QUIT:DONE
. SET HMPSEG=$EXTRACT(HLNODE,1,3)
. ;
. IF HMPSEG="EVN" DO QUIT
. . SET HMPEVT=$PIECE(HLNODE,HLFS,2)
. . IF HMPEVT="A04" QUIT
. . ; -- 97 reason = sensitive patient change occurred
. . IF HMPEVT="A08",$PIECE(HLNODE,HLFS,5)=97 QUIT
. . ; -- not an event HMP is interested in so done with message
. . SET DONE=1
. ; -- PID segment always comes after EVN segment
. IF HMPSEG'="PID" QUIT
. SET DONE=1
. ; -- HMPEVT should always be defined at this point
. IF $G(HMPEVT)="" QUIT
. ;DE4781;BL;The HL("FS") and HL("ECH") may not be set. Ensure there are values or quit.
. ;Both of these values are specific to the HL(771 file
. ;they are primary and secondary delimiters
. I $G(HL("FS"))="" S HL("FS")=$G(HLFS) ;if not set, set to the HLFS parameter
. I $G(HL("ECH"))="" S HL("ECH")=$G(HLREC("ECH")) ;if secondary delimiter not set
. Q:$G(HL("FS"))=""!($G(HL("ECH"))="") ;if delimiters not set quit
. ;end DE4781
. NEW DFN
. SET DFN=+$PIECE($PIECE(HLNODE,HL("FS"),4),$EXTRACT(HL("ECH")))
. IF 'DFN QUIT
. DO POSTX^HMPEVNT("pt-select",DFN_"&"_HMPEVT) ;Ref File event
. IF $DATA(^HMP(800000,"AITEM",DFN)) DO POST^HMPEVNT(DFN,"patient",DFN)
QUIT
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHMPEHL7 2400 printed Oct 16, 2024@17:54:35 Page 2
HMPEHL7 ;SLC/MJK,ASMR/RRB,BL - HMP HL7 ADT Message Processor;May 15, 2016 14:15
+1 ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**1**;May 15, 2016;Build 4
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; DE2818 SQA Findings. Changed ADT entry to accept parameters ASMR/RRB
+5 ; DE4781 HL7 Delimiters. Add guards to check for delimiter values
+6 QUIT
+7 ;
ADT(HLFS,HLNEXT,HLNODE,HLQUIT) ; -- main entry point for the following HMP ADT client/router protocols:
+1 ; - HMP ADT-A04 CLIENT protocol
+2 ; o subscribes to VAFC ADT-A04 SERVER
+3 ; - HMP ADT-A08 CLIENT protocol
+4 ; o subscribes to VAFC ADT-A08 SERVER
+5 ;
+6 ; Note: These variables are provided by the VistA HL7 system when a
+7 ; subscriber protocol's ROUTING LOGIC is called:
+8 ; - HLNEXT
+9 ; - HLQUIT
+10 ; - HLNODE
+11 ; - HL("FS")
+12 ; - HL("ECH")
+13 ;
+14 ; -- Filters ADT/A04(registration) & A08 (patient security level change) events
+15 ; Scans for PID segment and uses embedded DFN
+16 ; Sets ^XTMP("HMPFS~... freshness queue
+17 ;
+18 NEW DONE,HMPSEG,HMPEVT
+19 SET DONE=0
+20 FOR
XECUTE HLNEXT
if HLQUIT'>0
QUIT
Begin DoDot:1
+21 SET HMPSEG=$EXTRACT(HLNODE,1,3)
+22 ;
+23 IF HMPSEG="EVN"
Begin DoDot:2
+24 SET HMPEVT=$PIECE(HLNODE,HLFS,2)
+25 IF HMPEVT="A04"
QUIT
+26 ; -- 97 reason = sensitive patient change occurred
+27 IF HMPEVT="A08"
IF $PIECE(HLNODE,HLFS,5)=97
QUIT
+28 ; -- not an event HMP is interested in so done with message
+29 SET DONE=1
End DoDot:2
QUIT
+30 ; -- PID segment always comes after EVN segment
+31 IF HMPSEG'="PID"
QUIT
+32 SET DONE=1
+33 ; -- HMPEVT should always be defined at this point
+34 IF $GET(HMPEVT)=""
QUIT
+35 ;DE4781;BL;The HL("FS") and HL("ECH") may not be set. Ensure there are values or quit.
+36 ;Both of these values are specific to the HL(771 file
+37 ;they are primary and secondary delimiters
+38 ;if not set, set to the HLFS parameter
IF $GET(HL("FS"))=""
SET HL("FS")=$GET(HLFS)
+39 ;if secondary delimiter not set
IF $GET(HL("ECH"))=""
SET HL("ECH")=$GET(HLREC("ECH"))
+40 ;if delimiters not set quit
if $GET(HL("FS"))=""!($GET(HL("ECH"))="")
QUIT
+41 ;end DE4781
+42 NEW DFN
+43 SET DFN=+$PIECE($PIECE(HLNODE,HL("FS"),4),$EXTRACT(HL("ECH")))
+44 IF 'DFN
QUIT
+45 ;Ref File event
DO POSTX^HMPEVNT("pt-select",DFN_"&"_HMPEVT)
+46 IF $DATA(^HMP(800000,"AITEM",DFN))
DO POST^HMPEVNT(DFN,"patient",DFN)
End DoDot:1
if DONE
QUIT
+47 QUIT
+48 ;