Records details of a patient's past or current job including the occupation, industry, work classification, work schedule, employer organization, and supervisory level. It also carries job start and end dates, average hours worked per day, and average days worked per week. This segment appears in occupational health messages and supports exposure assessment, occupational injury tracking, and public health surveillance.
from zato.hl7v2 import OH2
oh2 = OH2()
oh2.set_id = '1'
oh2.occupation = 'Nurse'
oh2.industry = 'Hospital'How to construct and work with real-world OH2 segments.
Records a current nursing job with occupation, industry, schedule, and employer details
from zato.hl7v2.v2_9 import OH2
from zato.hl7v2.v2_9 import CWE
oh2 = OH2()
oh2.set_id = '1'
oh2.entered_date = '20240101'
oh2.occupation = CWE(
identifier='RN',
text='Registered nurse',
name_of_coding_system='HL70958'
)
oh2.industry = CWE(
identifier='HOSP',
text='Hospital',
name_of_coding_system='HL70955'
)
oh2.work_classification = CWE(
identifier='FT',
text='Full time',
name_of_coding_system='HL70959'
)
oh2.job_start_date = '20200115'
oh2.work_schedule = CWE(
identifier='DAY',
text='Day shift',
name_of_coding_system='HL70954'
)
oh2.average_hours_worked_per_day = '8'
oh2.average_days_worked_per_week = '5'
oh2.current_job_indicator = CWE(
identifier='Y',
text='Yes',
name_of_coding_system='HL70136'
)Records a completed past job with start/end dates, hours, and a unique identifier
from zato.hl7v2.v2_9 import OH2
from zato.hl7v2.v2_9 import CWE, EI
oh2 = OH2()
oh2.set_id = '2'
oh2.entered_date = '20240301'
oh2.occupation = CWE(
identifier='TECH',
text='Technician',
name_of_coding_system='HL70958'
)
oh2.industry = CWE(
identifier='MFG',
text='Manufacturing',
name_of_coding_system='HL70955'
)
oh2.job_start_date = '20180601'
oh2.job_end_date = '20230901'
oh2.work_schedule = CWE(
identifier='NGT',
text='Night shift',
name_of_coding_system='HL70954'
)
oh2.average_hours_worked_per_day = '10'
oh2.average_days_worked_per_week = '4'
oh2.job_unique_identifier = EI(
entity_identifier='OH2-2024-001',
namespace_id='MAIN'
)
oh2.current_job_indicator = CWE(
identifier='N',
text='No',
name_of_coding_system='HL70136'
)Records occupation and industry only for a basic job history entry
from zato.hl7v2.v2_9 import OH2
from zato.hl7v2.v2_9 import CWE
oh2 = OH2()
oh2.set_id = '3'
oh2.entered_date = '20240501'
oh2.occupation = CWE(
identifier='ADM',
text='Administrator',
name_of_coding_system='HL70958'
)
oh2.industry = CWE(
identifier='EDU',
text='Education',
name_of_coding_system='HL70955'
)Step-by-step guides for working with HL7 v2 in Zato.
OH2 records a patient's past or present job details including occupation, industry, work classification, schedule, employer, and supervisory level. It supports occupational exposure assessment and public health surveillance by providing detailed job history.
Both fields use CWE with their respective HL7 tables:
from zato.hl7v2.v2_9 import OH2, CWE
oh2 = OH2()
oh2.occupation = CWE(
identifier='RN',
text='Registered nurse',
name_of_coding_system='HL70958'
)
oh2.industry = CWE(
identifier='HOSP',
text='Hospital',
name_of_coding_system='HL70955'
)The work_schedule field uses CWE with HL7 table 0954:
from zato.hl7v2.v2_9 import OH2, CWE
oh2 = OH2()
oh2.work_schedule = CWE(
identifier='DAY',
text='Day shift',
name_of_coding_system='HL70954'
)Use the current_job_indicator field with HL7 table 0136:
from zato.hl7v2.v2_9 import OH2, CWE
oh2 = OH2()
oh2.current_job_indicator = CWE(
identifier='Y',
text='Yes',
name_of_coding_system='HL70136'
)Use the numeric fields for average hours per day and days per week:
from zato.hl7v2.v2_9 import OH2
oh2 = OH2()
oh2.average_hours_worked_per_day = '8'
oh2.average_days_worked_per_week = '5'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 OH2 segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id | SI | Required | No | - |
| 2 | action_code | ID | Optional | No | - |
| 3 | entered_date | DT | Optional | No | - |
| 4 | occupation | CWE | Required | No | HL70958 |
| 5 | industry | CWE | Required | No | HL70955 |
| 6 | work_classification | CWE | Optional | No | HL70959 |
| 7 | job_start_date | DT | Optional | No | - |
| 8 | job_end_date | DT | Optional | No | - |
| 9 | work_schedule | CWE | Optional | No | HL70954 |
| 10 | average_hours_worked_per_day | NM | Optional | No | - |
| 11 | average_days_worked_per_week | NM | Optional | No | - |
| 12 | employer_organization | XON | Optional | No | - |
| 13 | employer_address | XAD | Optional | Yes | - |
| 14 | supervisory_level | CWE | Optional | No | HL70956 |
| 15 | job_duties | ST | Optional | Yes | - |
| 16 | occupational_hazards | FT | Optional | Yes | - |
| 17 | job_unique_identifier | EI | Optional | No | - |
| 18 | current_job_indicator | CWE | Optional | No | HL70136 |
Get started with Zato and connect your systems in minutes.