Overrides the default cost-center assignment for a patient charge, allowing specific transactions to be routed to an alternate account number. It carries the transaction code, the replacement cost-center account, and the monetary amount of the exception. The segment appears in charge-posting and financial messages when standard departmental billing rules need to be bypassed for individual line items.
from zato.hl7v2 import PCE
pce = PCE()
pce.set_id_pce = '1'
pce.transaction_code = 'LABCHEM'How to construct and work with real-world PCE segments.
Redirecting a lab charge to a research cost center with a fixed amount
from zato.hl7v2.v2_9 import PCE
from zato.hl7v2.v2_9 import CX, CWE, CP
pce = PCE()
pce.set_id_pce = '1'
pce.cost_center_account_number = CX(id_number='RES-4400')
pce.transaction_code = CWE(
identifier='LABCHEM',
text='Lab Chemistry',
name_of_coding_system=
'HL70132'
)
pce.transaction_amount_unit = CP(price='125.00')Routing a radiology charge to an outpatient billing cost center
from zato.hl7v2.v2_9 import PCE
from zato.hl7v2.v2_9 import CX, CWE, CP
pce = PCE()
pce.set_id_pce = '2'
pce.cost_center_account_number = CX(id_number='OP-7200')
pce.transaction_code = CWE(
identifier='RADXR',
text='Radiology XR',
name_of_coding_system=
'HL70132'
)
pce.transaction_amount_unit = CP(price='85.50')Assigning a pharmacy charge to a clinical trial account
from zato.hl7v2.v2_9 import PCE
from zato.hl7v2.v2_9 import CX, CWE, CP
pce = PCE()
pce.set_id_pce = '3'
pce.cost_center_account_number = CX(id_number='CT-9100')
pce.transaction_code = CWE(
identifier='PHARMA',
text='Pharmacy',
name_of_coding_system=
'HL70132'
)
pce.transaction_amount_unit = CP(price='250.00')Step-by-step guides for working with HL7 v2 in Zato.
PCE overrides the default cost-center assignment for specific patient charges. It is used in financial and charge-posting messages when a transaction must be billed to an account different from the department default.
The cost_center_account_number uses the CX datatype with HL7 table 0319:
from zato.hl7v2.v2_9 import PCE, CX
pce = PCE()
pce.set_id_pce = '1'
pce.cost_center_account_number = CX(id_number='RES-4400')The transaction_code field uses CWE with HL7 table 0132:
from zato.hl7v2.v2_9 import PCE, CWE
pce = PCE()
pce.set_id_pce = '1'
pce.transaction_code = CWE(
identifier='LABCHEM',
text='Lab Chemistry',
name_of_coding_system=
'HL70132'
)The transaction_amount_unit field uses the CP (composite price) datatype:
from zato.hl7v2.v2_9 import PCE, CP
pce = PCE()
pce.set_id_pce = '1'
pce.transaction_amount_unit = CP(price='125.00')Access the fields directly after creating the segment:
from zato.hl7v2.v2_9 import PCE
pce = PCE()
pce.set_id_pce = '1'
pce.transaction_code = 'LABCHEM'
set_id = pce.set_id_pce
code = pce.transaction_codeZato 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 PCE segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_pce | SI | Required | No | - |
| 2 | cost_center_account_number | CX | Optional | No | HL70319 |
| 3 | transaction_code | CWE | Optional | No | HL70132 |
| 4 | transaction_amount_unit | CP | Optional | No | - |
Get started with Zato and connect your systems in minutes.