The Demo site for our new HL7 Version 2+ (plus) Standard
visit the hl7 website

Draft Website - For Review Purposes Only

QAK - Query Acknowledgment Segment

The QAK segment contains information sent with responses to a query. The QAK segment may appear as an optional segment placed after the (optional) ERR segment in any query response (message) to any original mode query.

HL7 Attribute Table - QAK - query acknowledgment segment
Seq# Data Element Name DataType Usage Vocabulary Cardinality Item # Length C.LEN Flags
QAK
1 Query Tag ST C [0..1] 00696 32 #
2 Query Response Status ID O [0..1] 00708 [2..2]
3 Message Query Name CWE O [0..1] 01375
4 Hit Count Total NM O [0..1] 01434 10 #
5 This payload NM O [0..1] 01622 10 #
6 Hits remaining NM O [0..1] 01623 10 #

QAK-1: Query Tag (ST) 00696

Definition: This field may be valued by the initiating system to identify the query, and may be used to match response messages to the originating query. If it is valued, the responding system is required to echo it back as the first field in the query acknowledgment segment (QAK). This field differs from MSA-2-message control ID in that its value remains constant for each message (i.e., all continuation messages) associated with the query, whereas MSA-2-Message control ID may vary with each continuation message, since it is associated with each individual message, not the query as a whole. QAK-1-Query tag is not conditional on the presence of the QRD-1-Query ID field in the original mode queries; in the original mode queries QAK-1-Query tag is not used.

QAK-2: Query Response Status (ID) 00708

Definition: This field allows the responding system to return a precise response status. It is especially useful in the case where no data is found that matches the query parameters, but where there is also no error. Refer to HL7 Table 0208 – Query Response Status in Chapter 2C, Code Tables, for valid values.

QAK-3: Message Query Name (CWE) 01375

Definition: This field contains the name of the query. These names are assigned by the function-specific chapters of this specification. Site-specific event replay query names begin with the letter "Z." Refer to User defined table 0471 – Query name in Chapter 2C, Code Tables, for suggested values.

QAK-4: Hit Count Total (NM) 01434

Definition: This field, when used, contains the total number of records found by the Server that matched the query. For tabular responses, this is the number of rows found. For other response types, the Query Profile defines the meaning of a "hit."

QAK-5: This payload (NM) 01622

Definition: This field, when used, contains the total number of matching records that the Server sent in the current response. Where the continuation protocol is used to transmit the response in partial installments, this number will differ from the value sent in QAK-4-Hit count total.

QAK-6: Hits remaining (NM) 01623

Definition: This field, when used, contains the number of matching records found by the Server that have yet to be sent. It is only meaningful when the Server uses the continuation protocol to transmit partial responses.