Reference·QAK Segment·QAK-3
HL7 v2 Reference

HL7 v2 QAK-3 Field Guide: Message Query Name Values and Common Mistakes

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

QAK-3 names which query definition actually got executed, and on a system that supports more than one lookup by patient, encounter, or order, mismatching this field to the wrong query is the kind of bug that only shows up once two query types are running side by side.

Quick answer

QAK-3 is the Message Query Name field. It identifies which named query the receiving system actually ran to produce this response, echoing back the query definition that was requested so the requester can confirm the response matches the lookup it asked for, especially useful when a single interface supports several distinct query types.

What this field contains

Format
Coded value, often with local text — typically a short identifying code paired with a readable name and the assigning system, mirroring how the original query specified it
Source
Copied from the query definition — the responding system reflects back the same query name the requester specified, rather than substituting its own label
Common failure
Mismatched query identity — on systems offering multiple similar queries, returning the wrong query name — or a generic placeholder — makes it impossible for the requester to confirm which lookup actually ran

Example

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

QAK-3 (Q11^EligibilityInquiryByPatient^SYNTHIB0001) is a fabricated query name identifying which lookup this synthetic response answers.

Where this trips people up

Test environments that only ever implement a single query type tend to hardcode QAK-3 to one value, so nothing catches a bug where the field gets set incorrectly once a second or third query type is added to the interface. The failure mode is subtle: the response still looks structurally valid and QAK-2 might correctly say OK, but a requester that checks QAK-3 to confirm it got an answer to the right question ends up processing eligibility data as if it were an order status result, or vice versa.

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
Test multiple query types without cross-contaminating results
Synthibase generates synthetic responses across distinct query definitions with correctly matched query names, so multi-query interfaces get tested against realistic, distinguishable traffic instead of one hardcoded case.
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.