Schedule a demo
Segment

Item packaging

Describes the packaging configurations available for a material item from a specific vendor, including the packaging unit of measure, pack quantity, pricing, GTIN, and default order unit indicator. It nests under VND segments in MFN materials management master file messages, enabling materials management systems to communicate item-level packaging and pricing details to procurement and clinical ordering systems.

11fields
1required
v2.9HL7 version
pkg.py
from zato.hl7v2.v2_9 import PKG
from zato.hl7v2.v2_9 import CWE, NM

pkg = PKG()
pkg.set_id_pkg = '1'
pkg.packaging_units = CWE(
    identifier='BOX',
    text='Box'
)

Build PKG segments in Python

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

1

Box packaging

Standard box packaging

from zato.hl7v2.v2_9 import PKG
from zato.hl7v2.v2_9 import CWE, NM, CNE

pkg = PKG()
pkg.set_id_pkg = '1'
pkg.packaging_units = CWE(
    identifier='BOX',
    text='Box'
)
pkg.default_order_unit_of_measure_indicator = CNE(identifier='Y')
pkg.package_quantity = '100'
2

Case packaging

Bulk case packaging

from zato.hl7v2.v2_9 import PKG
from zato.hl7v2.v2_9 import CWE, NM, CNE

pkg = PKG()
pkg.set_id_pkg = '2'
pkg.packaging_units = CWE(
    identifier='CASE',
    text='Case'
)
pkg.default_order_unit_of_measure_indicator = CNE(identifier='N')
pkg.package_quantity = '24'
3

Each unit packaging

Individual unit packaging

from zato.hl7v2.v2_9 import PKG
from zato.hl7v2.v2_9 import CWE, NM, CNE

pkg = PKG()
pkg.set_id_pkg = '3'
pkg.packaging_units = CWE(
    identifier='EA',
    text='Each'
)
pkg.default_order_unit_of_measure_indicator = CNE(identifier='Y')
pkg.package_quantity = '1'

Learn by building

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

Frequently asked questions

PKG contains item packaging information including packaging units, quantities, and types for materials management.

Common packaging units include BOX (Box), CASE (Case), EA (Each), and PALLET (Pallet).

Use packaging_units field with CWE datatype:

from zato.hl7v2.v2_9 import PKG
from zato.hl7v2.v2_9 import CWE

pkg = PKG()
pkg.packaging_units = CWE(
    identifier='BOX',
    text='Box'
)

PKG contains packaging information while ITM contains item master data. Multiple PKG segments can define different packaging for the same ITM.

contract_price, quantity_of_each, and vendor_catalog_number align negotiated rates with portion-friendly packaging so fitness facilities and nutrition programs can budget replenishment confidently.

from zato.hl7v2.v2_9 import PKG
from zato.hl7v2.v2_9 import MO, EI

pkg = PKG()
pkg.contract_price = MO(quantity='18.50')
pkg.quantity_of_each = '12'
pkg.vendor_catalog_number = EI(entity_identifier='WELL-KIT-2024')

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.

PKG field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_pkgSIRequiredNo-
2packaging_unitsCWEOptionalNoHL70818
3default_order_unit_of_measure_indicatorCNEOptionalNoHL70532
4package_quantityNMOptionalNo-
5priceCPOptionalNo-
6future_item_priceCPOptionalNo-
7future_item_price_effective_dateDTMOptionalNo-
8global_trade_item_numberCWEOptionalNo-
9contract_priceMOOptionalNo-
10quantity_of_eachNMOptionalNo-
11vendor_catalog_numberEIOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python