1 | IBCNEHLM ;DAOU/ALA - HL7 Registration MFN Message ;10-JUN-2002
|
---|
2 | ;;2.0;INTEGRATED BILLING;**184,251,300**;21-MAR-94
|
---|
3 | ;;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | ;**Program Description**
|
---|
6 | ; This program will process the outgoing registration MFN message
|
---|
7 | ;
|
---|
8 | ; Variables
|
---|
9 | ; MCT = Lines of MailMan message counter
|
---|
10 | ; QFL = Quit flag
|
---|
11 | ; HL* = HL7 package specific variables
|
---|
12 | ; TAXID = Tax ID
|
---|
13 | ; CNTCPH = Contact Phone
|
---|
14 | ; CNTCEM = Contact Email
|
---|
15 | ; FRSH = Freshness Days
|
---|
16 | ; MGRP = Mailgroup to email messages to
|
---|
17 | ; INACT = Inactive Insurance Flag
|
---|
18 | ; CNTC = Contact IEN
|
---|
19 | ; APP = Application
|
---|
20 | ; EVENT = HL7 Event
|
---|
21 | ; CODE = Values sent in the MFN message
|
---|
22 | ; IPP = IP Port
|
---|
23 | ; IPA = IP Address
|
---|
24 | ; RESP = Response Code
|
---|
25 | ; IHLP = Interface HL7 Processing Type
|
---|
26 | ; IHLT = Interface HL7 Batch Start Time
|
---|
27 | ; IHLS = Interface HL7 Batch Stop Time
|
---|
28 | ; IVER = Interface Version
|
---|
29 | ;
|
---|
30 | REG ; Registration message for when a site installs
|
---|
31 | NEW TAXID,CNTCPH,CNTCEM,CNTCNM,IBCNE,FRSH,MGRP,INACT,IHLP,MFE,HLSAN
|
---|
32 | NEW IHLT,CNTC,APP,EVENT,CODE,EDT,MFN,HL,HLFS,HLECH,MCT,HLPROD,HLX,ID
|
---|
33 | NEW HLEID,IPP,IPA,IBCNEDAT,HLCS,HLINST,HLN,RESP,HLHDR
|
---|
34 | NEW HLTYPE,HLQ,HLRESLT,IHLS,HLCDOM,HLCINS,HLCSTCP,HLIP,%I,ZMID
|
---|
35 | NEW VMFE,IVER
|
---|
36 | K ^TMP("HLS",$J) S MCT=0,QFL=0
|
---|
37 | ;
|
---|
38 | ; Get data from IB Parameters File
|
---|
39 | S TAXID=$TR($P($G(^IBE(350.9,1,1)),U,5),"-",""),CNTCPH="",CNTCEM="",CNTCNM=""
|
---|
40 | S IBCNE=$G(^IBE(350.9,1,51))
|
---|
41 | S FRSH=$P(IBCNE,U,1)
|
---|
42 | S MGRP=$$MGRP^IBCNEUT5()
|
---|
43 | S INACT=$E($$GET1^DIQ(350.9,"1,",51.08,"E"))
|
---|
44 | S IHLP=$P(IBCNE,U,13),IHLT=$P(IBCNE,U,14),CNTC=$P(IBCNE,U,16)
|
---|
45 | S IHLS=$P(IBCNE,U,19)
|
---|
46 | S IVER="3"
|
---|
47 | ;
|
---|
48 | I IHLP="I" S (IHLT,IHLS)=""
|
---|
49 | ;
|
---|
50 | ; Get contact specific information
|
---|
51 | I CNTC'="" D
|
---|
52 | . S CNTCNM=$P($G(^VA(200,CNTC,0)),U,1)
|
---|
53 | . S CNTCPH=$P($G(^VA(200,CNTC,.13)),U,2)
|
---|
54 | . S CNTCEM=$P($G(^VA(200,CNTC,.15)),U,1)
|
---|
55 | ;
|
---|
56 | ; Email if any missing data
|
---|
57 | I CNTC="" S MCT=MCT+1,MSG(MCT)="The Contact Person is not defined in the IIV Site Parameters. ",QFL=1
|
---|
58 | I CNTC'="",CNTCPH="" S MCT=MCT+1,MSG(MCT)="The office phone number of the IIV Contact Person is not defined (File 200, Field .132). ",QFL=1
|
---|
59 | I CNTC'="",CNTCEM="" S MCT=MCT+1,MSG(MCT)="The email address of the IIV Contact Person is not defined (File 200, Field .151). ",QFL=1
|
---|
60 | ;
|
---|
61 | I IHLP="B",IHLT=""!(IHLS="") D S QFL=1
|
---|
62 | . S MCT=MCT+1,MSG(MCT)="The ""HL7 Response Processing Method"" selected is Batch but the HL7 Batch "
|
---|
63 | . I IHLT="",IHLS="" S MSG(MCT)=MSG(MCT)_"Start and End Times are blank. " Q
|
---|
64 | . S MSG(MCT)=MSG(MCT)_$S(IHLT="":"Start",1:"End")_" Time is blank. "
|
---|
65 | ;
|
---|
66 | I FRSH=""!(INACT="")!(IHLP="") D
|
---|
67 | . S MCT=MCT+1,MSG(MCT)="The following IIV Site Parameters are not defined: "
|
---|
68 | . I FRSH="" S MCT=MCT+1,MSG(MCT)="""Days between electronic reverification checks"" is blank. "
|
---|
69 | . I INACT="" S MCT=MCT+1,MSG(MCT)="""Look at a patient's inactive insurance?"" is blank. "
|
---|
70 | . I IHLP="" S MCT=MCT+1,MSG(MCT)="""HL7 Response Processing Method"" is blank. "
|
---|
71 | . Q
|
---|
72 | ;
|
---|
73 | I $O(MSG(""))'="" D MLMN
|
---|
74 | I QFL=1 Q
|
---|
75 | ;
|
---|
76 | HL ; When a site installs, the enrollment should be an
|
---|
77 | ; "MUP" (update) record.
|
---|
78 | N VZRR
|
---|
79 | S MFE(1)="MUP"
|
---|
80 | ;
|
---|
81 | ; Initialize the HL7
|
---|
82 | D INIT^HLFNC2("IBCNE IIV REGISTER",.HL)
|
---|
83 | S HLFS=HL("FS"),HLECH=HL("ECH"),HL("SAF")=$P($$SITE^VASITE,U,2,3)
|
---|
84 | ; S HLEID=$$HLP^IBCNEHLU("IBCNE IIV REGISTER")
|
---|
85 | ;
|
---|
86 | ; Set the MFI segment
|
---|
87 | S ID="Facility Table",APP="",EVENT="UPD",RESP="NE"
|
---|
88 | S ^TMP("HLS",$J,1)=$$MFI^VAFHLMFI(ID,APP,EVENT,,,RESP)
|
---|
89 | ;
|
---|
90 | ; Set the MFE segment
|
---|
91 | S EVENT=MFE(1),MFN="",EDT=$$DT^XLFDT()
|
---|
92 | S CODE=$P($$SITE^VASITE,U,3)_$E(HLECH)
|
---|
93 | S VMFE=$$MFE^VAFHLMFE(EVENT,MFN,EDT,CODE)
|
---|
94 | S $P(VMFE,U,11)=$S($P(VMFE,U,11)="YES":"Y",1:"N")
|
---|
95 | S ^TMP("HLS",$J,2)=VMFE_HLFS_"CE"
|
---|
96 | ;
|
---|
97 | ; Set the ZRR segment
|
---|
98 | S VZRR="ZRR"_HLFS_"1"_HLFS_TAXID_HLFS_HLFS_$$HLNAME^HLFNC(CNTCNM,$E(HLECH))_"^C"_HLFS
|
---|
99 | S VZRR=VZRR_CNTCPH_$E(HLECH)_$E(HLECH)_$E(HLECH)_CNTCEM_HLFS_FRSH_HLFS_IHLP_HLFS_IHLT_$E(HLECH)_IHLS_HLFS_INACT_HLFS_IVER
|
---|
100 | S ^TMP("HLS",$J,3)=VZRR
|
---|
101 | ;
|
---|
102 | D GENERATE^HLMA("IBCNE IIV REGISTER","GM",1,.HLRESLT,"")
|
---|
103 | I $P(HLRESLT,U,2)]"" S HLRESLT="Error - "_$P(HLRESLT,U,2,99) D Q
|
---|
104 | . S MSG(1)="HL7 IIV Registration Message not created."
|
---|
105 | . S MSG(2)=HLRESLT
|
---|
106 | . D MLMN
|
---|
107 | K ^TMP("HLS",$J)
|
---|
108 | Q
|
---|
109 | ;
|
---|
110 | MLMN ; MailMan Message
|
---|
111 | D TXT^IBCNEUT7("MSG")
|
---|
112 | S XMSUB="IIV Registration Failure"
|
---|
113 | D MSG^IBCNEUT5(MGRP,XMSUB,"MSG(")
|
---|
114 | K XMSUB,XMY,MSG,XMZ,XMDUZ
|
---|
115 | Q
|
---|