DGENEGT3 ;ALB/KCL/RGL - PROCESS INCOMING MFN HL7 MSGS; 04-MAY-1999 ; 7/23/03 4:49pm
;;5.3;Registration;**232,306,417,451**;Aug 13, 1993
;
;
MFI ; Description: This procedure parses the MFI segment type.
;
; Input:
; SEG - array containing the HL7 segment
; MSGID - message control id of HL7 msg in the MSH segment
;
; Output:
; DGMFI - array containing needed fields of MFI segment
; ERROR - flag set if an error is encountered during parse
;
S DGMFI("MASTERID")=$$CONVERT^DGENUPL1(SEG(1))
S DGMFI("EVENT")=$$CONVERT^DGENUPL1(SEG(3))
;
Q
;
;
MFE ; Description: This procedure parses the MFE segment.
;
; Input:
; SEG - array containing the HL7 segment
; MSGID - message control id of HL7 msg in the MSH segment
;
; Output:
; DGMFE - array containing needed fields of MFE segment
; ERROR - flag set if an error is encountered during parse
;
S DGMFE("RECEVNT")=$$CONVERT^DGENUPL1(SEG(1))
S DGMFE("CNTRLNUM")=$$CONVERT^DGENUPL1(SEG(2))
S DGEGT("PRIMKEY")=$$CONVERT^DGENUPL1(SEG(4))
;
Q
;
;
ZEG ; Description: This procedure parses the ZEG segment.
;
; Input:
; SEG - array containing the HL7 segment
; MSGID - message control id of HL7 msg in the MSH segment
; DGMFE - array containing fields of MFE segment needed for MFK
; DGMFI - array containing fields of MFI segment needed for MFK
;
; Output:
; DGEGT - array containing the EGT record in FileMan format
; ERROR - flag set if an error is encountered during parse
;
N SUB
;
S DGEGT("EFFDATE")=$$CONVERT^DGENUPL1(SEG(2),"DATE",.ERROR)
I ERROR D Q
.D ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 2",.ERRCOUNT,.DGMFI,.DGMFE) Q
S DGEGT("PRIORITY")=$$CONVERT^DGENUPL1(+SEG(1))
S DGEGT("SUBGRP")=$$CONVERT^DGENUPL1($P(SEG(7),$E(HLECH)))
S DGEGT("TYPE")=$$CONVERT^DGENUPL1(+SEG(3))
S DGEGT("FEDDATE")=$$CONVERT^DGENUPL1(SEG(6),"DATE",.ERROR)
I ERROR D Q
.D ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 6",.ERRCOUNT,.DGMFI,.DGMFE) Q
S DGEGT("REMARKS")=$$CONVERT^DGENUPL1(SEG(4))
;
; convert '@' to null values in DGEGT() array
S SUB=""
F S SUB=$O(DGEGT(SUB)) Q:(SUB="") I ($G(DGEGT(SUB))="@") S DGEGT(SUB)=""
;
Q
;
UPLDEGT(DGEGT,ERROR) ;
; Description: This procedure is used to upload the Enrollment Group
; Threshold (EGT) received from the HEC. The validation/consitency
; checks should already have been completed.
;
; Inputs:
; DGEGT - array containing the EGT record (pass by reference)
;
; Outputs: None
;
; Store EGT from HEC and quit.
;
I $$STORE^DGENEGT(.DGEGT,,1)
;
; Old code removed per DG*5.3*451
;;
;N CURIEN
;;
;; is there a current EGT setting?
;S CURIEN=$$FINDCUR^DGENEGT()
;;
;; if there is no current EGT, store EGT from HEC and quit
;I 'CURIEN D Q
;.I $$STORE^DGENEGT(.DGEGT,,1)
;;
;; if there is a current EGT, delete current, and store EGT from HEC
;I $$DELETE^DGENEGT(CURIEN) D
;.I $$STORE^DGENEGT(.DGEGT,,1)
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGENEGT3 3032 printed Nov 22, 2024@17:52:38 Page 2
DGENEGT3 ;ALB/KCL/RGL - PROCESS INCOMING MFN HL7 MSGS; 04-MAY-1999 ; 7/23/03 4:49pm
+1 ;;5.3;Registration;**232,306,417,451**;Aug 13, 1993
+2 ;
+3 ;
MFI ; Description: This procedure parses the MFI segment type.
+1 ;
+2 ; Input:
+3 ; SEG - array containing the HL7 segment
+4 ; MSGID - message control id of HL7 msg in the MSH segment
+5 ;
+6 ; Output:
+7 ; DGMFI - array containing needed fields of MFI segment
+8 ; ERROR - flag set if an error is encountered during parse
+9 ;
+10 SET DGMFI("MASTERID")=$$CONVERT^DGENUPL1(SEG(1))
+11 SET DGMFI("EVENT")=$$CONVERT^DGENUPL1(SEG(3))
+12 ;
+13 QUIT
+14 ;
+15 ;
MFE ; Description: This procedure parses the MFE segment.
+1 ;
+2 ; Input:
+3 ; SEG - array containing the HL7 segment
+4 ; MSGID - message control id of HL7 msg in the MSH segment
+5 ;
+6 ; Output:
+7 ; DGMFE - array containing needed fields of MFE segment
+8 ; ERROR - flag set if an error is encountered during parse
+9 ;
+10 SET DGMFE("RECEVNT")=$$CONVERT^DGENUPL1(SEG(1))
+11 SET DGMFE("CNTRLNUM")=$$CONVERT^DGENUPL1(SEG(2))
+12 SET DGEGT("PRIMKEY")=$$CONVERT^DGENUPL1(SEG(4))
+13 ;
+14 QUIT
+15 ;
+16 ;
ZEG ; Description: This procedure parses the ZEG segment.
+1 ;
+2 ; Input:
+3 ; SEG - array containing the HL7 segment
+4 ; MSGID - message control id of HL7 msg in the MSH segment
+5 ; DGMFE - array containing fields of MFE segment needed for MFK
+6 ; DGMFI - array containing fields of MFI segment needed for MFK
+7 ;
+8 ; Output:
+9 ; DGEGT - array containing the EGT record in FileMan format
+10 ; ERROR - flag set if an error is encountered during parse
+11 ;
+12 NEW SUB
+13 ;
+14 SET DGEGT("EFFDATE")=$$CONVERT^DGENUPL1(SEG(2),"DATE",.ERROR)
+15 IF ERROR
Begin DoDot:1
+16 DO ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 2",.ERRCOUNT,.DGMFI,.DGMFE)
QUIT
End DoDot:1
QUIT
+17 SET DGEGT("PRIORITY")=$$CONVERT^DGENUPL1(+SEG(1))
+18 SET DGEGT("SUBGRP")=$$CONVERT^DGENUPL1($PIECE(SEG(7),$EXTRACT(HLECH)))
+19 SET DGEGT("TYPE")=$$CONVERT^DGENUPL1(+SEG(3))
+20 SET DGEGT("FEDDATE")=$$CONVERT^DGENUPL1(SEG(6),"DATE",.ERROR)
+21 IF ERROR
Begin DoDot:1
+22 DO ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 6",.ERRCOUNT,.DGMFI,.DGMFE)
QUIT
End DoDot:1
QUIT
+23 SET DGEGT("REMARKS")=$$CONVERT^DGENUPL1(SEG(4))
+24 ;
+25 ; convert '@' to null values in DGEGT() array
+26 SET SUB=""
+27 FOR
SET SUB=$ORDER(DGEGT(SUB))
if (SUB="")
QUIT
IF ($GET(DGEGT(SUB))="@")
SET DGEGT(SUB)=""
+28 ;
+29 QUIT
+30 ;
UPLDEGT(DGEGT,ERROR) ;
+1 ; Description: This procedure is used to upload the Enrollment Group
+2 ; Threshold (EGT) received from the HEC. The validation/consitency
+3 ; checks should already have been completed.
+4 ;
+5 ; Inputs:
+6 ; DGEGT - array containing the EGT record (pass by reference)
+7 ;
+8 ; Outputs: None
+9 ;
+10 ; Store EGT from HEC and quit.
+11 ;
+12 IF $$STORE^DGENEGT(.DGEGT,,1)
+13 ;
+14 ; Old code removed per DG*5.3*451
+15 ;;
+16 ;N CURIEN
+17 ;;
+18 ;; is there a current EGT setting?
+19 ;S CURIEN=$$FINDCUR^DGENEGT()
+20 ;;
+21 ;; if there is no current EGT, store EGT from HEC and quit
+22 ;I 'CURIEN D Q
+23 ;.I $$STORE^DGENEGT(.DGEGT,,1)
+24 ;;
+25 ;; if there is a current EGT, delete current, and store EGT from HEC
+26 ;I $$DELETE^DGENEGT(CURIEN) D
+27 ;.I $$STORE^DGENEGT(.DGEGT,,1)
+28 ;
+29 QUIT