Returned in the MFK (Master File Acknowledgment) message to confirm the processing status of each individual master file entry. It carries the record-level event code, master file identifier, primary key value, and the status of the update (success or error). It enables the sending system to confirm which specific entries were accepted or rejected during master file synchronization.
from zato.hl7v2.v2_9 import MFA
from zato.hl7v2.v2_9 import CWE, CX
mfa = MFA()
mfa.record_level_event_code = 'MAD'
error_return = CWE(identifier='STO', text='Record stored', name_of_coding_system='HL70181')
mfa.mfn_record_level_error_return = error_return
key = CX(id_number='SRV001', assigning_authority='WELL')
mfa.primary_key_value_mfa = key
mfa.primary_key_value_type_mfa = 'CX'How to construct and work with real-world MFA segments.
MAD acknowledgment with STO outcome CWE and matching CX primary key
from zato.hl7v2.v2_9 import MFA
from zato.hl7v2.v2_9 import CWE, CX
mfa = MFA()
mfa.record_level_event_code = 'MAD'
mfa.mfn_control_id = 'MFN-CTRL-88'
mfa.event_completion_date_time = '20260405123000'
mfa.mfn_record_level_error_return = CWE(
identifier='STO',
text='Record stored',
name_of_coding_system='HL70181',
)
mfa.primary_key_value_mfa = [
CX(
id_number='SRV001',
assigning_authority='WELL',
),
]
mfa.primary_key_value_type_mfa = ['CX']MUP line with minimal fields and positive outcome code
from zato.hl7v2.v2_9 import MFA
from zato.hl7v2.v2_9 import CWE, CX
mfa = MFA()
mfa.record_level_event_code = 'MUP'
mfa.mfn_record_level_error_return = CWE(
identifier='OK',
text='Applied',
name_of_coding_system='HL70181',
)
mfa.primary_key_value_mfa = [
CX(
id_number='MEAL88',
assigning_authority='MENU',
),
]
mfa.primary_key_value_type_mfa = ['CWE']Parallel primary key repetitions with matching type list
from zato.hl7v2.v2_9 import MFA
from zato.hl7v2.v2_9 import CWE, CX
mfa = MFA()
mfa.record_level_event_code = 'MAD'
mfa.mfn_control_id = 'FIT-CLASS-9'
mfa.event_completion_date_time = '20260405141000'
mfa.mfn_record_level_error_return = CWE(
identifier='STO',
text='Record stored',
name_of_coding_system='HL70181',
)
mfa.primary_key_value_mfa = [
CX(
id_number='CLS01',
assigning_authority='FIT',
),
CX(
id_number='CLS02',
assigning_authority='FIT',
),
]
mfa.primary_key_value_type_mfa = ['CX', 'CX']Step-by-step guides for working with HL7 v2 in Zato.
record_level_event_code and mfn_control_id usually echo the MFE values, while primary_key_value_mfa repeats the same keys so acknowledgments stay joinable for wellness catalog pipelines.
Despite the HL7 field name, the CWE carries the per-record processing outcome from HL70181. Partners map identifiers such as STO or OK to mean the row was accepted into the charge or location master.
Assign a CWE with text that matches your interface contract:
from zato.hl7v2.v2_9 import MFA
from zato.hl7v2.v2_9 import CWE
mfa = MFA()
mfa.mfn_record_level_error_return = CWE(
identifier='STO',
text='Record stored',
name_of_coding_system='HL70181',
)Populate it when the receiver knows when processing finished; leave it blank for fire-and-forget feeds where only the outcome CWE matters.
Some masters acknowledge several identifiers at once. Repeating keys with the same-index type list mirrors the MFE pattern for fitness or nutrition bundles.
Zato connects to any system that speaks HL7v2 over MLLP or FHIR over REST. This includes Epic, Cerner, Meditech, Allscripts, and other EHR platforms.
Yes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically.
Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. Standard segments and datatypes are available as typed Python classes.
Yes. Zato handles both HL7v2 and FHIR natively, so you can parse v2 messages and build FHIR resources with IG-specific extensions in the same service. Typed Python classes are available for both protocols, including extensions from US Core, UK Core, Da Vinci, and other Implementation Guides.
Complete list of fields in the MFA segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | record_level_event_code | ID | Required | No | HL70180 |
| 2 | mfn_control_id | ST | Optional | No | - |
| 3 | event_completion_date_time | DTM | Optional | No | - |
| 4 | mfn_record_level_error_return | CWE | Required | No | HL70181 |
| 5 | primary_key_value_mfa | Varies | Required | Yes | HL70607 |
| 6 | primary_key_value_type_mfa | ID | Required | Yes | HL70355 |
Get started with Zato and connect your systems in minutes.