HL7 v2.5.1 Specificationsv2.5.1

to moveEnter to openTry PID-5, ADT, 0004

RSP: Segment pattern response

This page lists the structures and trigger events RSP defines, taken from the standard. The written commentary that theADT page carries has not been written for RSP.

Recognising RSP messages

RSP announces itself in MSH-9 like this:

MSH-9RSP^K11^RSP_K11
  1. MSH-9.1RSPmessage code: what kind of message this is
  2. MSH-9.2K11trigger event: what happened in the real world
  3. MSH-9.3RSP_K11message structure: which segments to expect, and in what order

How to use these specifications explains MSH-9 in full, with a worked example.

Message structures

RSP takes 10 structures. The first 4 are shown in full; the rest are listed below.

RSP_K11

3 different trigger events send this structure:

The segments below are the same for all 3. HL7 varies the meaning, not the shape: there is no separate RSP_Z80 layout. What changes is MSH-9, which tells the receiver which of the 3 happened and therefore what to do with the message.

You must always send: MSH, MSA, QAK, QPD. Everything else is optional, or required only inside a group you chose to send.

SegmentNameOPTCardinality
MSHMessage HeaderR1..1
SFTSoftware SegmentO0..*
MSAMessage AcknowledgementR1..1
ERRErrorO0..1
QAKQuery AcknowledgementR1..1
QPDQuery Parameter Definition SegmentR1..1
ROW_DEFINITIONa group of 2 segments, repeated togetherO0..1
RDFin ROW_DEFINITIONR1..1
RDTin ROW_DEFINITIONO0..*
DSCContinuation PointerO0..1

R inside a group means required of that group. Send the group and you must include that segment; leave the group out and it never appears. This structure has 1 such group: ROW_DEFINITION.

RSP_K21

2 different trigger events send this structure:

The segments below are the same for all 2. HL7 varies the meaning, not the shape: there is no separate RSP_K22 layout. What changes is MSH-9, which tells the receiver which of the 2 happened and therefore what to do with the message.

SegmentNameOPTCardinality
MSHMessage HeaderR1..1
SFTSoftware SegmentO0..*
MSAMessage AcknowledgementR1..1
ERRErrorO0..1
QAKQuery AcknowledgementR1..1
QPDQuery Parameter Definition SegmentR1..1
QUERY_RESPONSEa group of 4 segments, repeated togetherO0..1
PIDin QUERY_RESPONSEPatient IdentificationR1..1
PD1in QUERY_RESPONSEAdditional DemographicsO0..1
NK1in QUERY_RESPONSENext of KinO0..*
QRIin QUERY_RESPONSEQuery Response InstanceR1..1
DSCContinuation PointerO0..1

R inside a group means required of that group. Send the group and you must include that segment; leave the group out and it never appears. This structure has 1 such group: QUERY_RESPONSE.

RSP_K23

2 different trigger events send this structure:

The segments below are the same for all 2. HL7 varies the meaning, not the shape: there is no separate RSP_K24 layout. What changes is MSH-9, which tells the receiver which of the 2 happened and therefore what to do with the message.

SegmentNameOPTCardinality
MSHMessage HeaderR1..1
SFTSoftware SegmentO0..*
MSAMessage AcknowledgementR1..1
ERRErrorO0..1
QAKQuery AcknowledgementR1..1
QPDQuery Parameter Definition SegmentR1..1
QUERY_RESPONSEa group of 1 segments, repeated togetherO0..1
PIDin QUERY_RESPONSEPatient IdentificationR1..1
DSCContinuation PointerO0..1

RSP_K25

Sent when one thing happens: K25: K25.

You must always send: MSH, MSA, QAK, QPD, RCP, STF. Everything else is optional, or required only inside a group you chose to send.

SegmentNameOPTCardinality
MSHMessage Header 2.16.R1..1
SFTSoftwareO0..*
MSAMessage Acknowledgement 2.16.R1..1
ERRError 2.16.O0..*
QAKQuery Acknowledgement 5.5.R1..1
QPDQuery Parameter Definition 5.5.R1..1
RCPResponse Control Parameter 5.5.R1..1
STAFFa group of 7 segments, repeated togetherR1..*
STFStaff 15.4.R1..1
PRAPractitioner 15.4.O0..*
ORGOrganization 15.4.O0..*
AFFAffiliation 15.4.O0..*
LANLanguage 15.4.O0..*
EDUEducation 15.4.O0..*
CERCertificateO0..*
DSCContinuation Pointer 2.16.O0..1

R inside a group means required of that group. Send the group and you must include that segment; leave the group out and it never appears. This structure has 1 such group: STAFF.

Other RSP structures

StructureNameEvents
RSP_K31K31
RSP_Q11
RSP_Z82Z82
RSP_Z86Z86
RSP_Z88Z88
RSP_Z90Z90

Trigger events

The trigger event is the real-world thing that made the message get sent. RSP defines 13.

EventNameStructure
K11K11RSP_K11
K21K21RSP_K21
K22K22RSP_K21
K23K23RSP_K23
K24K24RSP_K23
K25K25RSP_K25
K31K31RSP_K31
Z80Z80RSP_K11
Z82Z82RSP_Z82
Z84Z84RSP_K11
Z86Z86RSP_Z86
Z88Z88RSP_Z88
Z90Z90RSP_Z90