source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCNRMFK.m@ 1006

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1IBCNRMFK ;DAOU/DMK - Send HL7 e-Pharmacy MFK Message ;23-OCT-2003
2 ;;2.0;INTEGRATED BILLING;**251**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; Description
6 ;
7 ; Send HL7 e-Pharmacy MFK Message
8 ; (Application Acknowledgement)
9 ;
10 ; Required segments listed in order
11 ; MSH (Message Header Segment)
12 ; MSA (Message Acknowledgement Segment)
13 ; MFI (Master File Identifier Segment)
14 ; MFA (Master File Acknowledgement)
15 ;
16 ; Called by IBCNEHLI if all of the following are true:
17 ; * File # (MFI Segment) = 365.12, 366.01, 366.02, or 366.03
18 ; * Primary Key Value (MFE Segment) does not contain "IIV"
19 ; * Segment ID (every segment) = MFE, ZCM, ZP0, ZPB, ZPL, ZPT, or ZRX
20 ;
21 ; Entry point
22 ;
231000 ; Control MFK Message processing
24 ;
25 ; Possible future use
26 ; Quit if no error to report
27 ;I '$D(DATAMFK("ERROR")) Q
28 ;
29 N ERROR,MESSAGE
30 K HLA("HLA")
31 ;
32 D MSA
33 D MFI
34 D MFA
35 ;
36 D GENACK^HLMA1(HL("EID"),HLMTIENS,HL("EIDS"),"LM",1,.ERROR)
37 ;
38 ; Error?
39 I $D(ERROR) D ERROR
40 ;
41 K HLA("HLA")
42 Q
43 ;
44ERROR ; Process error
45 S MESSAGE(1)="Outgoing HL7 IIV Application Acknowledgment Message error"
46 S MESSAGE(2)=ERROR
47 D MESSAGE
48 Q
49 ;
50MESSAGE ; Send message
51 Q
52 ;
53MFA ; Create MFA Segment
54 N SEGMENT
55 ;
56 ; Segment ID
57 S $P(SEGMENT,HLFS,1)="MFA"
58 ;
59 ; MFE-1 Record-Level Event Code (from MFN Message)
60 ; MAC = Activate
61 ; MAD = Add
62 ; MDC = Deactivate
63 ; MDL = Delete
64 ; MUP = Update
65 S $P(SEGMENT,HLFS,2)=DATAMFK("MFE-1")
66 ;
67 ; Record-Level Error Return (relative to MFN Message)
68 ; Piece 1 = ID
69 ; S = Saved
70 ; P = Previous (not saved)
71 ; U = Undefined (not saved)
72 ; and
73 ; Piece 2 = Error Code (optional - if error)
74 ; Format = "V"NNN where N = number (e.g. V128)
75 I '$D(DATAMFK("ERROR")) S $P(SEGMENT,HLFS,5)="S"
76 I $D(DATAMFK("ERROR")) S $P(SEGMENT,HLFS,5)=$S(DATAMFK("IEN")=-1:"U",1:"P")_$E(HLECH,1)_DATAMFK("ERROR")
77 ;
78 ; MFE-4 Primary Key Value (from MFN Message)
79 S $P(SEGMENT,HLFS,6)=DATAMFK("MFE-4")
80 ;
81 ; MFE-5 Primary Key Value Type (from MFN Message)
82 S $P(SEGMENT,HLFS,7)=DATAMFK("MFE-5")
83 ;
84 S HLA("HLA",3)=SEGMENT
85 Q
86 ;
87MFI ; Create MFI Segment
88 N SEGMENT
89 ;
90 ; Segment ID
91 S $P(SEGMENT,HLFS,1)="MFI"
92 ;
93 ; MFI-1 Master File Identifier (from MFN Message)
94 S $P(SEGMENT,HLFS,2)=DATAMFK("MFI-1")
95 ;
96 ; MFI-3 File-Level Event Code (from MFN Message)
97 S $P(SEGMENT,HLFS,4)=DATAMFK("MFI-3")
98 ;
99 ; Response-Level Code
100 ; NE = Never (send response Application Acknowledgement Message)
101 S $P(SEGMENT,HLFS,7)="NE"
102 ;
103 S HLA("HLA",2)=SEGMENT
104 Q
105 ;
106MSA ; Create MSA Segment
107 N SEGMENT
108 ;
109 ; Segment ID
110 S $P(SEGMENT,HLFS,1)="MSA"
111 ;
112 ; Acknowledgment Code (relative to MFN Message)
113 ; AA = application acknowledgement accept
114 ; AR = application acknowledgement reject
115 S $P(SEGMENT,HLFS,2)=$S($D(DATAMFK("ERROR")):"AR",1:"AA")
116 ;
117 ; MSH-10 Message Control ID (from MFN Message)
118 S $P(SEGMENT,HLFS,3)=HL("MID")
119 ;
120 S HLA("HLA",1)=SEGMENT
121 Q
Note: See TracBrowser for help on using the repository browser.