Expresses clinical relationships between data elements within or across messages at runtime, using source and target instance identifiers and a relationship type code (such as "has cause" or "has component"). Introduced in v2.6, it appears in patient care and clinical genomics messages to link observations, diagnoses, problems, and goals when the standard segment hierarchy alone is insufficient.
from zato.hl7v2.v2_9 import REL
from zato.hl7v2.v2_9 import CWE, EI
rel = REL()
rel.set_id_rel = '1'
rel.relationship_type = CWE(
identifier='COACH',
text='Wellness Coach'
)How to construct and work with real-world REL segments.
Patient to fitness coach link
from zato.hl7v2.v2_9 import REL
from zato.hl7v2.v2_9 import CWE, EI, DTM
rel = REL()
rel.set_id_rel = '1'
rel.relationship_type = CWE(
identifier='COACH',
text='Wellness Coach'
)
rel.this_relationship_instance_identifier = EI(entity_identifier='PAT001')
rel.source_information_instance_identifier = EI(entity_identifier='COACH001')Patient to dietitian link
from zato.hl7v2.v2_9 import REL
from zato.hl7v2.v2_9 import CWE, EI
rel = REL()
rel.set_id_rel = '2'
rel.relationship_type = CWE(
identifier='NUTR',
text='Nutritionist'
)
rel.this_relationship_instance_identifier = EI(entity_identifier='PAT002')
rel.source_information_instance_identifier = EI(entity_identifier='RD001')Patient to care team link
from zato.hl7v2.v2_9 import REL
from zato.hl7v2.v2_9 import CWE, EI
rel = REL()
rel.set_id_rel = '3'
rel.relationship_type = CWE(
identifier='COORD',
text='Care Coordinator'
)
rel.this_relationship_instance_identifier = EI(entity_identifier='PAT003')
rel.source_information_instance_identifier = EI(entity_identifier='COORD001')Step-by-step guides for working with HL7 v2 in Zato.
REL contains clinical relationship information including relationship types and related entities for wellness care coordination.
Common wellness relationship types include COACH (wellness coach), NUTR (nutritionist), and COORD (care coordinator).
Use relationship_type field with CWE datatype:
rel.relationship_type = CWE(
identifier='COACH',
text='Wellness Coach'
)REL defines relationships between entities while ROL defines roles in specific contexts. Both are used for wellness care team coordination.
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 REL segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_rel | SI | Optional | No | - |
| 2 | relationship_type | CWE | Required | No | HL70948 |
| 3 | this_relationship_instance_identifier | EI | Required | No | - |
| 4 | source_information_instance_identifier | EI | Required | No | - |
| 5 | target_information_instance_identifier | EI | Required | No | - |
| 6 | asserting_entity_instance_id | EI | Optional | No | - |
| 7 | asserting_person | XCN | Optional | No | - |
| 8 | asserting_organization | XON | Optional | No | - |
| 9 | assertor_address | XAD | Optional | No | - |
| 10 | assertor_contact | XTN | Optional | No | - |
| 11 | assertion_date_range | DR | Optional | No | - |
| 12 | negation_indicator | ID | Optional | No | HL70136 |
| 13 | certainty_of_relationship | CWE | Optional | No | - |
| 14 | priority_no | NM | Optional | No | - |
| 15 | priority_sequence_no_rel_preference_for_consideration | NM | Optional | No | - |
| 16 | separability_indicator | ID | Optional | No | HL70136 |
| 17 | source_information_instance_object_type | ID | Optional | No | HL70203 |
| 18 | target_information_instance_object_type | ID | Optional | No | HL70203 |
Get started with Zato and connect your systems in minutes.