Query Infrastructure

ANSI
ANSI/HL7 V3 IM, R1-2004
HL7 Version 3 Standard: Infrastructure Management: Query Infrastructure
10/20/2004
Responsible Group Infrastructure and Messaging Work Group
HL7
Control Query Co-Chair Graham Grieve
Kestral Computing Pty Ltd.
Control Query Co-Chair Mike Henderson
Eastern Informatics
Control Query Co-Chair Joann Larson
Kaiser Permanente
Primary Contributor Dale Nelson
Zed-Logic Informatics, LLC
Control Query Co-Chair Jennifer Puyenbroek
McKesson Information Solutions
Primary Contributor Larry Reis
LR Consulting
Primary Contributor Mark Shafarman
Oracle Corporation
Control Query Co-Chair Rene Spronk
Ringholm, GmbH
Primary Contributor Mark Tucker
Regenstrief Institute for Health Care

Content Last Edited: 2005-06-20T19:05:04



Table of Contents


Preface
    i Notes to Readers
    ii Message Design Element Navigation
Overview
    1.1 Introduction & Scope
    1.2 Domain Information Models
Query By Parameter Topic
    2.1 Introduction
    2.2 Storyboards
    2.3 Application Roles
    2.4 Trigger Events
    2.5 Refined Message Information Models
    2.6 Hierarchical Message Descriptions
    2.7 Interactions
Quality Analysis Report Topic
4  CMETs Used by this Domain
5  Interactions Annex
    5.1 By Application Role
    5.2 By Trigger Event
    5.3 By Message Type
6  Glossary

This represents the normative content for Version 3, Release 1.

 Query By Parameter Topic ()
 
