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.
from zato.hl7v2 import OMC
omc = OMC()
omc.segment_action_code = 'A'
omc.answer_required = 'Y'
omc.type_of_answer = 'ST'How to construct and work with real-world OMC segments.
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'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'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'Step-by-step guides for working with HL7 v2 in Zato.
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.
Complete list of fields in the OMC segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | sequence_number_test_observation_master_file | NM | Optional | No | - |
| 2 | segment_action_code | ID | Optional | No | HL70206 |
| 3 | segment_unique_key | EI | Optional | No | - |
| 4 | clinical_information_request | CWE | Required | No | HL70664 |
| 5 | collection_event_process_step | CWE | Required | Yes | HL70938 |
| 6 | communication_location | CWE | Required | No | HL70939 |
| 7 | answer_required | ID | Optional | No | HL70136 |
| 8 | hint_help_text | ST | Optional | No | - |
| 9 | type_of_answer | ID | Optional | No | HL70125 |
| 10 | multiple_answers_allowed | ID | Optional | No | HL70136 |
| 11 | answer_choices | CWE | Optional | Yes | HL70665 |
| 12 | character_limit | NM | Optional | No | - |
| 13 | number_of_decimals | NM | Optional | No | - |
Get started with Zato and connect your systems in minutes.