Previous Page TOC Index Next Page

2.2.4 Queries

A different data exchange occurs when one system sends a query to another. For example, in a cardiac catheterization application, there may be a trigger event a procedure is scheduled for a patient who is not already registered in the cardiac catheterization application’s database. The application may send a request message containing the patient’s ID number to the ADT system and receive a response containing the necessary data to permit processing of the order. This requesting transaction is a query, as distinguished from the unsolicited update discussed above. The information that flows between the systems is contained in the response. The response itself is not acknowledged with a third message.

In all cases, the HL7 Standard consists of a simple exchange of messages between a pair of applications: the unsolicited update and its acknowledgment or the query and its response. The underlying operational model is that of a client and a server. An application interfaces with another application using an event code that identifies the transaction. The other application responds with a message that includes data or an error indication. The initiating application may receive a reject status from the other application or from lower level software indicating that its message was not received correctly.

HL7 queries can be formulated using one of several methods:

1. HL7 "query filters," defined via the QRD and QRF segments. These are supported as in previous releases of HL7, and are referred to as "original mode" queries.

2. Embedded Query Language select statements, which enable the querying system to format the request as a free-form [ Although referred to as "free-form," the functional chapters of this specification define this field for commonly used queries.] query statement, using the query language of choice (e.g., SQL).

3. Virtual Table Request, which is similar in function to the Embedded Query Language message, but more rigorously formatted with delimiters.

4. Stored Procedure Requests, which invoke units of program code on the responding system that are built to satisfy a specific query (e.g., predefined queries, SQL stored procedures).

Since the predefined queries supported by HL7 are limited in number and precisely-defined, each has a corresponding stored procedure name and parameter list associated with it. Refer to the functional chapters for the lists of supported queries.

5. Event Replay Queries, which are requests for data formatted as event messages.

HL7 includes SQL select statements as an alternate means of encoding query selection criteria. This alternative is offered as a convenience to implementors, and in no way implies that server systems must support generic SQL or be based on relational database technology.

These queries are defined in the appropriate chapters of this specification.

Previous Page TOC Index Next Page