Schedule a demo
Segment

Master file identification

Identifies which master file is being updated in an MFN (Master File Notification) message or queried in an MFQ message. It carries the master file identifier (such as CDM for charge master, LOC for locations, or PRA for practitioners), the application responsible for the file, a file-level event code, and the effective date. It is the first segment after MSH in all master file notification transactions.

6fields
3required
v2.9HL7 version
mfi.py
from zato.hl7v2.v2_9 import MFI
from zato.hl7v2.v2_9 import CWE, HD

mfi = MFI()
mfi.master_file_identifier = CWE(
    identifier='LOC',
    text='Wellness sites',
    name_of_coding_system='HL70175',
)
mfi.master_file_application_identifier = HD(
        namespace_id='WELLAPP',
        universal_id='Wellness Hub',
        universal_id_type='DNS',
    )
mfi.file_level_event_code = 'UPD'
mfi.response_level_code = 'NE'

Build MFI segments in Python

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

1

Wellness location master update

File-level update with HD source, entered and effective times, and NE response level

from zato.hl7v2.v2_9 import MFI
from zato.hl7v2.v2_9 import CWE, HD

mfi = MFI()
mfi.master_file_identifier = CWE(
    identifier='LOC',
    text='Wellness sites',
    name_of_coding_system='HL70175',
)
mfi.master_file_application_identifier = HD(
        namespace_id='WELLAPP',
        universal_id='Wellness Hub',
        universal_id_type='DNS',
    )
mfi.file_level_event_code = 'UPD'
mfi.entered_date_time = '20260405120000'
mfi.effective_date_time = '20260406120000'
mfi.response_level_code = 'NE'
2

Nutrition catalog refresh

Replace event on the meal-plan master with application HD and timestamps omitted

from zato.hl7v2.v2_9 import MFI
from zato.hl7v2.v2_9 import CWE, HD

mfi = MFI()
mfi.master_file_identifier = CWE(
    identifier='NUTCAT',
    text='Meal plan catalog',
    name_of_coding_system='HL70175',
)
mfi.master_file_application_identifier = HD(
        namespace_id='NUTRI',
        universal_id='Nutrition App',
        universal_id_type='DNS',
    )
mfi.file_level_event_code = 'REP'
mfi.response_level_code = 'NE'
3

Fitness site list sync

Audit-style file event with AL response level for detailed per-record replies

from zato.hl7v2.v2_9 import MFI
from zato.hl7v2.v2_9 import CWE

mfi = MFI()
mfi.master_file_identifier = CWE(
    identifier='FITLOC',
    text='Fitness studios',
    name_of_coding_system='HL70175',
)
mfi.file_level_event_code = 'AUD'
mfi.entered_date_time = '20260405103000'
mfi.response_level_code = 'AL'

Learn by building

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

Frequently asked questions

MFI states which master file and file-level event apply. Following MFE rows carry record changes, and MFA rows confirm each record outcome so wellness catalog feeds stay auditable end to end.

Use HD when the sending product or namespace should be named explicitly, for example a nutrition app key paired with DNS-style universal ids.

Use CWE with table HL70175 so receivers recognize the file topic:

from zato.hl7v2.v2_9 import MFI
from zato.hl7v2.v2_9 import CWE

mfi = MFI()
mfi.master_file_identifier = CWE(
    identifier='LOC',
    text='Wellness sites',
    name_of_coding_system='HL70175',
)

Field 6 (HL70179) tells the receiver how much acknowledgment detail to emit for the file, for example NE for a compact summary or AL when each MFE row expects an MFA reply.

entered_date_time captures when the sender registered the file event, while effective_date_time is when downstream systems should treat rows as active, such as a future catalog go-live for screening services.

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.

MFI field reference

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

#Python nameDatatypeUsageRepeatableTable
1master_file_identifierCWERequiredNoHL70175
2master_file_application_identifierHDOptionalYesHL70361
3file_level_event_codeIDRequiredNoHL70178
4entered_date_timeDTMOptionalNo-
5effective_date_timeDTMOptionalNo-
6response_level_codeIDRequiredNoHL70179

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python