QAK-2 in HL7 v2: A Field Guide to Query Response Status
QAK-2 is the two-letter verdict that decides whether a querying system should read the rest of the response as real data, treat it as an empty result, or route it to error handling — and it is the field most query test suites never vary away from the success case.
QAK-2 is the Query Response Status field. It carries a short coded value telling the requesting system how the query went: data was found, the query ran cleanly but nothing matched, or the receiving application had trouble processing the request at all. Each value is meant to send the requester down a different handling path.
Valid code values
Example
QAK-2 (OK) marks this synthetic response as a successful query with results, paired with a fabricated tag and query name.
Where this trips people up
Because OK is the only status that comes with a populated result set, test suites built around a handful of captured real responses tend to only ever exercise OK, leaving the empty-result and error branches of the requester's logic completely unproven. Teams also sometimes treat NF as a failure state and route it into error handling, when a query that ran correctly and simply found nothing is a normal, expected outcome that should be handled differently from AE or AR, which represent the query actually breaking.