Defines a logical grouping of product/service line items within a healthcare claim or invoice. It carries the provider and payer group numbers, a sequence number, an indicator for whether the group should be adjudicated as a unit, the total billed amount, and a description. It appears in EHC claim messages (EHC^E01, EHC^E02) to organize related services for adjudication and payment processing.
from zato.hl7v2 import PSG
psg = PSG()
psg.product_service_group_sequence_number = '1'
psg.adjudicate_as_group = 'Y'
psg.product_service_group_billed_amount = '1250.00'How to construct and work with real-world PSG segments.
Group of laboratory services billed together with a total amount and group adjudication flag
from zato.hl7v2.v2_9 import PSG
from zato.hl7v2.v2_9 import EI
psg = PSG()
psg.provider_product_service_group_number = EI(
entity_identifier='GRP001',
namespace_id='HOSP'
)
psg.payer_product_service_group_number = EI(
entity_identifier='PGRP001',
namespace_id='INS'
)
psg.product_service_group_sequence_number = '1'
psg.adjudicate_as_group = 'Y'
psg.product_service_group_billed_amount = (
'1250.00'
)
psg.product_service_group_description = (
'Laboratory panel group'
)Surgical procedure group billed as a bundle with individual line adjudication disabled
from zato.hl7v2.v2_9 import PSG
from zato.hl7v2.v2_9 import EI
psg = PSG()
psg.provider_product_service_group_number = EI(
entity_identifier='GRP002',
namespace_id='HOSP'
)
psg.product_service_group_sequence_number = '2'
psg.adjudicate_as_group = 'Y'
psg.product_service_group_billed_amount = (
'8500.00'
)
psg.product_service_group_description = (
'Surgical procedure bundle'
)Pharmacy dispensing group with line-level adjudication for individual medications
from zato.hl7v2.v2_9 import PSG
from zato.hl7v2.v2_9 import EI
psg = PSG()
psg.provider_product_service_group_number = EI(
entity_identifier='GRP003',
namespace_id='HOSP'
)
psg.payer_product_service_group_number = EI(
entity_identifier='PGRP003',
namespace_id='INS'
)
psg.product_service_group_sequence_number = '3'
psg.adjudicate_as_group = 'N'
psg.product_service_group_billed_amount = (
'340.50'
)
psg.product_service_group_description = (
'Pharmacy dispensing'
)Step-by-step guides for working with HL7 v2 in Zato.
PSG groups related product/service line items within a claim. It specifies whether the group should be adjudicated as a unit or individually, carries the total billed amount for the group, and links to a provider and optionally payer group number for tracking.
When set to Y, the payer treats all line items in the group as a single unit for adjudication. When N, each line is adjudicated independently:
from zato.hl7v2.v2_9 import PSG
psg = PSG()
# Bundle adjudication
psg.adjudicate_as_group = 'Y'
# Line-level adjudication
psg.adjudicate_as_group = 'N'The provider_product_service_group_number field uses the EI datatype:
from zato.hl7v2.v2_9 import PSG, EI
psg = PSG()
psg.provider_product_service_group_number = EI(
entity_identifier='GRP001',
namespace_id='HOSP'
)Assign a string value to the product_service_group_billed_amount field:
from zato.hl7v2.v2_9 import PSG
psg = PSG()
psg.product_service_group_billed_amount = (
'1250.00'
)Both the provider and payer group numbers use the EI datatype:
from zato.hl7v2.v2_9 import PSG, EI
psg = PSG()
psg.provider_product_service_group_number = EI(
entity_identifier='GRP001',
namespace_id='HOSP'
)
psg.payer_product_service_group_number = EI(
entity_identifier='PGRP001',
namespace_id='INS'
)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 PSG segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | provider_product_service_group_number | EI | Required | No | - |
| 2 | payer_product_service_group_number | EI | Optional | No | - |
| 3 | product_service_group_sequence_number | SI | Required | No | - |
| 4 | adjudicate_as_group | ID | Required | No | HL70136 |
| 5 | product_service_group_billed_amount | CP | Required | No | - |
| 6 | product_service_group_description | ST | Required | No | - |
Get started with Zato and connect your systems in minutes.