HL7 QID Query Identification
HL7 field reference QID fields from HL7 v2.5.1 Show fields
QID identifies a query instance, mostly in query-cancel style workflows.
The standard describes QID this way: The QID segment contains the information necessary to uniquely identify a query. Its primary use is in query cancellation or subscription cancellation.
Query segments define what the sender is asking for, how the receiver should format the answer, and how a multi-message response is continued or limited.
A query is an interface contract. The tag, parameters, row definitions, sort/filter rules, and continuation pointers must match exactly or the receiver may return technically valid data that is not what the requester expected.
The v2.5.1 structures show QID in QCN_J01 - Cancel query/acknowledge message. That tells you where it can appear, but the implementation guide still decides which optional fields are meaningful.
For practical interface work, read the generated field panel for datatype, required, repeatable, and table details, then use the notes below to decide what the field should mean in the receiving workflow.
QID-1 is the requester's handle for this query. Echoing it back correctly is what lets the requester match a response to the question it asked.
QID-2 names the query, event, stored procedure, virtual table, or profile being invoked. This is the semantic switch for the query, so both sides need to agree on the allowed names and their parameter rules.