Schedule a demo
Segment

Shipment

Describes the transportation details for a physical shipment, including the shipment identifier, internal tracking numbers, shipment status, priority, confidentiality, number of packages, and condition upon receipt. It is the header segment for specimen shipment messages (such as OML O39) used between reference labs, public health labs, and sending facilities to electronically manifest biological specimens and other healthcare materials in transit.

12fields
2required
v2.9HL7 version
shp.py
from zato.hl7v2.v2_9 import SHP
from zato.hl7v2.v2_9 import EI, CWE, DTM

shp = SHP()
shipment_id = EI(entity_identifier='SHP20240115001')
shp.shipment_id = shipment_id
shp.shipment_status = CWE(
    identifier='S',
    text='Shipped'
)

Build SHP segments in Python

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

1

Specimen shipment

Laboratory specimen transport

from zato.hl7v2.v2_9 import SHP
from zato.hl7v2.v2_9 import EI, CWE, DTM

shp = SHP()
shp.shipment_id = EI(entity_identifier='SHP20240115001')
shp.internal_shipment_id = EI(entity_identifier='LAB-001')
shp.shipment_status = CWE(
    identifier='S',
    text='Shipped'
)
shp.shipment_status_date_time = DTM('20240115100000')
2

Received shipment

Shipment received at destination

from zato.hl7v2.v2_9 import SHP
from zato.hl7v2.v2_9 import EI, CWE, DTM

shp = SHP()
shp.shipment_id = EI(entity_identifier='SHP20240115002')
shp.internal_shipment_id = EI(entity_identifier='LAB-002')
shp.shipment_status = CWE(
    identifier='R',
    text='Received'
)
shp.shipment_status_date_time = DTM('20240115140000')
3

In transit shipment

Shipment in transit

from zato.hl7v2.v2_9 import SHP
from zato.hl7v2.v2_9 import EI, CWE, DTM

shp = SHP()
shp.shipment_id = EI(entity_identifier='SHP20240115003')
shp.internal_shipment_id = EI(entity_identifier='LAB-003')
shp.shipment_status = CWE(
    identifier='T',
    text='In Transit'
)
shp.shipment_status_date_time = DTM('20240115120000')

Learn by building

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

Frequently asked questions

SHP contains shipment information including shipment identifiers, status, and dates for public health specimen tracking.

Common shipment statuses include S (Shipped), R (Received), and T (In Transit).

Use shipment_id field with EI datatype:

from zato.hl7v2.v2_9 import SHP
from zato.hl7v2.v2_9 import EI

shp = SHP()
shp.shipment_id = EI(entity_identifier='SHP20240115001')

SHP contains shipment information while PAC contains package information. A shipment may contain multiple packages.

action_code records lifecycle updates so nutrition screening, fitness biomarker, and preventive-care specimen shipments stay coordinated across teams.

from zato.hl7v2.v2_9 import SHP

shp = SHP()
shp.action_code = 'U'

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.

SHP field reference

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

#Python nameDatatypeUsageRepeatableTable
1shipment_idEIRequiredNo-
2internal_shipment_idEIOptionalYes-
3shipment_statusCWEOptionalNoHL70905
4shipment_status_date_timeDTMRequiredNo-
5shipment_status_reasonTXOptionalNo-
6shipment_priorityCWEOptionalNoHL70906
7shipment_confidentialityCWEOptionalYesHL70907
8number_of_packages_in_shipmentNMOptionalNo-
9shipment_conditionCWEOptionalYesHL70544
10shipment_handling_codeCWEOptionalYesHL70376
11shipment_risk_codeCWEOptionalYesHL70489
12action_codeIDOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python