Carries contract details used in supply chain and procurement workflows, including the contract identifier, effective and expiration dates, supplier type, contract type, pricing terms, and the group purchasing organization. It appears in supply chain messages to communicate negotiated pricing agreements between healthcare providers, distributors, and manufacturers.
from zato.hl7v2 import CTR
ctr = CTR()
ctr.effective_date = '20260101'
ctr.expiration_date = '20261231'
ctr.contract_priority = 'HIGH'How to construct and work with real-world CTR segments.
Active contract with a distributor including effective dates and pricing tier
from zato.hl7v2.v2_9 import CTR
from zato.hl7v2.v2_9 import EI, CWE
ctr = CTR()
ctr.contract_identifier = EI(
entity_identifier='CTR001',
namespace_id='HOSP'
)
ctr.contract_description = (
'Annual supply agreement'
)
ctr.contract_status = CWE(
identifier='ACT',
text='Active',
name_of_coding_system='HL70536'
)
ctr.effective_date = '20240101'
ctr.expiration_date = '20241231'
ctr.supplier_type = CWE(
identifier='DIST',
text='Distributor',
name_of_coding_system='HL70946'
)
ctr.contract_type = CWE(
identifier='GPO',
text='Group purchase',
name_of_coding_system='HL70965'
)
ctr.pricing_tier_level = CWE(
identifier='TIER1',
text='Tier 1',
name_of_coding_system='HL70966'
)
ctr.contract_priority = 'HIGH'Fixed-price contract with a GPO and price protection date for supply chain purchasing
from zato.hl7v2.v2_9 import CTR
from zato.hl7v2.v2_9 import EI, CWE, XON
ctr = CTR()
ctr.contract_identifier = EI(
entity_identifier='CTR002',
namespace_id='HOSP'
)
ctr.contract_description = (
'Fixed price pharma'
)
ctr.effective_date = '20240601'
ctr.expiration_date = '20250531'
ctr.supplier_type = CWE(
identifier='MFG',
text='Manufacturer',
name_of_coding_system='HL70946'
)
ctr.price_protection_date = '20250101'
ctr.fixed_price_contract_indicator = 'Y'
ctr.group_purchasing_organization = XON(organization_name='HealthGPO')Sub-contract linked to a parent contract with owner and originator names
from zato.hl7v2.v2_9 import CTR
from zato.hl7v2.v2_9 import EI, CWE, XPN
ctr = CTR()
ctr.contract_identifier = EI(
entity_identifier='CTR003',
namespace_id='HOSP'
)
ctr.contract_description = (
'Sub-contract for supplies'
)
ctr.contract_status = CWE(
identifier='ACT',
text='Active',
name_of_coding_system='HL70536'
)
ctr.effective_date = '20240301'
ctr.expiration_date = '20240901'
ctr.contract_owner_name = XPN(
family_name='OWNER',
given_name='JAMES'
)
ctr.supplier_type = CWE(
identifier='DIST',
text='Distributor',
name_of_coding_system='HL70946'
)
ctr.associated_contract_id = EI(
entity_identifier='CTR001',
namespace_id='HOSP'
)Step-by-step guides for working with HL7 v2 in Zato.
CTR carries contract information for healthcare supply chain procurement. It specifies the contract identifier, dates, supplier type, pricing tier, markup limits, and links to group purchasing organizations, enabling systems to apply negotiated pricing to purchase orders.
The contract_status field uses the CWE datatype with HL7 table 0536:
from zato.hl7v2.v2_9 import CTR, CWE
ctr = CTR()
ctr.contract_status = CWE(
identifier='ACT',
text='Active',
name_of_coding_system='HL70536'
)The supplier_type field uses CWE with HL7 table 0946:
from zato.hl7v2.v2_9 import CTR, CWE
ctr = CTR()
ctr.supplier_type = CWE(
identifier='DIST',
text='Distributor',
name_of_coding_system='HL70946'
)Use the associated_contract_id field with the EI datatype:
from zato.hl7v2.v2_9 import CTR, EI
ctr = CTR()
ctr.associated_contract_id = EI(
entity_identifier='CTR001',
namespace_id='HOSP'
)The group_purchasing_organization field uses the XON datatype:
from zato.hl7v2.v2_9 import CTR, XON
ctr = CTR()
ctr.group_purchasing_organization = XON(organization_name='HealthGPO')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 CTR segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | contract_identifier | EI | Required | No | - |
| 2 | contract_description | ST | Optional | No | - |
| 3 | contract_status | CWE | Optional | No | HL70536 |
| 4 | effective_date | DTM | Required | No | - |
| 5 | expiration_date | DTM | Required | No | - |
| 6 | contract_owner_name | XPN | Optional | No | - |
| 7 | contract_originator_name | XPN | Optional | No | - |
| 8 | supplier_type | CWE | Required | No | HL70946 |
| 9 | contract_type | CWE | Optional | No | HL70965 |
| 10 | free_on_board_freight_terms | CNE | Optional | No | HL70532 |
| 11 | price_protection_date | DTM | Optional | No | - |
| 12 | fixed_price_contract_indicator | CNE | Optional | No | HL70532 |
| 13 | group_purchasing_organization | XON | Optional | No | - |
| 14 | maximum_markup | MOP | Optional | No | - |
| 15 | actual_markup | MOP | Optional | No | - |
| 16 | corporation | XON | Optional | Yes | - |
| 17 | parent_of_corporation | XON | Optional | No | - |
| 18 | pricing_tier_level | CWE | Optional | No | HL70966 |
| 19 | contract_priority | ST | Optional | No | - |
| 20 | class_of_trade | CWE | Optional | No | HL70947 |
| 21 | associated_contract_id | EI | Optional | No | - |
Get started with Zato and connect your systems in minutes.