Schedule a demo
Segment

Product / service line item

Represents an individual billable service or product within a healthcare claim, carrying the provider and payer line item numbers, the service code, effective and expiration dates, quantity, unit cost, gross and billed amounts, and physician information. It appears in EHC claim messages (EHC^E01, EHC^E02) as the most granular billing unit within the PSS/PSG/PSL claim hierarchy, supporting detailed adjudication and reimbursement.

48fields
5required
v2.9HL7 version
psl.py
from zato.hl7v2 import PSL

psl = PSL()
psl.product_service_line_item_sequence_number = '1'
psl.product_service_billed_amount = '250.00'
psl.restricted_disclosure_indicator = 'N'

Build PSL segments in Python

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

1

Lab test line item

Single laboratory test billed with service code, quantity, unit cost, and billed amount

from zato.hl7v2.v2_9 import PSL
from zato.hl7v2.v2_9 import EI, CWE

psl = PSL()
psl.provider_product_service_line_item_number = EI(
    entity_identifier='LN001',
    namespace_id='HOSP'
)
psl.payer_product_service_line_item_number = EI(
    entity_identifier='PLN001',
    namespace_id='INS'
)
psl.product_service_line_item_sequence_number = '1'
psl.product_service_code = CWE(
    identifier='80053',
    text='Comp metabolic panel',
    name_of_coding_system='CPT'
)
psl.product_service_unit_cost = '85.00'
psl.product_service_gross_amount = (
    '250.00'
)
psl.product_service_billed_amount = (
    '250.00'
)
psl.restricted_disclosure_indicator = 'N'
2

Procedure with physician

Surgical procedure line item with executing and responsible physician assignments

from zato.hl7v2.v2_9 import PSL
from zato.hl7v2.v2_9 import EI, CWE, XCN

psl = PSL()
psl.provider_product_service_line_item_number = EI(
    entity_identifier='LN002',
    namespace_id='HOSP'
)
psl.product_service_line_item_sequence_number = '2'
psl.product_service_code = CWE(
    identifier='99213',
    text='Office visit',
    name_of_coding_system='CPT'
)
psl.product_service_unit_cost = '125.00'
psl.product_service_gross_amount = (
    '375.00'
)
psl.product_service_billed_amount = (
    '375.00'
)
psl.restricted_disclosure_indicator = 'N'
psl.executing_physician_id = XCN(
    person_identifier='1234',
    family_name='SMITH',
    given_name='JOHN',
    suffix='MD'
)
psl.responsible_physician_id = XCN(
    person_identifier='5678',
    family_name='DOE',
    given_name='JANE',
    suffix='MD'
)
3

Pharmacy dispensing

Pharmacy line item with effective date, billing period, and cost factor applied

from zato.hl7v2.v2_9 import PSL
from zato.hl7v2.v2_9 import EI, CWE

psl = PSL()
psl.provider_product_service_line_item_number = EI(
    entity_identifier='LN003',
    namespace_id='HOSP'
)
psl.payer_product_service_line_item_number = EI(
    entity_identifier='PLN003',
    namespace_id='INS'
)
psl.product_service_line_item_sequence_number = '3'
psl.product_service_code = CWE(
    identifier='NDC123',
    text='Amoxicillin',
    name_of_coding_system='NDC'
)
psl.product_service_effective_date = (
    '20240301'
)
psl.product_service_unit_cost = '12.50'
psl.number_of_items_per_unit = '30'
psl.product_service_gross_amount = (
    '375.00'
)
psl.product_service_billed_amount = (
    '375.00'
)
psl.restricted_disclosure_indicator = 'N'

Learn by building

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

Frequently asked questions

PSL represents a single billable line item within a healthcare claim. It carries the service code, quantity, unit cost, billed amount, physician assignments, and various cost factors. It is the most granular level in the PSS/PSG/PSL claim hierarchy.

The product_service_code field uses the CWE datatype with HL7 table 0879:

from zato.hl7v2.v2_9 import PSL, CWE

psl = PSL()
psl.product_service_code = CWE(
    identifier='80053',
    text='Comp metabolic panel',
    name_of_coding_system='CPT'
)

Use executing_physician_id and responsible_physician_id with the XCN datatype:

from zato.hl7v2.v2_9 import PSL, XCN

psl = PSL()
psl.executing_physician_id = XCN(
    person_identifier='1234',
    family_name='SMITH',
    given_name='JOHN',
    suffix='MD'
)

Assign string values to the amount fields:

from zato.hl7v2.v2_9 import PSL

psl = PSL()
psl.product_service_unit_cost = '85.00'
psl.product_service_gross_amount = (
    '250.00'
)
psl.product_service_billed_amount = (
    '250.00'
)

This required field (HL7 table 0532) indicates whether the line item information is restricted from disclosure. Set to Y to restrict or N to allow:

from zato.hl7v2.v2_9 import PSL

psl = PSL()
psl.restricted_disclosure_indicator = 'N'

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.

PSL field reference

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

#Python nameDatatypeUsageRepeatableTable
1provider_product_service_line_item_numberEIRequiredNo-
2payer_product_service_line_item_numberEIOptionalNo-
3product_service_line_item_sequence_numberSIRequiredNo-
4provider_tracking_idEIOptionalNo-
5payer_tracking_idEIOptionalNo-
6product_service_line_item_statusCWERequiredNoHL70559
7product_service_codeCWERequiredNoHL70879
8product_service_code_modifierCWEOptionalNoHL70880
9product_service_code_descriptionSTOptionalNo-
10product_service_effective_dateDTMOptionalNo-
11product_service_expiration_dateDTMOptionalNo-
12product_service_quantityCQOptionalNoHL70560
13product_service_unit_costCPOptionalNo-
14number_of_items_per_unitNMOptionalNo-
15product_service_gross_amountCPOptionalNo-
16product_service_billed_amountCPOptionalNo-
17product_service_clarification_code_typeCWEOptionalNoHL70561
18product_service_clarification_code_valueSTOptionalNo-
19health_document_reference_identifierEIOptionalNo-
20processing_consideration_codeCWEOptionalNoHL70562
21restricted_disclosure_indicatorIDRequiredNoHL70532
22related_product_service_code_indicatorCWEOptionalNoHL70879
23product_service_amount_for_physicianCPOptionalNo-
24product_service_cost_factorNMOptionalNo-
25cost_centerCXOptionalNo-
26billing_periodDROptionalNo-
27days_without_billingNMOptionalNo-
28session_noNMOptionalNo-
29executing_physician_idXCNOptionalNo-
30responsible_physician_idXCNOptionalNo-
31role_executing_physicianCWEOptionalNoHL70881
32medical_role_executing_physicianCWEOptionalNoHL70882
33side_of_bodyCWEOptionalNoHL70894
34number_of_t_ps_ppNMOptionalNo-
35tp_value_ppCPOptionalNo-
36internal_scaling_factor_ppNMOptionalNo-
37external_scaling_factor_ppNMOptionalNo-
38amount_ppCPOptionalNo-
39number_of_t_ps_technical_partNMOptionalNo-
40tp_value_technical_partCPOptionalNo-
41internal_scaling_factor_technical_partNMOptionalNo-
42external_scaling_factor_technical_partNMOptionalNo-
43amount_technical_partCPOptionalNo-
44total_amount_professional_part_technical_partCPOptionalNo-
45vat_rateNMOptionalNo-
46main_serviceIDOptionalNo-
47validationIDOptionalNoHL70136
48commentSTOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python