source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGENEGT3.m@ 1270

Last change on this file since 1270 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1DGENEGT3 ;ALB/KCL/RGL - PROCESS INCOMING MFN HL7 MSGS; 04-MAY-1999 ; 7/23/03 4:49pm
2 ;;5.3;Registration;**232,306,417,451**;Aug 13, 1993
3 ;
4 ;
5MFI ; Description: This procedure parses the MFI segment type.
6 ;
7 ; Input:
8 ; SEG - array containing the HL7 segment
9 ; MSGID - message control id of HL7 msg in the MSH segment
10 ;
11 ; Output:
12 ; DGMFI - array containing needed fields of MFI segment
13 ; ERROR - flag set if an error is encountered during parse
14 ;
15 S DGMFI("MASTERID")=$$CONVERT^DGENUPL1(SEG(1))
16 S DGMFI("EVENT")=$$CONVERT^DGENUPL1(SEG(3))
17 ;
18 Q
19 ;
20 ;
21MFE ; Description: This procedure parses the MFE segment.
22 ;
23 ; Input:
24 ; SEG - array containing the HL7 segment
25 ; MSGID - message control id of HL7 msg in the MSH segment
26 ;
27 ; Output:
28 ; DGMFE - array containing needed fields of MFE segment
29 ; ERROR - flag set if an error is encountered during parse
30 ;
31 S DGMFE("RECEVNT")=$$CONVERT^DGENUPL1(SEG(1))
32 S DGMFE("CNTRLNUM")=$$CONVERT^DGENUPL1(SEG(2))
33 S DGEGT("PRIMKEY")=$$CONVERT^DGENUPL1(SEG(4))
34 ;
35 Q
36 ;
37 ;
38ZEG ; Description: This procedure parses the ZEG segment.
39 ;
40 ; Input:
41 ; SEG - array containing the HL7 segment
42 ; MSGID - message control id of HL7 msg in the MSH segment
43 ; DGMFE - array containing fields of MFE segment needed for MFK
44 ; DGMFI - array containing fields of MFI segment needed for MFK
45 ;
46 ; Output:
47 ; DGEGT - array containing the EGT record in FileMan format
48 ; ERROR - flag set if an error is encountered during parse
49 ;
50 N SUB
51 ;
52 S DGEGT("EFFDATE")=$$CONVERT^DGENUPL1(SEG(2),"DATE",.ERROR)
53 I ERROR D Q
54 .D ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 2",.ERRCOUNT,.DGMFI,.DGMFE) Q
55 S DGEGT("PRIORITY")=$$CONVERT^DGENUPL1(+SEG(1))
56 S DGEGT("SUBGRP")=$$CONVERT^DGENUPL1($P(SEG(7),$E(HLECH)))
57 S DGEGT("TYPE")=$$CONVERT^DGENUPL1(+SEG(3))
58 S DGEGT("FEDDATE")=$$CONVERT^DGENUPL1(SEG(6),"DATE",.ERROR)
59 I ERROR D Q
60 .D ADDERROR^DGENEGT2(MSGID,"BAD VALUE, ZEG SEGMENT SEQ 6",.ERRCOUNT,.DGMFI,.DGMFE) Q
61 S DGEGT("REMARKS")=$$CONVERT^DGENUPL1(SEG(4))
62 ;
63 ; convert '@' to null values in DGEGT() array
64 S SUB=""
65 F S SUB=$O(DGEGT(SUB)) Q:(SUB="") I ($G(DGEGT(SUB))="@") S DGEGT(SUB)=""
66 ;
67 Q
68 ;
69UPLDEGT(DGEGT,ERROR) ;
70 ; Description: This procedure is used to upload the Enrollment Group
71 ; Threshold (EGT) received from the HEC. The validation/consitency
72 ; checks should already have been completed.
73 ;
74 ; Inputs:
75 ; DGEGT - array containing the EGT record (pass by reference)
76 ;
77 ; Outputs: None
78 ;
79 ; Store EGT from HEC and quit.
80 ;
81 I $$STORE^DGENEGT(.DGEGT,,1)
82 ;
83 ; Old code removed per DG*5.3*451
84 ;;
85 ;N CURIEN
86 ;;
87 ;; is there a current EGT setting?
88 ;S CURIEN=$$FINDCUR^DGENEGT()
89 ;;
90 ;; if there is no current EGT, store EGT from HEC and quit
91 ;I 'CURIEN D Q
92 ;.I $$STORE^DGENEGT(.DGEGT,,1)
93 ;;
94 ;; if there is a current EGT, delete current, and store EGT from HEC
95 ;I $$DELETE^DGENEGT(CURIEN) D
96 ;.I $$STORE^DGENEGT(.DGEGT,,1)
97 ;
98 Q
Note: See TracBrowser for help on using the repository browser.