Schedule a demo
Segment

Display data

Carries a single line of formatted display text returned by a responding system in reply to an original-mode query. Each DSP instance represents one row of output, with fields for sequence numbering, display nesting level, the actual text content, logical break points between groups, and an optional result identifier linking the row to a specific query result.

5fields
1required
v2.9HL7 version
dsp.py
from zato.hl7v2 import DSP

dsp = DSP()
dsp.set_id_dsp = '1'
dsp.data_line = 'Patient: DOE, JOHN'
dsp.result_id = 'RES-001'

Build DSP segments in Python

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

1

Single result row

Basic display row with sequence, text content, and result identifier

from zato.hl7v2.v2_9 import DSP

dsp = DSP()
dsp.set_id_dsp = '1'
dsp.data_line = 'Patient: DOE, JOHN'
dsp.result_id = 'RES-001'
2

Nested detail row

Hierarchical display row with nesting level and a logical break marker

from zato.hl7v2.v2_9 import DSP

dsp = DSP()
dsp.set_id_dsp = '3'
dsp.display_level = '2'
dsp.data_line = '  MRN: 123456'
dsp.logical_break_point = 'BREAK'
3

Summary footer line

Final display row used as a summary line at the end of query results

from zato.hl7v2.v2_9 import DSP

dsp = DSP()
dsp.set_id_dsp = '10'
dsp.data_line = 'Total records: 9'

Learn by building

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

Frequently asked questions

DSP carries pre-formatted text lines returned by a responding system in reply to an original-mode query. Each segment instance is one row of displayable output, letting the querying application render results without parsing structured data.

Create the segment and read its data_line field:

from zato.hl7v2.v2_9 import DSP

dsp = DSP()
dsp.set_id_dsp = '1'
dsp.data_line = 'DOE, JOHN  MRN: 12345'

text = dsp.data_line
seq = dsp.set_id_dsp

It specifies the nesting depth of the display row. Level 1 is the outermost grouping, level 2 is a detail within that group, and so on. Receiving applications can use the level to indent or group rows:

from zato.hl7v2.v2_9 import DSP

dsp = DSP()
dsp.set_id_dsp = '2'
dsp.display_level = '3'
dsp.data_line = '  Lab result detail'

The logical_break_point field marks a boundary between groups of display rows. When present, the receiving application can insert a visual separator (blank line, rule, page break) before the next row:

from zato.hl7v2.v2_9 import DSP

dsp = DSP()
dsp.set_id_dsp = '5'
dsp.data_line = 'End of section'
dsp.logical_break_point = 'Y'

Set the result_id field to associate the row with a specific query result or identifier:

from zato.hl7v2.v2_9 import DSP

dsp = DSP()
dsp.set_id_dsp = '1'
dsp.data_line = 'Patient: DOE, JOHN'
dsp.result_id = 'Q-2024-0042'

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.

DSP field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_dspSIOptionalNo-
2display_levelSIOptionalNo-
3data_lineTXRequiredNo-
4logical_break_pointSTOptionalNo-
5result_idTXOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python