Communicates the current availability status of a specific bed or room location within a facility. It carries the patient location composite (point of care, room, bed, facility) together with a coded bed status such as occupied, unoccupied, or housekeeping. The segment is used in ADT and bed-management messages to keep census and bed-tracking systems synchronized in real time.
from zato.hl7v2 import NPU
npu = NPU()
npu.bed_location = '4E^401^A'
npu.bed_status = 'UNO'How to construct and work with real-world NPU segments.
Marking a specific bed as unoccupied after patient discharge
from zato.hl7v2.v2_9 import NPU
from zato.hl7v2.v2_9 import PL, CWE
npu = NPU()
npu.bed_location = PL(
point_of_care='4E',
room='401',
bed='A',
facility='MAIN'
)
npu.bed_status = CWE(
identifier='UNO',
text='Unoccupied',
name_of_coding_system=
'HL70116'
)Flagging a bed as needing housekeeping after patient transfer
from zato.hl7v2.v2_9 import NPU
from zato.hl7v2.v2_9 import PL, CWE
npu = NPU()
npu.bed_location = PL(
point_of_care='ICU',
room='102',
bed='B',
facility='MAIN'
)
npu.bed_status = CWE(
identifier='HKG',
text='Housekeeping',
name_of_coding_system=
'HL70116'
)Updating a bed to occupied status after patient admission
from zato.hl7v2.v2_9 import NPU
from zato.hl7v2.v2_9 import PL, CWE
npu = NPU()
npu.bed_location = PL(
point_of_care='MED',
room='305',
bed='A',
facility='WEST'
)
npu.bed_status = CWE(
identifier='OCC',
text='Occupied',
name_of_coding_system=
'HL70116'
)Step-by-step guides for working with HL7 v2 in Zato.
NPU communicates bed availability status changes within a facility. It pairs a patient location (unit, room, bed) with a coded status value, and is used by ADT and census systems to track bed occupancy in real time.
The bed_location field uses the PL (person location) datatype:
from zato.hl7v2.v2_9 import NPU, PL
npu = NPU()
npu.bed_location = PL(
point_of_care='4E',
room='401',
bed='A',
facility='MAIN'
)The bed_status field uses CWE with HL7 table 0116. Common values include:
from zato.hl7v2.v2_9 import NPU, CWE
npu = NPU()
# UNO = Unoccupied
npu.bed_status = CWE(identifier='UNO')
# OCC = Occupied
npu.bed_status = CWE(identifier='OCC')
# HKG = Housekeeping
npu.bed_status = CWE(identifier='HKG')Set the bed_status to the unoccupied code:
from zato.hl7v2.v2_9 import NPU
from zato.hl7v2.v2_9 import PL, CWE
npu = NPU()
npu.bed_location = PL(
point_of_care='4E',
room='401',
bed='A'
)
npu.bed_status = CWE(
identifier='UNO',
text='Unoccupied'
)Access the fields directly after creating the segment:
from zato.hl7v2.v2_9 import NPU
npu = NPU()
npu.bed_location = '4E^401^A'
npu.bed_status = 'UNO'
location = npu.bed_location
status = npu.bed_statusZato 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 NPU segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | bed_location | PL | Required | No | - |
| 2 | bed_status | CWE | Optional | No | HL70116 |
Get started with Zato and connect your systems in minutes.