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

DGENEGT3.m

Go to the documentation of this file.
  1. 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,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;
  1. MFI ; Description: This procedure parses the MFI segment type.
  1. ;
  1. ; Input:
  1. ; SEG - array containing the HL7 segment
  1. ; MSGID - message control id of HL7 msg in the MSH segment
  1. ;
  1. ; Output:
  1. ; DGMFI - array containing needed fields of MFI segment
  1. ; ERROR - flag set if an error is encountered during parse
  1. ;
  1. S DGMFI("MASTERID")=$$CONVERT^DGENUPL1(SEG(1))
  1. S DGMFI("EVENT")=$$CONVERT^DGENUPL1(SEG(3))
  1. ;
  1. Q
  1. ;
  1. ;
  1. MFE ; Description: This procedure parses the MFE segment.
  1. ;
  1. ; Input:
  1. ; SEG - array containing the HL7 segment
  1. ; MSGID - message control id of HL7 msg in the MSH segment
  1. ;
  1. ; Output:
  1. ; DGMFE - array containing needed fields of MFE segment
  1. ; ERROR - flag set if an error is encountered during parse
  1. ;
  1. S DGMFE("RECEVNT")=$$CONVERT^DGENUPL1(SEG(1))
  1. S DGMFE("CNTRLNUM")=$$CONVERT^DGENUPL1(SEG(2))
  1. S DGEGT("PRIMKEY")=$$CONVERT^DGENUPL1(SEG(4))
  1. ;
  1. Q
  1. ;
  1. ;
  1. ZEG ; Description: This procedure parses the ZEG segment.
  1. ;
  1. ; Input:
  1. ; SEG - array containing the HL7 segment
  1. ; MSGID - message control id of HL7 msg in the MSH segment
  1. ; DGMFE - array containing fields of MFE segment needed for MFK
  1. ; DGMFI - array containing fields of MFI segment needed for MFK
  1. ;
  1. ; Output:
  1. ; DGEGT - array containing the EGT record in FileMan format
  1. ; ERROR - flag set if an error is encountered during parse
  1. ;
  1. N SUB
  1. ;
  1. S DGEGT("EFFDATE")=$$CONVERT^DGENUPL1(SEG(2),"DATE",.ERROR)
  1. I ERROR D Q
  1. .D ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 2",.ERRCOUNT,.DGMFI,.DGMFE) Q
  1. S DGEGT("PRIORITY")=$$CONVERT^DGENUPL1(+SEG(1))
  1. S DGEGT("SUBGRP")=$$CONVERT^DGENUPL1($P(SEG(7),$E(HLECH)))
  1. S DGEGT("TYPE")=$$CONVERT^DGENUPL1(+SEG(3))
  1. S DGEGT("FEDDATE")=$$CONVERT^DGENUPL1(SEG(6),"DATE",.ERROR)
  1. I ERROR D Q
  1. .D ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 6",.ERRCOUNT,.DGMFI,.DGMFE) Q
  1. S DGEGT("REMARKS")=$$CONVERT^DGENUPL1(SEG(4))
  1. ;
  1. ; convert '@' to null values in DGEGT() array
  1. S SUB=""
  1. F S SUB=$O(DGEGT(SUB)) Q:(SUB="") I ($G(DGEGT(SUB))="@") S DGEGT(SUB)=""
  1. ;
  1. Q
  1. ;
  1. UPLDEGT(DGEGT,ERROR) ;
  1. ; Description: This procedure is used to upload the Enrollment Group
  1. ; Threshold (EGT) received from the HEC. The validation/consitency
  1. ; checks should already have been completed.
  1. ;
  1. ; Inputs:
  1. ; DGEGT - array containing the EGT record (pass by reference)
  1. ;
  1. ; Outputs: None
  1. ;
  1. ; Store EGT from HEC and quit.
  1. ;
  1. I $$STORE^DGENEGT(.DGEGT,,1)
  1. ;
  1. ; Old code removed per DG*5.3*451
  1. ;;
  1. ;N CURIEN
  1. ;;
  1. ;; is there a current EGT setting?
  1. ;S CURIEN=$$FINDCUR^DGENEGT()
  1. ;;
  1. ;; if there is no current EGT, store EGT from HEC and quit
  1. ;I 'CURIEN D Q
  1. ;.I $$STORE^DGENEGT(.DGEGT,,1)
  1. ;;
  1. ;; if there is a current EGT, delete current, and store EGT from HEC
  1. ;I $$DELETE^DGENEGT(CURIEN) D
  1. ;.I $$STORE^DGENEGT(.DGEGT,,1)
  1. ;
  1. Q