Schedule a demo
Segment

Observation Map Component

Defines the structure and presentation rules for clinical observation questions within master file messages. Each instance maps a single question to its communication location, answer type, and formatting constraints such as character limits and decimal precision. It is carried in MFN/MFR messages under the observation master file group and allows receiving systems to build dynamic order-entry forms and clinical questionnaires.

13fields
3required
v2.9HL7 version
omc.py
from zato.hl7v2 import OMC

omc = OMC()
omc.segment_action_code = 'A'
omc.answer_required = 'Y'
omc.type_of_answer = 'ST'

Build OMC segments in Python

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

1

Clinical question setup

Observation map entry defining a required free-text clinical question

from zato.hl7v2.v2_9 import OMC
from zato.hl7v2.v2_9 import CWE, EI

omc = OMC()
omc.sequence_number_test_observation_master_file = '1'
omc.segment_action_code = 'A'
omc.segment_unique_key = EI(
    entity_identifier='Q001',
    namespace_id='OBS',
    universal_id='LOCAL'
)
omc.clinical_information_request = CWE(
    identifier='ALLERGY',
    text='Allergy list',
    name_of_coding_system='HL70664'
)
omc.communication_location = CWE(
    identifier='FORM',
    text='Entry form',
    name_of_coding_system='HL70939'
)
omc.answer_required = 'Y'
omc.hint_help_text = 'List all known allergies'
omc.type_of_answer = 'ST'
omc.multiple_answers_allowed = 'N'
omc.character_limit = '256'
2

Numeric observation field

Numeric question allowing decimal precision for lab result entry

from zato.hl7v2.v2_9 import OMC
from zato.hl7v2.v2_9 import CWE, EI

omc = OMC()
omc.sequence_number_test_observation_master_file = '2'
omc.segment_action_code = 'A'
omc.segment_unique_key = EI(
    entity_identifier='Q002',
    namespace_id='LAB',
    universal_id='LOCAL'
)
omc.clinical_information_request = CWE(
    identifier='GLUC',
    text='Glucose level',
    name_of_coding_system='HL70664'
)
omc.communication_location = CWE(
    identifier='RESULT',
    text='Result entry',
    name_of_coding_system='HL70939'
)
omc.answer_required = 'Y'
omc.hint_help_text = 'Enter glucose mg/dL'
omc.type_of_answer = 'NM'
omc.multiple_answers_allowed = 'N'
omc.character_limit = '6'
omc.number_of_decimals = '1'
3

Multi-select coded question

Observation map entry allowing multiple coded answers for a diagnosis checklist

from zato.hl7v2.v2_9 import OMC
from zato.hl7v2.v2_9 import CWE, EI

omc = OMC()
omc.sequence_number_test_observation_master_file = '3'
omc.segment_action_code = 'U'
omc.segment_unique_key = EI(
    entity_identifier='Q003',
    namespace_id='DX',
    universal_id='LOCAL'
)
omc.clinical_information_request = CWE(
    identifier='DXLIST',
    text='Diagnosis list',
    name_of_coding_system='HL70664'
)
omc.communication_location = CWE(
    identifier='ORDER',
    text='Order entry',
    name_of_coding_system='HL70939'
)
omc.answer_required = 'N'
omc.hint_help_text = 'Select diagnoses'
omc.type_of_answer = 'CWE'
omc.multiple_answers_allowed = 'Y'
omc.character_limit = '128'

Learn by building

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

Frequently asked questions

OMC defines the layout and constraints for clinical observation questions in master file messages. Each instance describes one question including its answer type, whether it is required, character limits, and where the question appears in the user interface.

Set clinical_information_request using a CWE datatype and configure the answer type:

from zato.hl7v2.v2_9 import OMC, CWE

omc = OMC()
omc.clinical_information_request = CWE(
    identifier='ALLERGY',
    text='Allergy list',
    name_of_coding_system='HL70664'
)
omc.answer_required = 'Y'
omc.type_of_answer = 'ST'

The communication_location field uses CWE with HL7 table 0939 to indicate where the question is displayed:

from zato.hl7v2.v2_9 import OMC, CWE

omc = OMC()
omc.communication_location = CWE(
    identifier='FORM',
    text='Entry form',
    name_of_coding_system='HL70939'
)

The type_of_answer field uses HL7 table 0125. Common values include ST (string), NM (numeric), CWE (coded with exceptions), DT (date), and TM (time):

from zato.hl7v2.v2_9 import OMC

omc = OMC()

omc.type_of_answer = 'ST'
omc.type_of_answer = 'NM'
omc.type_of_answer = 'CWE'
omc.type_of_answer = 'DT'

Use character_limit to cap input length and number_of_decimals to control numeric precision:

from zato.hl7v2.v2_9 import OMC

omc = OMC()
omc.type_of_answer = 'NM'
omc.character_limit = '8'
omc.number_of_decimals = '2'

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.

OMC field reference

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

#Python nameDatatypeUsageRepeatableTable
1sequence_number_test_observation_master_fileNMOptionalNo-
2segment_action_codeIDOptionalNoHL70206
3segment_unique_keyEIOptionalNo-
4clinical_information_requestCWERequiredNoHL70664
5collection_event_process_stepCWERequiredYesHL70938
6communication_locationCWERequiredNoHL70939
7answer_requiredIDOptionalNoHL70136
8hint_help_textSTOptionalNo-
9type_of_answerIDOptionalNoHL70125
10multiple_answers_allowedIDOptionalNoHL70136
11answer_choicesCWEOptionalYesHL70665
12character_limitNMOptionalNo-
13number_of_decimalsNMOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python