HL7 RSP_K21 Get Person Demographics Response

HL7 message structure RSP_K21 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_K21.QUERY_RESPONSE
Query Response group No No
Patient Identification Yes No
Patient Additional Demographic No No
Next of Kin / Associated Parties No Yes
Query Response Instance Yes No
Continuation Pointer No No

RSP_K21 is the response to a QBP person-demographics query. It tells the requester whether the query was accepted, whether a person was found, and what demographic details the receiver is willing to return. The payload is patient-shaped, even though the interaction is a query response rather than an ADT event.

The practical core is MSA for message acknowledgment, QAK for query status, echoed QPD for the original question, and a repeating query-response group that can carry PID, PD1, NK1, and QRI.

A small RSP K21 example

MSH|^~\&|MPI|CITYHOSP|EHR|CITYHOSP|20260717100503||RSP^K21^RSP_K21|RSP210001|P|2.5.1 MSA|AA|QBP210001 QAK|Q210001|OK|Q21^Get Person Demographics^HL7nnn|1 QPD|Q21^Get Person Demographics^HL7nnn|Q210001|123456^^^CITYHOSP^MR PID|1||123456^^^CITYHOSP^MR~NHI1234^^^NATIONAL^NI||Smith^Jane^Anne^^Ms^^L||19800314|F|||12 High Street^^Auckland^^1010^NZ^H PD1|||CITYFAMILY^City Family Practice^L NK1|1|Smith^Alex|SPO|12 High Street^^Auckland^^1010^NZ^H QRI|1|0.98|MATCH^Matched on MRN^L

What systems do with it

The requester typically uses RSP_K21 to populate demographics, confirm identity, or decide whether a user needs to resolve candidates manually. A portal may use it to confirm enrollment. An integration engine may use it to enrich a message before routing. A clinical app may use it to avoid creating a duplicate local patient.

PID carries the actual person identifiers and demographics. PD1 can provide patient-level primary-care or living arrangement details. NK1 may return contact or next-of-kin information when the profile allows it. QRI tells the requester how confident the matching service is about the result.

How to read the structure

Start with status. MSA says whether the query message was accepted at the application layer. QAK says what happened to the query itself. A clean interface checks both before trusting the PID group.

The query-response group can repeat when the receiver returns more than one candidate. That is useful for a human search screen and dangerous for an unattended interface unless the next step is clearly defined.

Implementation traps

Do not overwrite local demographics blindly. Query responses are snapshots from another system with its own data-quality rules. Decide which fields are authoritative and which should only be displayed for confirmation.

Also watch identifier domains in PID-3. If a response returns multiple identifiers, the receiver may include local, enterprise, national, and temporary values. Mapping the wrong one into a local MRN field is a small mistake with a long operational tail.

Reference notes

The HL7 refactored pages show RSP_K21 as the response structure for person-demographics query workflows. IHE demographics query guidance uses QBP/RSP interactions to return patient demographic candidates and status. See HL7 Europe QBP_Q21 and IHE ITI-21.