HL7 DOC_T12 Document Query Response
DOC_T12 is the document query response structure used with the older QRY/DOC document-query workflow. A sending system asks for documents, and the DOC response returns query status plus one or more document records with patient, visit, TXA document header, and optional OBX content.
This is an older-style query pattern. You will still see it in reference data and in some document-management interfaces, but many modern implementations use profile-specific APIs, repositories, or newer query patterns instead. When DOC_T12 is present, treat it as a precise local contract rather than a generic search result format.
A small DOC_T12 example
What systems do with it
The sender is the document repository or document-management application answering a query. The receiver is the application that requested the document list or document content. MSA and ERR report the message/application outcome. QAK reports query status, and QRD echoes the original-style query definition.
The repeating document group carries PID, PV1, TXA, and optional OBX content. DSC can carry a continuation pointer when the result set is too large for one response.
How to read the structure
The required top-level segments are MSH, MSA, QRD, and at least one document-support group. ERR and QAK are optional in the local v2.5.1 structure, but in a practical query interface QAK is usually the first place people look to understand whether the query found records.
Each document-support group requires PID, PV1, and TXA. OBX repeats when content or extracted document text is returned. That means DOC_T12 can be a document index response, a document content response, or a hybrid, depending on the profile.
Implementation traps
The first trap is assuming OBX is always present. If the interface is returning only a list of document headers, TXA may be the main payload and the content may be fetched elsewhere. If the interface returns OBX content, define whether OBX-5 is plain text, encoded data, formatted text, or a profile-specific representation.
The second trap is continuation. If DSC is populated, the receiver has not necessarily seen the full result set. Ignoring DSC can quietly hide older notes, large reports, or later pages of a document list.
The third trap is patient matching. Query responses carry patient identifiers back in PID, but the receiver still needs to verify that the result belongs to the requested patient and organization before filing or displaying it.
Reference notes
The HL7 v2.5 event reference describes Event T12 as QRY/DOC document query, with QRY as the sending side and DOC as the receiving response structure. The Caristix trigger-event index also lists DOC_T12 as a document response used to retrieve a list of documents or a specific document.