Schedule a demo
Segment

Product / service group

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.

6fields
5required
v2.9HL7 version
psg.py
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'

Build PSG segments in Python

How to construct and work with real-world PSG segments.

1

Laboratory group

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'
)
2

Surgical bundle

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'
)
3

Pharmacy group

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'
)

Learn by building

Step-by-step guides for working with HL7 v2 in Zato.

Frequently asked questions

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.

PSG field reference

Complete list of fields in the PSG segment, HL7 v2.9.

#Python nameDatatypeUsageRepeatableTable
1provider_product_service_group_numberEIRequiredNo-
2payer_product_service_group_numberEIOptionalNo-
3product_service_group_sequence_numberSIRequiredNo-
4adjudicate_as_groupIDRequiredNoHL70136
5product_service_group_billed_amountCPRequiredNo-
6product_service_group_descriptionSTRequiredNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python