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:
RSP^K11^RSP_K11- MSH-9.1
RSPmessage code: what kind of message this is - MSH-9.2
K11trigger event: what happened in the real world - MSH-9.3
RSP_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.
| Segment | Name | OPT | Cardinality |
|---|---|---|---|
| MSH | Message Header | R | 1..1 |
| SFT | Software Segment | O | 0..* |
| MSA | Message Acknowledgement | R | 1..1 |
| ERR | Error | O | 0..1 |
| QAK | Query Acknowledgement | R | 1..1 |
| QPD | Query Parameter Definition Segment | R | 1..1 |
| ROW_DEFINITION | a group of 2 segments, repeated together | O | 0..1 |
| RDFin ROW_DEFINITION | R | 1..1 | |
| RDTin ROW_DEFINITION | O | 0..* | |
| DSC | Continuation Pointer | O | 0..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.
| Segment | Name | OPT | Cardinality |
|---|---|---|---|
| MSH | Message Header | R | 1..1 |
| SFT | Software Segment | O | 0..* |
| MSA | Message Acknowledgement | R | 1..1 |
| ERR | Error | O | 0..1 |
| QAK | Query Acknowledgement | R | 1..1 |
| QPD | Query Parameter Definition Segment | R | 1..1 |
| QUERY_RESPONSE | a group of 4 segments, repeated together | O | 0..1 |
| PIDin QUERY_RESPONSE | Patient Identification | R | 1..1 |
| PD1in QUERY_RESPONSE | Additional Demographics | O | 0..1 |
| NK1in QUERY_RESPONSE | Next of Kin | O | 0..* |
| QRIin QUERY_RESPONSE | Query Response Instance | R | 1..1 |
| DSC | Continuation Pointer | O | 0..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.
| Segment | Name | OPT | Cardinality |
|---|---|---|---|
| MSH | Message Header | R | 1..1 |
| SFT | Software Segment | O | 0..* |
| MSA | Message Acknowledgement | R | 1..1 |
| ERR | Error | O | 0..1 |
| QAK | Query Acknowledgement | R | 1..1 |
| QPD | Query Parameter Definition Segment | R | 1..1 |
| QUERY_RESPONSE | a group of 1 segments, repeated together | O | 0..1 |
| PIDin QUERY_RESPONSE | Patient Identification | R | 1..1 |
| DSC | Continuation Pointer | O | 0..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.
| Segment | Name | OPT | Cardinality |
|---|---|---|---|
| MSH | Message Header 2.16. | R | 1..1 |
| SFT | Software | O | 0..* |
| MSA | Message Acknowledgement 2.16. | R | 1..1 |
| ERR | Error 2.16. | O | 0..* |
| QAK | Query Acknowledgement 5.5. | R | 1..1 |
| QPD | Query Parameter Definition 5.5. | R | 1..1 |
| RCP | Response Control Parameter 5.5. | R | 1..1 |
| STAFF | a group of 7 segments, repeated together | R | 1..* |
| STF | Staff 15.4. | R | 1..1 |
| PRA | Practitioner 15.4. | O | 0..* |
| ORG | Organization 15.4. | O | 0..* |
| AFF | Affiliation 15.4. | O | 0..* |
| LAN | Language 15.4. | O | 0..* |
| EDU | Education 15.4. | O | 0..* |
| CER | Certificate | O | 0..* |
| DSC | Continuation Pointer 2.16. | O | 0..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
| Structure | Name | Events |
|---|---|---|
| RSP_K31 | K31 | |
| RSP_Q11 | ||
| RSP_Z82 | Z82 | |
| RSP_Z86 | Z86 | |
| RSP_Z88 | Z88 | |
| RSP_Z90 | Z90 |
Trigger events
The trigger event is the real-world thing that made the message get sent. RSP defines 13.
| Event | Name | Structure |
|---|---|---|
| K11 | K11 | RSP_K11 |
| K21 | K21 | RSP_K21 |
| K22 | K22 | RSP_K21 |
| K23 | K23 | RSP_K23 |
| K24 | K24 | RSP_K23 |
| K25 | K25 | RSP_K25 |
| K31 | K31 | RSP_K31 |
| Z80 | Z80 | RSP_K11 |
| Z82 | Z82 | RSP_Z82 |
| Z84 | Z84 | RSP_K11 |
| Z86 | Z86 | RSP_Z86 |
| Z88 | Z88 | RSP_Z88 |
| Z90 | Z90 | RSP_Z90 |