Schedule a demo
Segment

Shipment package

Describes an individual package within a shipment, including the package identifier, parent package reference (for nested packaging), package type, conditions, and handling risks. It nests under the SHP segment in specimen shipment messages and is used by laboratories and public health systems to identify and track specific containers within a multi-package shipment.

9fields
2required
v2.9HL7 version
pac.py
from zato.hl7v2.v2_9 import PAC
from zato.hl7v2.v2_9 import EI, CWE

pac = PAC()
pac.set_id_pac = '1'
package_id = EI(entity_identifier='PKG20240115001')
pac.package_id = package_id

Build PAC segments in Python

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

1

Specimen package

Laboratory specimen container

from zato.hl7v2.v2_9 import PAC
from zato.hl7v2.v2_9 import EI, CWE

pac = PAC()
pac.set_id_pac = '1'
pac.package_id = EI(entity_identifier='PKG20240115001')
pac.package_type = CWE(
    identifier='BOX',
    text='Box'
)
pac.package_condition = CWE(
    identifier='G',
    text='Good'
)
2

Cooler package

Temperature-controlled container

from zato.hl7v2.v2_9 import PAC
from zato.hl7v2.v2_9 import EI, CWE

pac = PAC()
pac.set_id_pac = '2'
pac.package_id = EI(entity_identifier='PKG20240115002')
pac.package_type = CWE(
    identifier='COOL',
    text='Cooler'
)
pac.package_condition = CWE(
    identifier='G',
    text='Good'
)
3

Damaged package

Package with condition issues

from zato.hl7v2.v2_9 import PAC
from zato.hl7v2.v2_9 import EI, CWE

pac = PAC()
pac.set_id_pac = '3'
pac.package_id = EI(entity_identifier='PKG20240115003')
pac.package_type = CWE(
    identifier='BOX',
    text='Box'
)
pac.package_condition = CWE(
    identifier='D',
    text='Damaged'
)

Learn by building

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

Frequently asked questions

PAC contains shipment package information including package identifiers, types, and conditions for public health specimen tracking.

Common package conditions include G (Good), D (Damaged), and C (Compromised).

Use package_id field with EI datatype:

from zato.hl7v2.v2_9 import PAC
from zato.hl7v2.v2_9 import EI

pac = PAC()
pac.package_id = EI(entity_identifier='PKG20240115001')

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

action_code marks positive handling milestones so fitness kits, nutrition samples, and preventive screening materials are tracked consistently in transit.

from zato.hl7v2.v2_9 import PAC

pac = PAC()
pac.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.

PAC field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_pacSIRequiredNo-
2package_idEIOptionalNo-
3parent_package_idEIOptionalNo-
4position_in_parent_packageNAOptionalNo-
5package_typeCWERequiredNoHL70908
6package_conditionCWEOptionalYesHL70544
7package_handling_codeCWEOptionalYesHL70376
8package_risk_codeCWEOptionalYesHL70489
9action_codeIDOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python