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.
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'How to construct and work with real-world MFI segments.
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'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'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'Step-by-step guides for working with HL7 v2 in Zato.
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.
Complete list of fields in the MFI segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | master_file_identifier | CWE | Required | No | HL70175 |
| 2 | master_file_application_identifier | HD | Optional | Yes | HL70361 |
| 3 | file_level_event_code | ID | Required | No | HL70178 |
| 4 | entered_date_time | DTM | Optional | No | - |
| 5 | effective_date_time | DTM | Optional | No | - |
| 6 | response_level_code | ID | Required | No | HL70179 |
Get started with Zato and connect your systems in minutes.