pointer Query Control Act Request : Parameter List (QUQI_RM020000UV01
pointer Query Control Act Request : Query By Parameter (QUQI_RM021000UV01
pointer Query Control Act Request Continue / Cancel (QUQI_RM000001UV01
pointer Query Control Act Response / Acknowledgement (QUQI_RM120000UV01

Scope

The Query Infrastructure domain specifies the formation of information queries and the responses to these queries to meet the needs of healthcare applications using the HL7 version 3 messaging standard.

Introduction

The Health Level Seven (HL7) Standard applies to the electronic exchange of data in all healthcare environments. Within the context of healthcare messaging, the HL7 standard is primarily concerned with the data content of exchanges between healthcare applications, the sequence or interrelationships in the flow of messages and the communication of significant application level exceptions or error conditions.

This chapter addresses the formation of information queries and the responses to these queries to meet the needs of healthcare applications using the HL7 version 3 messaging standard.

Overview of Query Requests and Responses in HL7 Messaging in Version 3

Queries in Version 3 are supported by a generic framework for expressing (a) common queries that have been used by applications using the HL7 standard or (b) new queries that can be specified by a valid use case in the domain of healthcare information management. It is the intent of the HL7 Standard to facilitate establishing such interactions between heterogeneous applications.

The HL7 Standard embraces the most common queries that are likely to occur. These are defined within functional application domains. The following represents typical examples of queries supported by the Standard:

  1. data regarding a single patient, e.g., send all lab results for patient #123456

  2. data regarding multiple patients, e.g., send the list of patients whose attending physician is Dr. #123

  3. data that are not patient related, e.g., send the age specific normal values for serum protein

  4. data within a specified time range, e.g., send all serum glucose results, reported between January 1, 1998 through December 31, 1999, for patient #123456

The variety of potential queries is almost unlimited. HL7 does not try to cover every possible query. Rather, the Standard provides general methods by which to structure query/response pairs. The technical committees responsible for functional domains apply these methods to develop specific query/response pairs for those domains' needs.

In particular, there is no implication that a specific system must support generalized queries to comply with the Standard. Rather, these transactions provide a format by which a system may support queries to the extent it desires. The resources available and local policies will influence the type of queries that are implemented.

Query Development Methodology Summary

An institution, or data owner, decides that it would like to make information available via a query. It decides precisely what data will be made available and how it will be offered.

The data owner specifies exactly which input variables the data requestor can use to control the data that the data owner agrees to return. The complete specification of what data are available, how the data will be returned, and what variables can be valued or constrained should be provided for both the query and the response.

An example of the application of this methodology is provided for a set of MPI person/patient queries that are presented in the Patient Administration Query Domain discussion.

Framework for Supporting a Query by Parameter Mechanism

HL7 Version 3 offers a query by parameter mechanism. A data-requesting application sends values within a set of input parameters as specified by a data-serving application. The data-serving application processes the input parameter values sent to it, and constructs a result set, which it returns (in whole or in parts) to the data-requesting application.

The specification process for the query and response is outlined below. Afterward, we discuss the mechanism for continuing or canceling an established HL7 query session.

The Query Specification Message

The structure of an HL7 V3 composite message payload for a query specification consists of three parts :

  • The HL7 transmission wrapper. Refer to Transmission Infrastructure

  • A query specification control act

  • A parameter definition structure that is specified as required for each domain defined query

The parameter definition structure for the query by parameter query specification is an information structure that may be similar in form for many query implementations but differentiated by constraints on attribute values as described as follows. Input variables are specified by parameter repetitions. The query by parameter specification mechanism also supports the identification of a name of a list of parameter values followed by a parameter repetition. Refer to the Query Infrastructure D-MIM walk-through for details on classes and attributes.

The parameter definition structure is essentially the domain committee-defined content for a query specification message. This structure is conveyed in the intermediate query specification control act.

The Query Response Message

An HL7 V3 composite Query Response Message is prepared by an HL7 V3 Query Fulfiller application role in response to receiving a Query Specification Message. The structure of this HL7 V3 composite message payload consists of the HL7 transmission wrapper, a query response control act and a domain committee-defined message type.

The query response control act requires only one attribute to identify the query session to which the query response message is associated. Refer to the Query Infrastructure D-MIM walk-through for details of the classes and attributes.

The domain committee-defined query response structure is RIM content specified as a V3 message type artifact. It has an identifier that appears in the query specification. It should be noted that a domain committee might define one query response structure that is the focus of several query specification messages.

The Query Continuation Message

The Query Continuation Message is a query control message that applies to the logical level of a query session that is controlled by the applications that implement the HL7 V3 Query Placer and Query Fulfiller application roles. The structure of this HL7 V3 composite message payload consists of the HL7 transmission wrapper and a minimal query control act. The control act only requires a subset of the attributes and a minimum of query continuation attributes. Refer to the Query Infrastructure D-MIM walk-through for details of the classes and attributes. The query identifier uniquely defines the query session in progress and the continuation quantity defines the application specified quantity to be return by the next interaction with the Query Fulfiller application role. If this numeric value is a positive integer a query continuation is requested. If this integer value is zero, a cancellation of the query session it requested.

Query Control Events Overview

Query control in HL7 Version 3 is defined by the handling of the events and state transitions identified in the Version 3 HL7 Query Control state diagram (see the Version 3 Query Control State Diagram below). Initially, a pair of HL7 Version 3 Application Roles (described in the application roles section of the Query Control Act topic) is provided for managing queries. The pair of roles defined must manage the states and state transitions that are specific to this generic query framework.

Example interactions for which the pair of HL7 Applications Roles for query management participates are documented in the message control interactions section of the Query Control Act topic. Each interaction is initiated by a query control state transition that is assigned a Query Control Trigger Event. Refer to the trigger events section of the Query Control Act topic for detailed descriptions of the Version 3 Query Control Trigger Events.

Version 3 Query Control State Diagram

Go To Top

Diagram

T-QUQI_DM000000UV.png
Description

The Query Specification Message

A query by parameter mechanism is provided for defining a query specification. The structure of an HL7 V3 composite message for a query specification consists of the HL7 transmission wrapper, a query specification control act and a parameter definition structure that is specified as required for each domain defined query request message type.

The parameter definition structure for the query by parameter query specification is an information structure that may be similar in form for many query implementations but differentiated by constraints on attribute values as described as follows. This chapter includes two R-MIMs for query by parameter specification. One that allows domains to define the full query by parameter specification and one that allows them specify only the parameter items.

Refer to the walk-through below for details on classes and attributes.

The Query Response Message

An HL7 V3 composite Query Response Message is prepared by an HL7 V3 Query Fulfiller application role in response to receiving a Query Specification Message. The structure of this HL7 V3 composite message consists of the HL7 transmission wrapper, a query response control act and a domain defined message type.

Refer to the walk-through below for details of the classes and attributes.

The Query Continuation Message

The Query Continuation Message is a query control message that applies to the logical level of a query session that is controlled by the applications that implement the HL7 V3 Query Placer and Query Fulfiller application roles. The structure of this HL7 V3 composite message consists of the HL7 transmission wrapper and a minimal query control act.

Refer to the walk-through below for details of the classes and attributes.

Design Walk-Through

Overview

The Query Infrastructure domain comprises the classes and attributes needed to support queries, responses, and continuation requests. It is an extension of the Message Control Act Infrastructure domain.

Trigger Events and Control Acts

The query storyboards, application roles, trigger events and interactions provided in this domain are for example purposes only. Domains will define these within their query definitions.

The initial interaction generates messages as a result of the trigger events Execute Query Specification (by the data requester) and Complete Query Response (by the data server).

If the data requester has asked that results be sent back in partial sets, subsequent interactions may generate messages as a result of the trigger events Activate Query Continuation (by the data requester) and Complete Query Continuation (by the data server). This pair of trigger events continues for as long as the data requester wants to continue receiving result sets. It ceases when the data server runs out of qualifying data or the data requester does not want any more result sets.

All query messages are centered on the ControlActProcess act, which is discussed further below and is described fully in the Message Control Act Infrastructure domain.

Focal Classes Exposed

The ControlActProcess act, as constrained within the Query domain, constitutes the trigger event control act within which the query payload classes are contained. Its associations facilitate the production of queries by data requesters and of responses by data servers.

The dynamic model for query-response is that of a request for data by some interested system, followed by the production of a response by a server. Thus, the mood code for ControlActProcess will always be Order from the data requester and Event from the data server.

Query D-MIM Core Structure

The structure of the query D-MIM supports both the initial query-response interaction and subsequent interactions.

In the initial query-response interaction, the payload from the data requester will consist of exactly one instance of the QueryByParameter class. This class in turn will be associated with at least one instance of the Parameter class (either ParameterList or one to many ParameterItem) and may also be associated with instance(s) of the SortControl class. The payload from the data server will consist of exactly one instance of the QueryAck class, containing summary information about the response and about the data (if any) that it contains. This is followed by the actual response data, if there are any, structured as instances of RIM classes that are associated with the QueryAck class. The associations within the response payload are elaborated upon in the definition of the specific query being used.

If all the response data could not be returned in one result set, there will be additional query-response interactions. In subsequent interactions, the payload from the data requester will consist of exactly one instance of the QueryContinuation class, in which the data requester specifies how much more data it would like to receive, if any. As in the initial interaction, the payload from the data server will consist of an instance of the QueryAck class (containing summary data) and then the actual response data, if there are any.

Query Domain Information Model Classes

ControlActProcess

The core Act of the Query domain wrapper. This Act contains information about the query message. Its act relationships and participations, while included in support of queries, contain information about the message itself rather than about the query.

This class is described more fully in Control Act Infrastructure D-MIM walkthrough.

QueryByParameter

This class contains information about the query. Non-query message information is contained in ControlActProcess. This is the entry point for those domain-defined queries that wish to fully express the query specifications, including sort order. The key attribute of this class is queryId, which is used to associate this query instance with both the initial response message and with later query interactions. Valuing queryId avoids the need for the QueryContinuation and QueryAck classes (which also contain the queryId attribute) to carry as much detail information as is carried in the initial query.

The requester values attributes of this class in the initial query interaction to specify the query's priority, whether data should be returned immediately or later, to specify a delivery time if desired, and to indicate how many records (i.e., instances of matching response data) it would like to receive in each response message.

The following is the description and use of the attributes for QueryByParameter class.

  • queryId: may be valued by the initiating application to identify the query (it is intended to be used to match response messages to the originating query and may remain the same across multiple interactions when performing continuations of a previous query)

  • statusCode: defined by the QueryEventStatus domain (required)

  • modifyCode: indicates whether the subscription to a query is new or is being modified

  • responseElementGroupId: identifies the specific message type to be returned in the query response (this message type must be chosen from the set of message types supported by the receiver responsibilities associated with the query interaction)

  • responseModalityCode: defines the timing and grouping of the response instances

  • responsePriorityCode: identifies the time frame in which the response is expected

  • initialQuantity: defines the maximum size of the response that can be accepted by the requesting application.

  • initialQuantityCode: defines the units associated with the magnitude of the maximum size limit of a query response that can be accepted by the requesting application (defined by the QueryRequestLimit domain)

  • executionAndDeliveryTime: specifies the time the response is to be returned

QueryContinuation

This class is instantiated by the requester in subsequent query interactions if needed. It references query information through the value contained in the queryId attribute. The requester may specify a differently-sized return payload or may request that the next data set be started at any point.

The following is the description and use of the attributes for this class.

  • queryId: may be valued by the initiating application to identify the query (it is intended to be used to match response messages to the originating query and may remain the same across multiple interactions when performing continuations of a previous query)

  • statusCode: defined by the QueryEventStatus domain (required)

  • startResultNumber: specifies the instance number in the original query result set to start return in next query response message

  • continuationQuantity: specifies the number of instance matches to return in the next query response message

QueryAck

The server returns an instance of this class both in the initial response (even if no matching data are returned) and continuation responses, if any. It references query information through the value contained in the queryId attribute.

The following is the description and use of the attributes for this class.

  • queryId: may be valued by the initiating application to identify the query (it is intended to be used to match response messages to the originating query and may remain the same across multiple interactions when performing continuations of a previous query)

  • queryResponseCode: allows the responding system to return a precise response status (values defined by the QueryStatus domain

  • resultTotalQuantity: specifies the total number of instance matches for query specification associated with this query response instance

  • resultCurrentQuantity: specifies the number of matches for processed query specification that occur in current bundle of matches

  • resultRemainingQuantity: specifies number of matches for processed query specification that have yet to be sent to receiver

Parameter

Sent in the initial query payload. Note that the DMIM includes both QueryByParameter and Parameter as domain entry point stubs. The QueryByParameter as Stub RMIM may be represented as either ParameterItem classes or the ParameterList class. The ParameterList as Stub RMIM is a grouping of ParameterItem classes. The Parameter classes carry the values that specify the data that the requester wishes to be returned. The ParameterItem class is instantiated as many times as there are parameters to be sent, but in any case at least once. ParameterList is the entry point for many of the domain-defined queries.

If continuation interactions are required in order to bring back additional results, the continuation messages will not contain this class.

Query definitions in the application domains state how the value and semanticsText attributes are to be populated.

The following is the description and use of the attributes for this class.

  • id: can assist in tracing problems with implementing the query-by-parameter mechanism

  • value: represents a valued element structure for the element specified in the query response

  • semanticsText: provides a unique identification to an element within a specified query response structure

SortControl

Sent in the initial query payload. This class allows the requester to specify the order in which the server should return multiple results. If used, it is instantiated only once.

If continuation interactions are required in order to bring back additional results, the continuation messages will not contain this class.

The following is the description and use of the attributes for this class.

  • sequenceNumber: specifies the order

  • elementName: identifies a RIM element in a query response

  • directionCode: specifies sequence of sort order (values are ascending, descending, or none)

Act

This class connects the query response (either initial or continuation) with the top or outermost application class that is instantiated for the response.

Participations

The following control act participations are defined for the query control act. Note that where the model permits more than one instance of (or requires) a participation or act relationship, cardinality should be constrained as fully as possible in the domain-defined message type. Note that the location for any of the participants, if provided, will be defined in the R_AssignedPerson CMET.

  • authorOrPerformer: Who or what is asking for the information. More than one overseer may exist; this participation is not required. This participation associates the query act with either an entity that is described in an instance of the R_AssignedEntity role class, or a device that is described in an instance of an instance of the R_AssignedDevice role CMET.

  • overseer: The supervisor of the administrative person (dataEnterer) who physically places the query into the system. More than one overseer may exist; this participation is not required. This participation associates the query act with a person that is described in an instance of the R_AssignedPerson role CMET.

  • dataEnterer: The administrative person who physically places the query into the system. More than one dataEnterer may exist; this participation is not required. This participation associates the query act with a person that is described in an instance of the R_AssignedPerson role CMET.

  • informationRecipient: Who will get a copy of the returned data. More than one informationRecipient may exist; this participation is not required. This participation associates the query act with a person that is described in an instance of the R_AssignedPerson role CMET.

Refer to the Trigger Event Control Act Detected Issue Local CMET walkthrough for details of the DetectedIssueEvent and DetectedIssueManagement.

Return to top of page