Schedule a demo
Segment

Categorical service / test / observation

Defines attributes for categorical (coded or enumerated) observations, such as the valid coded answers for the observation and whether multiple answers are permitted. It follows OM1 for observations with coded results (such as positive/negative or blood type) and is sent in MFN messages to synchronize valid answer sets between lab and diagnostic systems and order entry or result display systems.

7fields
0required
v2.9HL7 version
om3.py
from zato.hl7v2.v2_9 import OM3
from zato.hl7v2.v2_9 import CWE

om3 = OM3()
om3.sequence_number_test_observation_master_file = '1'
om3.valid_coded_answers = CWE(
    identifier='OPT',
    text='Optimal'
)

Build OM3 segments in Python

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

1

Fitness readiness labels

Optimal and good outcomes with gentle review and priority follow-up codes

from zato.hl7v2.v2_9 import OM3
from zato.hl7v2.v2_9 import CWE

om3 = OM3()
om3.sequence_number_test_observation_master_file = '1'
om3.preferred_coding_system = CWE(
    identifier='LN',
    text='LOINC',
    name_of_coding_system='HL70650',
)
om3.valid_coded_answers = [
    CWE(
        identifier='OPT',
        text='Optimal',
        name_of_coding_system='LN',
    ),
    CWE(
        identifier='GOOD',
        text='Good',
        name_of_coding_system='LN',
    ),
]
om3.normal_text_codes_for_categorical_observations = CWE(
    identifier='OPT',
    text='Optimal',
    name_of_coding_system='LN'
)
om3.abnormal_text_codes_for_categorical_observations = CWE(
    identifier='REV',
    text='Review recommended',
    name_of_coding_system='LN'
)
om3.critical_text_codes_for_categorical_observations = CWE(
    identifier='PRI',
    text='Priority follow-up',
    name_of_coding_system='LN'
)
om3.value_type = 'CWE'
2

Nutrition screening score

Hydration and micronutrient questionnaire coded answers

from zato.hl7v2.v2_9 import OM3
from zato.hl7v2.v2_9 import CWE

om3 = OM3()
om3.sequence_number_test_observation_master_file = '2'
om3.preferred_coding_system = CWE(
    identifier='NUT',
    text='Nutrition score',
    name_of_coding_system='ORG',
)
om3.valid_coded_answers = [
    CWE(
        identifier='HYD',
        text='Hydrated',
        name_of_coding_system='LN',
    ),
    CWE(
        identifier='BAL',
        text='Balanced',
        name_of_coding_system='LN',
    ),
]
om3.normal_text_codes_for_categorical_observations = CWE(
    identifier='HYD',
    text='Hydrated',
    name_of_coding_system='LN'
)
om3.value_type = 'ST'
3

Sleep quality wellness scale

Restorative sleep tiers for preventive coaching programs

from zato.hl7v2.v2_9 import OM3
from zato.hl7v2.v2_9 import CWE

om3 = OM3()
om3.sequence_number_test_observation_master_file = '3'
om3.preferred_coding_system = CWE(
    identifier='SLP',
    text='Sleep scale',
    name_of_coding_system='ORG',
)
om3.valid_coded_answers = [
    CWE(
        identifier='RST',
        text='Restorative',
        name_of_coding_system='LN',
    ),
    CWE(
        identifier='ADE',
        text='Adequate',
        name_of_coding_system='LN',
    ),
]
om3.value_type = 'CWE'

Learn by building

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

Frequently asked questions

Use OM3 when the observation returns coded wellness labels instead of scalar measurements. OM2 stays on numeric chemistry markers; OM3 carries the allowed answer list and category mapping for coaching or survey style results.

Field 3 repeats with ~ between each CWE. Build a Python list of CWE values and the serializer emits the same repetition pattern.

from zato.hl7v2.v2_9 import OM3, CWE

om3 = OM3()
om3.valid_coded_answers = [
    CWE(
        identifier='OPT',
        text='Optimal',
    ),
    CWE(
        identifier='GOOD',
        text='Good',
    ),
]

Field 4 lists codes interpreted as expected wellness outcomes. Field 5 lists codes that suggest a coaching visit or plan adjustment rather than numeric drift.

Field 7 mirrors HL70125 value types so outbound OBX segments declare compatible datatypes for categorical wellness payloads.

from zato.hl7v2.v2_9 import OM3

om3 = OM3()
om3.value_type = 'CWE'

Field 2 anchors the namespace for the coded answers so receivers know whether identifiers come from LOINC, a local registry, or an organizational wellness catalog.

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.

OM3 field reference

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

#Python nameDatatypeUsageRepeatableTable
1sequence_number_test_observation_master_fileNMOptionalNo-
2preferred_coding_systemCWEOptionalNoHL70650
3valid_coded_answersCWEOptionalYesHL70652
4normal_text_codes_for_categorical_observationsCWEOptionalYesHL70654
5abnormal_text_codes_for_categorical_observationsCWEOptionalYesHL70655
6critical_text_codes_for_categorical_observationsCWEOptionalYesHL70656
7value_typeIDOptionalNoHL70125

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python