HL7 RSP_K11 Segment Pattern Response

HL7 message structure RSP_K11 groups and segments from HL7 v2.5.1 Hide structure

These are the generated groups and segments for the version selected at the top of the page. The article explains the workflow, and this panel follows the chosen HL7 version.

Message Structure

SegmentNameRequiredRepeatable
Message Header Yes No
Software Segment No Yes
Message Acknowledgment Yes No
Error No No
Query Acknowledgment Yes No
Query Parameter Definition Yes No
RSP_K11.ROW_DEFINITION
Row Definition group No No
Table Row Definition Yes No
Table Row Data No Yes
Continuation Pointer No No

RSP_K11 is the response side of the query-by-parameter pattern. The requester sends a QBP_Q11, and the receiver returns an RSP_K11 with acknowledgment status, query status, the echoed query definition, and optional row-style result content.

In real interfaces, this message often feels more like an API response than a clinical event. The important thing is not just whether the message parsed. It is whether MSA, QAK, QPD, and the returned data all agree about what question was answered.

A small RSP K11 example

MSH|^~\&|MPI|CITYHOSP|PORTAL|CITYHOSP|20260717100002||RSP^K11^RSP_K11|RSP110001|P|2.5.1 MSA|AA|QBP110001 QAK|Q110001|OK|Q11^Patient lookup by MRN^HL7nnn|1 QPD|Q11^Patient lookup by MRN^HL7nnn|Q110001|123456^^^CITYHOSP^MR RDF|2|PatientID^CX^20~PatientName^XPN^48 RDT|123456^^^CITYHOSP^MR|Smith^Jane^Anne^^Ms^^L

What systems do with it

The receiver sends RSP_K11 after it evaluates the query parameters. The requester uses the message to continue a workflow, populate a screen, confirm an identifier, or decide that manual review is needed. Integration engines often use this pattern to enrich a message before routing it onward.

ERR and QAK are just as important as the returned data. ERR explains syntax or application problems. QAK tells the requester whether the query succeeded, found no data, hit a limit, or was rejected by the receiver's query rules.

How to read the structure

MSA acknowledges the original message control ID from MSH-10. QAK echoes the query tag from QPD and carries the query response status. QPD should match the original query definition closely enough that the requester can log exactly what was asked.

The optional row-definition group is where RSP_K11 becomes a segment-pattern response. RDF describes the columns, and each RDT carries one row of values. That can be useful, but it also means both sides must agree on datatypes, order, repetitions, and null handling.

Implementation traps

Do not treat the presence of MSA-1 AA as proof that a useful result exists. A receiver can accept the query message and still return a QAK status that means no match or no data. Your integration logic should read both layers.

Also be careful with row definitions that change over time. If the receiver adds a column to RDF and the requester maps RDT by position, an apparently harmless change can shift every downstream value into the wrong field.

Reference notes

HL7's refactored RSP_K11 description shows the response layout with MSH, MSA, ERR, QAK, QPD, an optional row definition, and DSC for continuation. See the HL7 Europe RSP_K11 and QBP_Q11 pages.