Contains master-level detail about items held in a facility's inventory, including the item code, lot number, expiration date, manufacturer, storage location, received quantities, costs, and on-hand quantities. It is used in inventory-management and materials-management messages to synchronize stock records across supply-chain, pharmacy, and central-stores systems.
from zato.hl7v2 import IIM
iim = IIM()
iim.service_item_code = 'IV-SET-001'
iim.inventory_lot_number = 'LOT2024A'
iim.inventory_received_quantity = '50'How to construct and work with real-world IIM segments.
Recording a received shipment of IV sets with lot, manufacturer, and cost details
from zato.hl7v2.v2_9 import IIM
from zato.hl7v2.v2_9 import CWE, MO
iim = IIM()
iim.primary_key_value_iim = CWE(
identifier='IV001',
text='IV Set',
name_of_coding_system='LOCAL'
)
iim.service_item_code = CWE(
identifier='IV-SET-001',
text='IV Set Standard',
name_of_coding_system=
'SUPPLIERCAT'
)
iim.inventory_lot_number = 'LOT2024A'
iim.inventory_expiration_date = '20261231'
iim.inventory_location = CWE(
identifier='CENTRAL',
text='Central stores',
name_of_coding_system='LOCAL'
)
iim.inventory_received_date = '20240510'
iim.inventory_received_quantity = '50'
iim.inventory_received_quantity_unit = CWE(
identifier='EA',
text='Each',
name_of_coding_system='UCUM'
)
iim.inventory_received_item_cost = MO(
quantity='15.00',
denomination='USD'
)Tracking current on-hand inventory levels for a surgical supply item
from zato.hl7v2.v2_9 import IIM
from zato.hl7v2.v2_9 import CWE
iim = IIM()
iim.primary_key_value_iim = CWE(
identifier='SRG050',
text='Suture kit',
name_of_coding_system='LOCAL'
)
iim.service_item_code = CWE(
identifier='SRG-050',
text='Suture Kit 3-0',
name_of_coding_system=
'SUPPLIERCAT'
)
iim.inventory_manufacturer_name = CWE(
identifier='MFG',
text='Acme Medical',
name_of_coding_system='LOCAL'
)
iim.inventory_on_hand_date = '20240601'
iim.inventory_on_hand_quantity = '120'
iim.inventory_on_hand_quantity_unit = CWE(
identifier='BX',
text='Box',
name_of_coding_system='UCUM'
)Recording lot-level expiration and procedure code for a pharmacy item
from zato.hl7v2.v2_9 import IIM
from zato.hl7v2.v2_9 import CWE, CNE
iim = IIM()
iim.primary_key_value_iim = CWE(
identifier='RX100',
text='Amoxicillin',
name_of_coding_system='LOCAL'
)
iim.service_item_code = CWE(
identifier='RX-100',
text='Amoxicillin 500mg',
name_of_coding_system='NDC'
)
iim.inventory_lot_number = 'LOT9876'
iim.inventory_expiration_date = '20250315'
iim.inventory_manufacturer_name = CWE(
identifier='PHARMA',
text='PharmaCorp',
name_of_coding_system='LOCAL'
)
iim.procedure_code = CNE(
identifier='99213',
text='Office visit',
name_of_coding_system='CPT'
)Step-by-step guides for working with HL7 v2 in Zato.
IIM carries master-level inventory item data including item codes, lot numbers, expiration dates, manufacturer details, received and on-hand quantities, and associated costs. It is used to synchronize stock records between supply-chain, pharmacy, and materials-management systems.
The service_item_code field uses the CWE datatype to identify the catalogued item:
from zato.hl7v2.v2_9 import IIM, CWE
iim = IIM()
iim.service_item_code = CWE(
identifier='IV-SET-001',
text='IV Set Standard',
name_of_coding_system=
'SUPPLIERCAT'
)Set the quantity, its unit via CWE, and the cost via MO:
from zato.hl7v2.v2_9 import IIM
from zato.hl7v2.v2_9 import CWE, MO
iim = IIM()
iim.inventory_received_quantity = '50'
iim.inventory_received_quantity_unit = CWE(
identifier='EA',
text='Each',
name_of_coding_system='UCUM'
)
iim.inventory_received_item_cost = MO(
quantity='15.00',
denomination='USD'
)Use the on-hand date, quantity, and quantity unit fields together:
from zato.hl7v2.v2_9 import IIM, CWE
iim = IIM()
iim.inventory_on_hand_date = '20240601'
iim.inventory_on_hand_quantity = '120'
iim.inventory_on_hand_quantity_unit = CWE(
identifier='BX',
text='Box',
name_of_coding_system='UCUM'
)The procedure_code field uses CNE with HL7 table 0088:
from zato.hl7v2.v2_9 import IIM, CNE
iim = IIM()
iim.procedure_code = CNE(
identifier='99213',
text='Office visit',
name_of_coding_system='CPT'
)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 IIM segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | primary_key_value_iim | CWE | Required | No | - |
| 2 | service_item_code | CWE | Required | No | - |
| 3 | inventory_lot_number | ST | Optional | No | - |
| 4 | inventory_expiration_date | DTM | Optional | No | - |
| 5 | inventory_manufacturer_name | CWE | Optional | No | - |
| 6 | inventory_location | CWE | Optional | No | - |
| 7 | inventory_received_date | DTM | Optional | No | - |
| 8 | inventory_received_quantity | NM | Optional | No | - |
| 9 | inventory_received_quantity_unit | CWE | Optional | No | - |
| 10 | inventory_received_item_cost | MO | Optional | No | - |
| 11 | inventory_on_hand_date | DTM | Optional | No | - |
| 12 | inventory_on_hand_quantity | NM | Optional | No | - |
| 13 | inventory_on_hand_quantity_unit | CWE | Optional | No | - |
| 14 | procedure_code | CNE | Optional | No | HL70088 |
| 15 | procedure_code_modifier | CNE | Optional | Yes | HL70340 |
Get started with Zato and connect your systems in minutes.