Reference·QAK Segment·QAK-1
HL7 v2 Reference

HL7 v2 QAK-1 (Query Tag): Format, Values, and Testing Notes

Jul 28, 2026 · 4 min read
QAK-2 →

QAK-1 is a short identifier with one job — letting a system that fired off several queries figure out which response belongs to which request — and it is routinely left blank or hardcoded in test fixtures that never send more than one query at a time.

Quick answer

QAK-1 is the Query Tag field. The requesting system generates this value and attaches it to the outgoing query; the responding system is expected to copy it unchanged into its response so the two messages can be matched up, even when multiple queries from the same sender are in flight at once.

What this field contains

Format
String, requester-defined — no fixed structure is imposed by the responding system — it must simply reproduce the requester's original tag verbatim
Source
Set on the original query — the requesting system assigns the tag before sending the query; the responder never invents a new one
Common failure
Dropped or regenerated tags — if the responding system fails to copy the tag through, or replaces it with something of its own, correlation on the requester side silently breaks

Example

Synthetic example Generated by Synthibase
QAK|Q1042|OK|Q11^EligibilityInquiryByPatient^SYNTHIB0001

QAK-1 (Q1042) is a fabricated query tag standing in for the identifier the requester would have generated for this lookup.

Where this trips people up

It's easy to write query-response test fixtures where the tag is a static placeholder value, since a single-threaded test harness never actually needs to distinguish one query from another. That gap stays invisible until a production system starts firing concurrent queries and discovers that responses are arriving with tags that don't match anything in its pending-query table, usually surfacing as queries that appear to time out even though a response technically came back.

Testing HL7 v2 QAK: The Fields Your System Actually Needs to Handle
EDI 999 vs 997: What's the Difference and Why It Matters
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Keep query responses correctly correlated in test data
Synthibase threads matching query tags from request to response across your synthetic query sets, so correlation logic gets a genuine test instead of a false pass.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.