HL7 VQQ_Q07 Virtual Table Query
VQQ_Q07 asks for data from a virtual table using the VTQ segment. The table is "virtual" because the receiver defines the logical table and selection rules, not because the sender gets to browse a database freely.
The usual response is tabular, often with an RDF/RDT-style response such as TBR_R08.
A small VQQ Q07 example
What systems do with it
The requester names a virtual table and selection criteria. The responder evaluates those criteria against its agreed view of the data and returns rows in an agreed response message.
These queries are usually local. The same table name on two systems should not be assumed to mean the same thing unless the interface guide says so.
How to read the structure
MSH identifies VQQ^Q07^VQQ_Q07. VTQ carries the query tag, response format, query name, virtual table name, and selection criteria. Optional RDF can describe expected response columns. Optional DSC supports continuation.
Implementation traps
Do not expose arbitrary tables. Treat virtual table names as an allowlist of stable, documented query views.
Also define the response schema tightly. A virtual table query is only useful if the requester knows exactly how to parse the returned columns.
Reference notes
HL7 v2.3.1 Chapter 2 describes virtual table queries alongside embedded query language, stored procedure, display, and tabular query patterns. See the HL7 v2.3.1 control/query chapter.