Schedule a demo
Segment

Master file acknowledgment

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.

6fields
4required
v2.9HL7 version
mfa.py
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'

Build MFA segments in Python

How to construct and work with real-world MFA segments.

1

Catalog row stored

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']
2

Meal plan key accepted

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']
3

Dual class keys confirmed

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']

Learn by building

Step-by-step guides for working with HL7 v2 in Zato.

Frequently asked questions

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.

MFA field reference

Complete list of fields in the MFA segment, HL7 v2.9.

#Python nameDatatypeUsageRepeatableTable
1record_level_event_codeIDRequiredNoHL70180
2mfn_control_idSTOptionalNo-
3event_completion_date_timeDTMOptionalNo-
4mfn_record_level_error_returnCWERequiredNoHL70181
5primary_key_value_mfaVariesRequiredYesHL70607
6primary_key_value_type_mfaIDRequiredYesHL70355

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python