Serves as the primary location master file segment, identifying a patient care location with its key identifier, name, location type (nursing unit, room, bed, clinic, or department), address, and phone number. It is the anchor segment in MFN (Location Master File) messages sent by ADT or facility management systems to synchronize location master data with bed management, scheduling, and clinical systems.
from zato.hl7v2.v2_9 import LOC
from zato.hl7v2.v2_9 import CWE, PL, XON
loc = LOC()
loc.primary_key_value_loc = PL(
point_of_care='WELLCTR',
room='GYM-2A',
location_status='A',
)
loc.location_type_loc = CWE(
identifier='FIT',
text='Fitness floor',
name_of_coding_system='HL70260'
)
organization = XON(organization_name='River Valley Wellness')
loc.organization_name_loc = organizationHow to construct and work with real-world LOC segments.
Primary PL key, description, type CWE, org XON, address, phone, license, equipment, service code
from zato.hl7v2.v2_9 import LOC
from zato.hl7v2.v2_9 import CWE, PL, XAD, XON, XTN
loc = LOC()
loc.primary_key_value_loc = PL(
point_of_care='WELLCTR',
room='GYM-2A',
location_status='A',
building='Main',
floor='2',
)
loc.location_description = 'Fitness assessment bay'
loc.location_type_loc = CWE(
identifier='FIT',
text='Fitness floor',
name_of_coding_system='HL70260'
)
loc.organization_name_loc = XON(organization_name='River Valley Wellness')
loc.location_address = XAD(
street_address='123 Wellness Way',
city='Denver',
state_or_province='CO',
zip_or_postal_code='80202'
)
loc.location_phone = XTN(
telecommunication_use_code='PRN',
telecommunication_equipment_type='PH',
country_code='1',
area_city_code='303',
local_number='5550100'
)
loc.license_number = CWE(
identifier='LIC',
text='State facility license',
name_of_coding_system='HL70461'
)
loc.location_equipment = CWE(
identifier='BIA',
text='Body composition analyzer',
name_of_coding_system='HL70261'
)
loc.location_service_code = CWE(
identifier='FITGRP',
text='Group fitness',
name_of_coding_system='HL70442',
)Minimal LOC with required PL and single location type CWE
from zato.hl7v2.v2_9 import LOC
from zato.hl7v2.v2_9 import CWE, PL
loc = LOC()
loc.primary_key_value_loc = PL(
point_of_care='SUNRISE',
room='NUT-3',
location_status='O',
building='East',
floor='1',
)
loc.location_type_loc = CWE(
identifier='NUT',
text='Nutrition suite',
name_of_coding_system='HL70260'
)Repeating location_type_loc entries for pool and open gym areas
from zato.hl7v2.v2_9 import LOC
from zato.hl7v2.v2_9 import CWE, PL
loc = LOC()
loc.primary_key_value_loc = PL(
point_of_care='COAST',
room='POOL-1',
location_status='A',
building='South',
floor='G',
)
loc.location_description = 'Aquatics and gym deck'
loc.location_type_loc = [
CWE(
identifier='POOL',
text='Pool deck',
name_of_coding_system='HL70260',
),
CWE(
identifier='GYM',
text='Open gym',
name_of_coding_system='HL70260',
),
]Step-by-step guides for working with HL7 v2 in Zato.
PL combines site, room, building, and floor in one key so master-file rows reference the same wellness space across LOC, LCH, and LDP children.
HL7 separates repetitions with tilde; build a Python list of CWE rows in the same order as the wire string.
Use a list of XON rows for legal or marketing names:
from zato.hl7v2.v2_9 import LOC
from zato.hl7v2.v2_9 import PL, XON
loc = LOC()
loc.primary_key_value_loc = PL(
point_of_care='WELLCTR',
room='GYM-2A',
)
loc.organization_name_loc = XON(organization_name='River Valley Wellness')Add license CWE rows for regulated studios and equipment CWE rows when the room advertises specific fitness or measurement devices.
Field 9 (HL70442) classifies the wellness service offered at the site, such as group fitness versus nutrition counseling.
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 LOC segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | primary_key_value_loc | PL | Required | No | - |
| 2 | location_description | ST | Optional | No | - |
| 3 | location_type_loc | CWE | Required | Yes | HL70260 |
| 4 | organization_name_loc | XON | Optional | Yes | - |
| 5 | location_address | XAD | Optional | Yes | - |
| 6 | location_phone | XTN | Optional | Yes | - |
| 7 | license_number | CWE | Optional | Yes | HL70461 |
| 8 | location_equipment | CWE | Optional | Yes | HL70261 |
| 9 | location_service_code | CWE | Optional | No | HL70442 |
Get started with Zato and connect your systems in minutes.