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.
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_idHow to construct and work with real-world PAC segments.
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'
)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'
)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'
)Step-by-step guides for working with HL7 v2 in Zato.
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.
Complete list of fields in the PAC segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_pac | SI | Required | No | - |
| 2 | package_id | EI | Optional | No | - |
| 3 | parent_package_id | EI | Optional | No | - |
| 4 | position_in_parent_package | NA | Optional | No | - |
| 5 | package_type | CWE | Required | No | HL70908 |
| 6 | package_condition | CWE | Optional | Yes | HL70544 |
| 7 | package_handling_code | CWE | Optional | Yes | HL70376 |
| 8 | package_risk_code | CWE | Optional | Yes | HL70489 |
| 9 | action_code | ID | Optional | No | - |
Get started with Zato and connect your systems in minutes.