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.
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 | # |
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.
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.
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.
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."
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.
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.