- DGPFHLT4 ;SHRPE/YMG - PRF HL7 QBP/RSP PROCESSING ; 05/02/18
- ;;5.3;Registration;**951**;Aug 13, 1993;Build 135
- ;;Per VA Directive 6402, this routine should not be modified.
- ;
- ; This is the main driver for sending ACK (general acknowledgement) messages.
- ;
- Q
- ;
- SEND(MSGID,DGMERR) ; entry point
- ; MSGID - HL7 message id to send ACK for
- ; DGMERR - error message to include in MSA segment
- ;
- N DGHLRSLT,SEGCNT
- K ^TMP("HLA",$J)
- ; Create HL7 message
- S SEGCNT=0
- S SEGCNT=$$SAVESEG(SEGCNT,$$MSA()) ; MSA segment
- ; Send HL7 message
- D GENACK^HLMA1(HL("EID"),$G(HLMTIENS),HL("EIDS"),"GM",1,.DGHLRSLT)
- K ^TMP("HLA",$J)
- Q
- ;
- MSA() ; create MSA segment
- N SEG
- S $P(SEG,HLFS)=$S($G(DGMERR)="":"AA",1:"AE") ; field 1
- S $P(SEG,HLFS,2)=$G(MSGID) ; field 2
- I $G(DGMERR)'="" S $P(SEG,HLFS,3)=$$ENCHL7^DGPFHLUT(DGMERR) ; field 3
- S SEG="MSA"_HLFS_SEG
- Q SEG
- ;
- SAVESEG(SEGCNT,SEG) ; save created segment in ^TMP global
- ; SEGCNT - current segment count
- ; SEG - segment to save
- ;
- S SEGCNT=SEGCNT+1
- S ^TMP("HLA",$J,SEGCNT)=SEG
- Q SEGCNT
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGPFHLT4 1122 printed Jan 18, 2025@03:48:32 Page 2
- DGPFHLT4 ;SHRPE/YMG - PRF HL7 QBP/RSP PROCESSING ; 05/02/18
- +1 ;;5.3;Registration;**951**;Aug 13, 1993;Build 135
- +2 ;;Per VA Directive 6402, this routine should not be modified.
- +3 ;
- +4 ; This is the main driver for sending ACK (general acknowledgement) messages.
- +5 ;
- +6 QUIT
- +7 ;
- SEND(MSGID,DGMERR) ; entry point
- +1 ; MSGID - HL7 message id to send ACK for
- +2 ; DGMERR - error message to include in MSA segment
- +3 ;
- +4 NEW DGHLRSLT,SEGCNT
- +5 KILL ^TMP("HLA",$JOB)
- +6 ; Create HL7 message
- +7 SET SEGCNT=0
- +8 ; MSA segment
- SET SEGCNT=$$SAVESEG(SEGCNT,$$MSA())
- +9 ; Send HL7 message
- +10 DO GENACK^HLMA1(HL("EID"),$GET(HLMTIENS),HL("EIDS"),"GM",1,.DGHLRSLT)
- +11 KILL ^TMP("HLA",$JOB)
- +12 QUIT
- +13 ;
- MSA() ; create MSA segment
- +1 NEW SEG
- +2 ; field 1
- SET $PIECE(SEG,HLFS)=$SELECT($GET(DGMERR)="":"AA",1:"AE")
- +3 ; field 2
- SET $PIECE(SEG,HLFS,2)=$GET(MSGID)
- +4 ; field 3
- IF $GET(DGMERR)'=""
- SET $PIECE(SEG,HLFS,3)=$$ENCHL7^DGPFHLUT(DGMERR)
- +5 SET SEG="MSA"_HLFS_SEG
- +6 QUIT SEG
- +7 ;
- SAVESEG(SEGCNT,SEG) ; save created segment in ^TMP global
- +1 ; SEGCNT - current segment count
- +2 ; SEG - segment to save
- +3 ;
- +4 SET SEGCNT=SEGCNT+1
- +5 SET ^TMP("HLA",$JOB,SEGCNT)=SEG
- +6 QUIT SEGCNT