Schedule a demo
Segment

Payer Master File

Defines the requirements and attributes of a health insurance plan within a payer master file. Each instance identifies the plan, its effective and expiration dates, and a set of flags indicating which data elements (patient name, address, diagnosis, signature, etc.) are required for claims submission. It appears in MFN/MFR master file messages and is used by registration and billing systems to enforce payer-specific data collection rules.

24fields
2required
v2.9HL7 version
pm1.py
from zato.hl7v2 import PM1

pm1 = PM1()
pm1.plan_effective_date = '20260101'
pm1.diagnosis_required = 'Y'
pm1.service_required = 'Y'

Build PM1 segments in Python

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

1

Plan requirements setup

Payer master entry defining required data elements for a commercial health plan

from zato.hl7v2.v2_9 import PM1
from zato.hl7v2.v2_9 import CWE

pm1 = PM1()
pm1.health_plan_id = CWE(
    identifier='BCBS001',
    text='Blue Cross',
    name_of_coding_system='HL70072'
)
pm1.group_number = 'GRP-5000'
pm1.plan_effective_date = '20240101'
pm1.plan_expiration_date = '20241231'
pm1.patient_dob_required = 'Y'
pm1.patient_gender_required = 'Y'
pm1.patient_relationship_required = 'Y'
pm1.patient_signature_required = 'Y'
pm1.diagnosis_required = 'Y'
pm1.service_required = 'Y'
pm1.patient_name_required = 'Y'
pm1.patient_address_required = 'Y'
pm1.subscribers_name_required = 'Y'
pm1.workmans_comp_indicator = 'N'
pm1.bill_type_required = 'Y'
pm1.commercial_carrier_name_and_address_required = 'Y'
pm1.policy_number_pattern = 'POL-[0-9]{10}'
pm1.group_number_pattern = 'GRP-[0-9]{4}'
2

Minimal plan entry

Payer record with only core identifiers and date range for a Medicaid plan

from zato.hl7v2.v2_9 import PM1
from zato.hl7v2.v2_9 import CWE

pm1 = PM1()
pm1.health_plan_id = CWE(
    identifier='MCD001',
    text='Medicaid',
    name_of_coding_system='HL70072'
)
pm1.group_number = 'MCD-GRP-01'
pm1.plan_effective_date = '20240601'
pm1.plan_expiration_date = '20250531'
pm1.diagnosis_required = 'Y'
pm1.service_required = 'Y'
3

Workers compensation plan

Payer master entry for a workers compensation plan with strict data requirements

from zato.hl7v2.v2_9 import PM1
from zato.hl7v2.v2_9 import CWE

pm1 = PM1()
pm1.health_plan_id = CWE(
    identifier='WC001',
    text='Workers Comp',
    name_of_coding_system='HL70072'
)
pm1.group_number = 'WC-GRP-100'
pm1.plan_effective_date = '20240301'
pm1.plan_expiration_date = '20250228'
pm1.patient_dob_required = 'Y'
pm1.patient_gender_required = 'Y'
pm1.patient_relationship_required = 'Y'
pm1.patient_signature_required = 'Y'
pm1.diagnosis_required = 'Y'
pm1.service_required = 'Y'
pm1.patient_name_required = 'Y'
pm1.patient_address_required = 'Y'
pm1.subscribers_name_required = 'Y'
pm1.workmans_comp_indicator = 'Y'
pm1.bill_type_required = 'Y'
pm1.commercial_carrier_name_and_address_required = 'Y'
pm1.policy_number_pattern = 'WC-[A-Z]{2}[0-9]{8}'
pm1.group_number_pattern = 'WCG-[0-9]{6}'

Learn by building

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

Frequently asked questions

PM1 defines insurance plan attributes and data collection requirements in payer master file messages. It specifies which patient and claims data elements a payer requires for processing, allowing registration systems to enforce payer-specific validation rules.

The health_plan_id field uses the CWE datatype with HL7 table 0072:

from zato.hl7v2.v2_9 import PM1, CWE

pm1 = PM1()
pm1.health_plan_id = CWE(
    identifier='BCBS001',
    text='Blue Cross',
    name_of_coding_system='HL70072'
)

Use plan_effective_date and plan_expiration_date with date strings in YYYYMMDD format:

from zato.hl7v2.v2_9 import PM1

pm1 = PM1()
pm1.plan_effective_date = '20240101'
pm1.plan_expiration_date = '20241231'

Each requirement flag accepts Y (yes) or N (no) from HL7 table 0136:

from zato.hl7v2.v2_9 import PM1

pm1 = PM1()
pm1.patient_dob_required = 'Y'
pm1.patient_gender_required = 'Y'
pm1.diagnosis_required = 'Y'
pm1.service_required = 'Y'
pm1.patient_name_required = 'Y'
pm1.patient_signature_required = 'N'

Use policy_number_pattern and group_number_pattern to define regex validation patterns:

from zato.hl7v2.v2_9 import PM1

pm1 = PM1()
pm1.policy_number_pattern = 'POL-[0-9]{10}'
pm1.group_number_pattern = 'GRP-[0-9]{4}'

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.

PM1 field reference

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

#Python nameDatatypeUsageRepeatableTable
1health_plan_idCWERequiredNoHL70072
2insurance_company_idCXRequiredYes-
3insurance_company_nameXONOptionalYes-
4insurance_company_addressXADOptionalYes-
5insurance_co_contact_personXPNOptionalYes-
6insurance_co_phone_numberXTNOptionalYes-
7group_numberSTOptionalNo-
8group_nameXONOptionalYes-
9plan_effective_dateDTOptionalNo-
10plan_expiration_dateDTOptionalNo-
11patient_dob_requiredIDOptionalNoHL70136
12patient_gender_requiredIDOptionalNoHL70136
13patient_relationship_requiredIDOptionalNoHL70136
14patient_signature_requiredIDOptionalNoHL70136
15diagnosis_requiredIDOptionalNoHL70136
16service_requiredIDOptionalNoHL70136
17patient_name_requiredIDOptionalNoHL70136
18patient_address_requiredIDOptionalNoHL70136
19subscribers_name_requiredIDOptionalNoHL70136
20workmans_comp_indicatorIDOptionalNoHL70136
21bill_type_requiredIDOptionalNoHL70136
22commercial_carrier_name_and_address_requiredIDOptionalNoHL70136
23policy_number_patternSTOptionalNo-
24group_number_patternSTOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python