Schedule a demo
Segment

Past or present job

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.

18fields
3required
v2.9HL7 version
oh2.py
from zato.hl7v2 import OH2

oh2 = OH2()
oh2.set_id = '1'
oh2.occupation = 'Nurse'
oh2.industry = 'Hospital'

Build OH2 segments in Python

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

1

Current position

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'
)
2

Past job record

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'
)
3

Minimal job entry

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'
)

Learn by building

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

Frequently asked questions

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.

OH2 field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_idSIRequiredNo-
2action_codeIDOptionalNo-
3entered_dateDTOptionalNo-
4occupationCWERequiredNoHL70958
5industryCWERequiredNoHL70955
6work_classificationCWEOptionalNoHL70959
7job_start_dateDTOptionalNo-
8job_end_dateDTOptionalNo-
9work_scheduleCWEOptionalNoHL70954
10average_hours_worked_per_dayNMOptionalNo-
11average_days_worked_per_weekNMOptionalNo-
12employer_organizationXONOptionalNo-
13employer_addressXADOptionalYes-
14supervisory_levelCWEOptionalNoHL70956
15job_dutiesSTOptionalYes-
16occupational_hazardsFTOptionalYes-
17job_unique_identifierEIOptionalNo-
18current_job_indicatorCWEOptionalNoHL70136

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python