Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: HMPEHL7

HMPEHL7.m

Go to the documentation of this file.
  1. 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
  1. ;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; DE2818 SQA Findings. Changed ADT entry to accept parameters ASMR/RRB
  1. ; DE4781 HL7 Delimiters. Add guards to check for delimiter values
  1. Q
  1. ;
  1. ADT(HLFS,HLNEXT,HLNODE,HLQUIT) ; -- main entry point for the following HMP ADT client/router protocols:
  1. ; - HMP ADT-A04 CLIENT protocol
  1. ; o subscribes to VAFC ADT-A04 SERVER
  1. ; - HMP ADT-A08 CLIENT protocol
  1. ; o subscribes to VAFC ADT-A08 SERVER
  1. ;
  1. ; Note: These variables are provided by the VistA HL7 system when a
  1. ; subscriber protocol's ROUTING LOGIC is called:
  1. ; - HLNEXT
  1. ; - HLQUIT
  1. ; - HLNODE
  1. ; - HL("FS")
  1. ; - HL("ECH")
  1. ;
  1. ; -- Filters ADT/A04(registration) & A08 (patient security level change) events
  1. ; Scans for PID segment and uses embedded DFN
  1. ; Sets ^XTMP("HMPFS~... freshness queue
  1. ;
  1. NEW DONE,HMPSEG,HMPEVT
  1. SET DONE=0
  1. FOR XECUTE HLNEXT QUIT:HLQUIT'>0 DO QUIT:DONE
  1. . SET HMPSEG=$EXTRACT(HLNODE,1,3)
  1. . ;
  1. . IF HMPSEG="EVN" DO QUIT
  1. . . SET HMPEVT=$PIECE(HLNODE,HLFS,2)
  1. . . IF HMPEVT="A04" QUIT
  1. . . ; -- 97 reason = sensitive patient change occurred
  1. . . IF HMPEVT="A08",$PIECE(HLNODE,HLFS,5)=97 QUIT
  1. . . ; -- not an event HMP is interested in so done with message
  1. . . SET DONE=1
  1. . ; -- PID segment always comes after EVN segment
  1. . IF HMPSEG'="PID" QUIT
  1. . SET DONE=1
  1. . ; -- HMPEVT should always be defined at this point
  1. . IF $G(HMPEVT)="" QUIT
  1. . ;DE4781;BL;The HL("FS") and HL("ECH") may not be set. Ensure there are values or quit.
  1. . ;Both of these values are specific to the HL(771 file
  1. . ;they are primary and secondary delimiters
  1. . I $G(HL("FS"))="" S HL("FS")=$G(HLFS) ;if not set, set to the HLFS parameter
  1. . I $G(HL("ECH"))="" S HL("ECH")=$G(HLREC("ECH")) ;if secondary delimiter not set
  1. . Q:$G(HL("FS"))=""!($G(HL("ECH"))="") ;if delimiters not set quit
  1. . ;end DE4781
  1. . NEW DFN
  1. . SET DFN=+$PIECE($PIECE(HLNODE,HL("FS"),4),$EXTRACT(HL("ECH")))
  1. . IF 'DFN QUIT
  1. . DO POSTX^HMPEVNT("pt-select",DFN_"&"_HMPEVT) ;Ref File event
  1. . IF $DATA(^HMP(800000,"AITEM",DFN)) DO POST^HMPEVNT(DFN,"patient",DFN)
  1. QUIT
  1. ;