HL7 Query/Response Conformance StatementsCopyright Ringholm bv © 2002,2008 All Rights Reserved. Abstract
Query/Response Conformance Statements are used to specify the behavior and format of HL7 query messages and their related response messages. Even though 95% of all HL7 query interfaces are relatively straightforward Conformance Statements contribute to the goal of creating testable and verifyable HL7 message interfaces. Query/Response Conformance Statements are defined in chapter 5 of HL7 version 2.4 and higher.
1. IntroductionThe core elements of the HL7 standard are Message Structures and Trigger Events. A Trigger Event refers to a real-world event which causes a related message structure to be sent. The exchange of a message between applications is referred to as a message interaction. HL7 supports three different message interaction models:
![]() In case of the declarative message interaction model, the Trigger Event is caused by an event within a sending application (e.g. a patient has been discharged, a discharge note has been finalized). The application transmits a message once a Trigger Event occurs to notify others of the event. A distribution mechanism ensures that all systems which might need this information will receive a copy of this message. The sending application or a message broker may be responsible for the distribution of the messages. The receiving application may have to respond to the message with an acknowledgement if the sending application so requested in its message. In case of the imperative message interaction model, the Trigger Event is caused by an event within an application (e.g. a lab order has been created). The application transmits a message once a Trigger Event occurs. The message contains a service request which has to be performed by the receiving application (e.g. "perform this laboratory order"). The receiving application has to respond with an application level response as soon as the requested task has been performed. (e.g. as soon as the laboratory results become available). ![]() In case of the interrogative message interaction model, the Trigger Event is related to the receipt of a query message. The application which receives the query message has to respond with a response message.
2. Query VariationsQuery messages and Response message can be constructed in various ways. During the development process of the various HL7 version 2.x standards new ways of specifying queries have been added.The method of specifying Query Parameters can be done in one of three ways:
Given that there are many variations in the structure of query and response messages, you need to have a way of formally describing them. HL7 versions 2.4 and higher address this by provide a means for this purpose by way of Query/Response Conformance Statements. The next section describes the various parts of a Query/Response Conformance Statement.
3. Structure of a Query/Response Conformance StatementA Query/Response Conformance Statement is comprised of optional as well as mandatory parts, which can be combined according to the type of query. Each part can be represented in form of a table. A Query/Response Conformance Statement is comprised of the following parts:
The introduction contains an overview of the Query and its related Response in terms of event codes and message types. An example is shown below.
The structure of the Query and the Response messages are described using the standard abstract message syntax definition tables. If the structure of a response message is equal to that of a message published in the standard a reference to the message structure suffices. Based on the example message definition table shown below: using the group name the Conformance Statement could identify if the response should contain both the OBRG group and the OBXG group, or only those segments contained in the OBRG group.
If there are no existing segments in the HL7 standard that match the requirement of the response message, a Table oriented response should be used instead of a Segment oriented response. The RDT and RDF segments contained in Table oriented response messages control the contents and the structural definition of the table including data types, optionalities and other conditions.
If the response is in the form of Formatted Text the Query/Response Conformance Statement contains an example of the response message.
4. ConclusionQuery/Response Conformance Statements are a very useful mechanism to document the structure of Query and Response messages. Especially for complicated queries its use should be seen as mandatory. Query/Response Conformance Statements, which relate to Query and Response messages (and the structure of which is defined in chapter 5) should not be confused with Message Conformance Profiles, which relate to all HL7 messages. The structure of Message Conformance Profiles is defined in chapter 2.12. 5. References[HL7] "HL7 2.5", 2005, http://www.hl7.org/, chapter 5 "Query". About Ringholm bvRingholm bv is a group of European experts in the field of messaging standards and systems integration in healthcare IT. We provide the industry's most advanced training courses and consulting on healthcare information exchange standards. |