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.
from zato.hl7v2 import DSP
dsp = DSP()
dsp.set_id_dsp = '1'
dsp.data_line = 'Patient: DOE, JOHN'
dsp.result_id = 'RES-001'How to construct and work with real-world DSP segments.
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'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'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'Step-by-step guides for working with HL7 v2 in Zato.
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_dspIt 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.
Complete list of fields in the DSP segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_dsp | SI | Optional | No | - |
| 2 | display_level | SI | Optional | No | - |
| 3 | data_line | TX | Required | No | - |
| 4 | logical_break_point | ST | Optional | No | - |
| 5 | result_id | TX | Optional | No | - |
Get started with Zato and connect your systems in minutes.