Schedule a demo
Segment

Diagnosis and procedure

Communicates diagnosis and procedure codes used to define medical coverage policy limitations and authorizations. It carries the diagnosis code, optional procedure code, effective and expiration date/times, and the type of limitation applied. It appears in MFN master file notification messages to distribute payer coverage rules that constrain which diagnoses and procedures are covered under a given policy.

5fields
2required
v2.9HL7 version
dps.py
from zato.hl7v2 import DPS

dps = DPS()
dps.diagnosis_code_mcp = 'J18.9'
dps.effective_date_time = '20260101'

Build DPS segments in Python

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

1

Coverage limitation

Diagnosis code with a limitation type restricting coverage to a specific date range

from zato.hl7v2.v2_9 import DPS
from zato.hl7v2.v2_9 import CWE, CNE

dps = DPS()
dps.diagnosis_code_mcp = CWE(
    identifier='J18.9',
    text='Pneumonia unspecified',
    name_of_coding_system='ICD10'
)
dps.effective_date_time = '20240101'
dps.expiration_date_time = '20241231'
dps.type_of_limitation = CNE(
    identifier='LIM',
    text='Limited coverage',
    name_of_coding_system='HL70940'
)
2

Excluded diagnosis

Diagnosis excluded from coverage with no expiration date indicating a permanent exclusion

from zato.hl7v2.v2_9 import DPS
from zato.hl7v2.v2_9 import CWE, CNE

dps = DPS()
dps.diagnosis_code_mcp = CWE(
    identifier='Z00.0',
    text='General exam',
    name_of_coding_system='ICD10'
)
dps.effective_date_time = '20240601'
dps.type_of_limitation = CNE(
    identifier='EXC',
    text='Excluded',
    name_of_coding_system='HL70940'
)
3

Authorization rule

Prior authorization required for a diagnosis within the specified coverage period

from zato.hl7v2.v2_9 import DPS
from zato.hl7v2.v2_9 import CWE, CNE

dps = DPS()
dps.diagnosis_code_mcp = CWE(
    identifier='M54.5',
    text='Low back pain',
    name_of_coding_system='ICD10'
)
dps.effective_date_time = '20240101'
dps.expiration_date_time = '20250101'
dps.type_of_limitation = CNE(
    identifier='PA',
    text='Prior auth required',
    name_of_coding_system='HL70940'
)

Learn by building

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

Frequently asked questions

DPS communicates diagnosis and procedure codes that define coverage policy rules. It specifies which diagnoses are covered, limited, excluded, or require prior authorization, along with effective date ranges. It appears in master file messages for distributing payer coverage policies.

The diagnosis_code_mcp field uses the CWE datatype with HL7 table 0051:

from zato.hl7v2.v2_9 import DPS, CWE

dps = DPS()
dps.diagnosis_code_mcp = CWE(
    identifier='J18.9',
    text='Pneumonia unspecified',
    name_of_coding_system='ICD10'
)

The type_of_limitation field uses the CNE datatype with HL7 table 0940:

from zato.hl7v2.v2_9 import DPS, CNE

dps = DPS()
dps.type_of_limitation = CNE(
    identifier='LIM',
    text='Limited coverage',
    name_of_coding_system='HL70940'
)

Field 2 is not defined in the DPS segment specification. The segment jumps from position 1 (diagnosis code) directly to position 3 (effective date/time). This is an intentional gap in the HL7v2 standard.

Use the effective_date_time and expiration_date_time fields to define the coverage window:

from zato.hl7v2.v2_9 import DPS

dps = DPS()
dps.effective_date_time = '20240101'
dps.expiration_date_time = '20241231'

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.

DPS field reference

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

#Python nameDatatypeUsageRepeatableTable
1diagnosis_code_mcpCWERequiredNoHL70051
2procedure_codeCWERequiredYesHL70941
3effective_date_timeDTMOptionalNo-
4expiration_date_timeDTMOptionalNo-
5type_of_limitationCNEOptionalNoHL70940

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python