Schedule a demo
Segment

Location department

Identifies how a specific department uses a location defined in the preceding LOC, carrying the department code, hospital service, specialty type, and active or inactive status. Multiple LDP segments can follow one LOC, one per department using that location. It is used in MFN location master file messages for location and department synchronization.

12fields
2required
v2.9HL7 version
ldp.py
from zato.hl7v2.v2_9 import LDP
from zato.hl7v2.v2_9 import CWE, PL

ldp = LDP()
ldp.primary_key_value_ldp = PL(
    point_of_care='WELL',
    room='PCW',
)
ldp.location_department = CWE(
    identifier='PREV',
    text='Preventive wing',
    name_of_coding_system='HL70264',
)

Build LDP segments in Python

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

1

Preventive wing routing

Full row with services, classes, hours, phone, and cost center

from zato.hl7v2.v2_9 import LDP
from zato.hl7v2.v2_9 import CWE, PL, VH, XTN

ldp = LDP()
ldp.primary_key_value_ldp = PL(
    point_of_care='WELL',
    room='PCW-101',
    facility='WELLMAIN',
    location_status='A',
    building='B2',
    floor='3',
)
ldp.location_department = CWE(
    identifier='PREV',
    text='Preventive wing',
    name_of_coding_system='HL70264',
)
ldp.location_service = [
    CWE(
        identifier='FIT',
        text='Fitness coaching',
        name_of_coding_system='HL70069',
    ),
    CWE(
        identifier='NUT',
        text='Nutrition visit',
        name_of_coding_system='HL70069',
    ),
]
ldp.specialty_type = CWE(
    identifier='GEN',
    text='General wellness',
    name_of_coding_system='HL70265'
)
ldp.valid_patient_classes = CWE(
    identifier='AMB',
    text='Ambulatory',
    name_of_coding_system='HL70004'
)
ldp.active_inactive_flag = 'A'
ldp.activation_date_ldp = '20260401080000'
ldp.visiting_hours = [
    VH(
        start_day_range='1',
        end_day_range='5',
        start_hour_range='0800',
        end_hour_range='1700',
    ),
]
ldp.contact_phone = XTN(
    telephone_number='5551234',
    telecommunication_use_code='PRN',
    telecommunication_equipment_type='PH',
)
ldp.location_cost_center = CWE(
    identifier='CCWELL',
    text='Wellness center',
    name_of_coding_system='HL70462',
)
2

Nutrition counseling suite

Department code with screening-friendly patient class

from zato.hl7v2.v2_9 import LDP
from zato.hl7v2.v2_9 import CWE, PL

ldp = LDP()
ldp.primary_key_value_ldp = PL(
    point_of_care='WELL',
    room='NUT-2A',
    facility='WELLMAIN',
)
ldp.location_department = CWE(
    identifier='NCDEPT',
    text='Nutrition counseling',
    name_of_coding_system='HL70264',
)
ldp.valid_patient_classes = CWE(
    identifier='AMB',
    text='Ambulatory',
    name_of_coding_system='HL70004'
)
3

Fitness center seasonal pause

Inactive flag with end date and neutral closure note

from zato.hl7v2.v2_9 import LDP
from zato.hl7v2.v2_9 import PL, VH

ldp = LDP()
ldp.primary_key_value_ldp = PL(
    point_of_care='WELL',
    room='GYM-1',
    facility='WELLMAIN',
)
ldp.active_inactive_flag = 'I'
ldp.activation_date_ldp = '20260401080000'
ldp.inactivation_date_ldp = '20260901170000'
ldp.inactivated_reason = 'Seasonal layout refresh'
ldp.visiting_hours = [
    VH(
        start_day_range='1',
        end_day_range='7',
        start_hour_range='0600',
        end_hour_range='2100',
    ),
]

Learn by building

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

Frequently asked questions

LOC names the site while LDP binds a PL primary key to a department CWE, optional services, and visiting hours so wellness flows know which wing handles fitness coaching versus nutrition counseling.

Add a VH for each public window, for example weekday morning coaching versus weekend open gym blocks, each with day range and hour range components.

Use CWE with table HL70264 so receivers align the row to a department concept:

from zato.hl7v2.v2_9 import LDP
from zato.hl7v2.v2_9 import CWE

ldp = LDP()
ldp.location_department = CWE(
    identifier='PREV',
    text='Preventive wing',
    name_of_coding_system='HL70264',
)

Repeat CWE values from HL70004 to show which visit types may book the location, such as ambulatory wellness visits for a screening desk.

Field 12 ties the department row to a finance code so fitness passes, nutrition packages, and screening bundles roll up to the right wellness budget line.

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.

LDP field reference

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

#Python nameDatatypeUsageRepeatableTable
1primary_key_value_ldpPLRequiredNo-
2location_departmentCWERequiredNoHL70264
3location_serviceCWEOptionalYesHL70069
4specialty_typeCWEOptionalYesHL70265
5valid_patient_classesCWEOptionalYesHL70004
6active_inactive_flagIDOptionalNoHL70183
7activation_date_ldpDTMOptionalNo-
8inactivation_date_ldpDTMOptionalNo-
9inactivated_reasonSTOptionalNo-
10visiting_hoursVHOptionalYesHL70267
11contact_phoneXTNOptionalNo-
12location_cost_centerCWEOptionalNoHL70462

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python