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

DGPFHLT4.m

Go to the documentation of this file.
  1. DGPFHLT4 ;SHRPE/YMG - PRF HL7 QBP/RSP PROCESSING ; 05/02/18
  1. ;;5.3;Registration;**951**;Aug 13, 1993;Build 135
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; This is the main driver for sending ACK (general acknowledgement) messages.
  1. ;
  1. Q
  1. ;
  1. SEND(MSGID,DGMERR) ; entry point
  1. ; MSGID - HL7 message id to send ACK for
  1. ; DGMERR - error message to include in MSA segment
  1. ;
  1. N DGHLRSLT,SEGCNT
  1. K ^TMP("HLA",$J)
  1. ; Create HL7 message
  1. S SEGCNT=0
  1. S SEGCNT=$$SAVESEG(SEGCNT,$$MSA()) ; MSA segment
  1. ; Send HL7 message
  1. D GENACK^HLMA1(HL("EID"),$G(HLMTIENS),HL("EIDS"),"GM",1,.DGHLRSLT)
  1. K ^TMP("HLA",$J)
  1. Q
  1. ;
  1. MSA() ; create MSA segment
  1. N SEG
  1. S $P(SEG,HLFS)=$S($G(DGMERR)="":"AA",1:"AE") ; field 1
  1. S $P(SEG,HLFS,2)=$G(MSGID) ; field 2
  1. I $G(DGMERR)'="" S $P(SEG,HLFS,3)=$$ENCHL7^DGPFHLUT(DGMERR) ; field 3
  1. S SEG="MSA"_HLFS_SEG
  1. Q SEG
  1. ;
  1. SAVESEG(SEGCNT,SEG) ; save created segment in ^TMP global
  1. ; SEGCNT - current segment count
  1. ; SEG - segment to save
  1. ;
  1. S SEGCNT=SEGCNT+1
  1. S ^TMP("HLA",$J,SEGCNT)=SEG
  1. Q SEGCNT