HL7 QVR_Q17 Query for Previous Events

HL7 message structure QVR_Q17 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
Query Parameter Definition Yes No
QVR_Q17.QBP
Qbp group No No
anyHL7Segment
Anyhl7segment group Yes No
Response Control Parameter Yes No
Continuation Pointer No No

QVR_Q17 asks a responder for previous events. It is a query-style message that can carry normal QPD parameters and, when useful, an example HL7 segment that describes the kind of event being requested.

Think of it as a safer, more explicit cousin of replay-by-email: it asks the source system to locate prior events under a defined query contract.

A small QVR Q17 example

MSH|^~\&|ENGINE|CITYHOSP|ADTARCHIVE|CITYHOSP|20260718155000||QVR^Q17^QVR_Q17|QVRQ170001|P|2.5.1 QPD|Q17^Previous ADT events^HL7nnn|QPREV001|123456^^^CITYHOSP^MR|20260701000000|20260717235959 EVN|A08|20260715100000 RCP|I|20^RD

What systems do with it

The requester asks for historical messages or events matching a patient, date range, event type, location, or other profile-defined parameters. The optional query-by-example segment can help the responder understand what kind of event is being requested.

The response pattern depends on the profile. Some responders return a query response. Others trigger replay of matching events through an operational feed.

How to read the structure

MSH identifies QVR^Q17^QVR_Q17. QPD carries the query name, tag, and parameters. The optional QBP group can contain an HL7 segment such as EVN to express a query-by-example hint. RCP controls response timing and limits. DSC supports continuation.

Implementation traps

Define exactly what "previous event" means. Is it the original message, the latest corrected business event, the audit record, or a regenerated message? Those are different things operationally.

Also add replay safeguards. QVR_Q17 can produce old messages that downstream systems already processed years ago.

Reference notes

HL7 v2 includes QVR_Q17 as a query for previous events. The local v2.5.1 structure shows QPD, optional query-by-example content, RCP, and DSC.