Schedule a demo
Segment

Additional basic attributes

Contains supplementary attributes for observation and service definitions that apply broadly, such as orderable-at-location, effective date range, service duration, and consent indicators. It provides additional metadata beyond OM1 and is sent in MFN messages to enrich test and service catalog synchronization between ordering and performing systems.

24fields
2required
v2.9HL7 version
om7.py
from zato.hl7v2.v2_9 import OM7
from zato.hl7v2.v2_9 import CWE

om7 = OM7()
om7.sequence_number_test_observation_master_file = '1'
om7.universal_service_identifier = CWE(
    identifier='57634-3',
    text='Nutrition screening',
    name_of_coding_system='LN',
)

Build OM7 segments in Python

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

1

Nutrition screening consent window

Full row with schedule, consent intervals, and CDM fee cross-reference

from zato.hl7v2.v2_9 import OM7
from zato.hl7v2.v2_9 import CWE, PL, XCN

om7 = OM7()
om7.sequence_number_test_observation_master_file = '1'
om7.universal_service_identifier = CWE(
    identifier='57634-3',
    text='Nutrition screening',
    name_of_coding_system='LN',
)
om7.category_identifier = [
    CWE(
        identifier='LAB',
        text='Laboratory',
        name_of_coding_system='HL70412',
    ),
]
om7.category_description = 'Nutrition screening catalog'
om7.category_synonym = 'Panel~Profile'
om7.effective_test_service_start_date_time = '20260101080000'
om7.effective_test_service_end_date_time = '20261231235959'
om7.test_service_default_duration_quantity = '45'
om7.test_service_default_duration_units = CWE(
    identifier='min',
    text='Minute',
    name_of_coding_system='HL70663',
)
om7.test_service_default_frequency = CWE(
    identifier='MO',
    text='Monthly',
    name_of_coding_system='HL70121',
)
om7.consent_indicator = 'Y'
om7.consent_identifier = CWE(
    identifier='CONSENT',
    text='Nutrition screen',
    name_of_coding_system='HL70413',
)
om7.consent_effective_start_date_time = '20260101000000'
om7.consent_effective_end_date_time = '20261231235959'
om7.consent_interval_quantity = '12'
om7.consent_interval_units = CWE(
    identifier='mo',
    text='Month',
    name_of_coding_system='HL70414',
)
om7.consent_waiting_period_quantity = '0'
om7.consent_waiting_period_units = CWE(
    identifier='d',
    text='Day',
    name_of_coding_system='HL70414',
)
om7.effective_date_time_of_change = '20260101120000'
om7.entered_by = XCN(
    person_identifier='1001',
    family_name='Lee',
    given_name='Alex',
    suffix='MD',
)
om7.orderable_at_location = [
    PL(
        point_of_care='GYM',
        room='STUDIO1',
        bed='A',
    ),
]
om7.formulary_status = CWE(
    identifier='ACT',
    text='Active',
    name_of_coding_system='HL70473',
)
om7.special_order_indicator = 'N'
om7.primary_key_value_cdm = [
    CWE(
        identifier='FEE123',
        text='Wellness fee',
        name_of_coding_system='LOCAL',
    ),
]
2

Fitness assessment slot

Minimal row highlighting service code and coach who entered the change

from zato.hl7v2.v2_9 import OM7
from zato.hl7v2.v2_9 import CWE, PL, XCN

om7 = OM7()
om7.sequence_number_test_observation_master_file = '2'
om7.universal_service_identifier = CWE(
    identifier='62253-4',
    text='Fitness assessment',
    name_of_coding_system='LN',
)
om7.category_identifier = [
    CWE(
        identifier='FIT',
        text='Fitness center',
        name_of_coding_system='HL70412',
    ),
]
om7.category_description = 'Track sessions'
om7.effective_date_time_of_change = '20260201100000'
om7.entered_by = XCN(
    person_identifier='2002',
    family_name='Ng',
    given_name='Sam',
    suffix='MD',
)
om7.orderable_at_location = [
    PL(
        point_of_care='FITLOC',
        room='Track',
        bed='1',
    ),
]
3

Preventive screening catalog entry

Annual wellness lab with consent waiting period and formulary flag

from zato.hl7v2.v2_9 import OM7
from zato.hl7v2.v2_9 import CWE

om7 = OM7()
om7.sequence_number_test_observation_master_file = '3'
om7.universal_service_identifier = CWE(
    identifier='24325-3',
    text='General wellness panel',
    name_of_coding_system='LN',
)
om7.category_identifier = [
    CWE(
        identifier='SCR',
        text='Screening',
        name_of_coding_system='HL70412',
    ),
]
om7.category_description = 'Annual wellness'
om7.consent_waiting_period_quantity = '3'
om7.consent_waiting_period_units = CWE(
    identifier='d',
    text='Day',
    name_of_coding_system='HL70414',
)
om7.formulary_status = CWE(
    identifier='OBS',
    text='On formulary',
    name_of_coding_system='HL70473',
)
om7.special_order_indicator = 'N'

Learn by building

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

Frequently asked questions

Fields 6 through 10 carry effective start and end times, default duration, units, and cadence so screening programs can publish predictable slot lengths.

Indicators 11 through 18 describe when consent is required, how long it is valid, and any waiting period before the service can be booked.

Use CWE with LOINC for the observation service and keep sequence numbering aligned with OM1 rows:

from zato.hl7v2.v2_9 import OM7
from zato.hl7v2.v2_9 import CWE

om7 = OM7()
om7.sequence_number_test_observation_master_file = '1'
om7.universal_service_identifier = CWE(
    identifier='57634-3',
    text='Nutrition screening',
    name_of_coding_system='LN',
)

LOC describes facility details broadly, while OM7 field 21 names the specific rooms or studios where a cataloged service may be ordered for fitness visits.

Field 24 repeats CDM keys so pricing and charge descriptions stay tied to the observation service for wellness fee schedules.

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.

OM7 field reference

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

#Python nameDatatypeUsageRepeatableTable
1sequence_number_test_observation_master_fileNMRequiredNo-
2universal_service_identifierCWERequiredNo-
3category_identifierCWEOptionalYesHL70412
4category_descriptionTXOptionalNo-
5category_synonymSTOptionalYes-
6effective_test_service_start_date_timeDTMOptionalNo-
7effective_test_service_end_date_timeDTMOptionalNo-
8test_service_default_duration_quantityNMOptionalNo-
9test_service_default_duration_unitsCWEOptionalNoHL70663
10test_service_default_frequencyCWEOptionalNo-
11consent_indicatorIDOptionalNoHL70136
12consent_identifierCWEOptionalNoHL70413
13consent_effective_start_date_timeDTMOptionalNo-
14consent_effective_end_date_timeDTMOptionalNo-
15consent_interval_quantityNMOptionalNo-
16consent_interval_unitsCWEOptionalNoHL70414
17consent_waiting_period_quantityNMOptionalNo-
18consent_waiting_period_unitsCWEOptionalNoHL70414
19effective_date_time_of_changeDTMOptionalNo-
20entered_byXCNOptionalNo-
21orderable_at_locationPLOptionalYes-
22formulary_statusCWEOptionalNoHL70473
23special_order_indicatorIDOptionalNoHL70136
24primary_key_value_cdmCWEOptionalYes-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python