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.
from zato.hl7v2 import PM1
pm1 = PM1()
pm1.plan_effective_date = '20260101'
pm1.diagnosis_required = 'Y'
pm1.service_required = 'Y'How to construct and work with real-world PM1 segments.
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}'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'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}'Step-by-step guides for working with HL7 v2 in Zato.
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.
Complete list of fields in the PM1 segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | health_plan_id | CWE | Required | No | HL70072 |
| 2 | insurance_company_id | CX | Required | Yes | - |
| 3 | insurance_company_name | XON | Optional | Yes | - |
| 4 | insurance_company_address | XAD | Optional | Yes | - |
| 5 | insurance_co_contact_person | XPN | Optional | Yes | - |
| 6 | insurance_co_phone_number | XTN | Optional | Yes | - |
| 7 | group_number | ST | Optional | No | - |
| 8 | group_name | XON | Optional | Yes | - |
| 9 | plan_effective_date | DT | Optional | No | - |
| 10 | plan_expiration_date | DT | Optional | No | - |
| 11 | patient_dob_required | ID | Optional | No | HL70136 |
| 12 | patient_gender_required | ID | Optional | No | HL70136 |
| 13 | patient_relationship_required | ID | Optional | No | HL70136 |
| 14 | patient_signature_required | ID | Optional | No | HL70136 |
| 15 | diagnosis_required | ID | Optional | No | HL70136 |
| 16 | service_required | ID | Optional | No | HL70136 |
| 17 | patient_name_required | ID | Optional | No | HL70136 |
| 18 | patient_address_required | ID | Optional | No | HL70136 |
| 19 | subscribers_name_required | ID | Optional | No | HL70136 |
| 20 | workmans_comp_indicator | ID | Optional | No | HL70136 |
| 21 | bill_type_required | ID | Optional | No | HL70136 |
| 22 | commercial_carrier_name_and_address_required | ID | Optional | No | HL70136 |
| 23 | policy_number_pattern | ST | Optional | No | - |
| 24 | group_number_pattern | ST | Optional | No | - |
Get started with Zato and connect your systems in minutes.