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.
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'
)How to construct and work with real-world PKG segments.
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'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'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'Step-by-step guides for working with HL7 v2 in Zato.
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.
Complete list of fields in the PKG segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_pkg | SI | Required | No | - |
| 2 | packaging_units | CWE | Optional | No | HL70818 |
| 3 | default_order_unit_of_measure_indicator | CNE | Optional | No | HL70532 |
| 4 | package_quantity | NM | Optional | No | - |
| 5 | price | CP | Optional | No | - |
| 6 | future_item_price | CP | Optional | No | - |
| 7 | future_item_price_effective_date | DTM | Optional | No | - |
| 8 | global_trade_item_number | CWE | Optional | No | - |
| 9 | contract_price | MO | Optional | No | - |
| 10 | quantity_of_each | NM | Optional | No | - |
| 11 | vendor_catalog_number | EI | Optional | No | - |
Get started with Zato and connect your systems in minutes.