This page is part of the FHIR Specification (v0.0.82: DSTU 1). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

6.11 Resource Query - Content

A description of a query with a set of parameters.

6.11.1 Scope and Usage

The resource is used to perform queries using messaging-based exchanges, and to perform asynchronous searches using the RESTful interface.

6.11.2 Background and Context

The Query resource represents a search / query operation as a single resource. The way the content of the query resource works is described in the Search section.

6.11.3 Resource Content

Query (Resource)Links query and its response(s)identifier : uri 1..1Set of query parameters with valuesparameter : Extension 1..*ResponseLinks response to source queryidentifier : uri 1..1Outcome of processing the queryoutcome : code 1..1 <<The outcome of processing a query requestQueryOutcome>>Total number of matching recordstotal : integer 0..1Parameters server usedparameter : Extension 0..*To get first page (if paged)first : Extension 0..*To get previous page (if paged)previous : Extension 0..*To get next page (if paged)next : Extension 0..*To get last page (if paged)last : Extension 0..*Resources that are the results of the searchreference : Resource(Any) 0..*If this is a response to a queryresponse0..1
<Query xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: extension, modifierExtension, language, text, and contained -->
 <identifier value="[uri]"/><!-- 1..1 Links query and its response(s) -->
 <parameter><!-- 1..* Extension Set of query parameters with values --></parameter>
 <response>  <!-- 0..1 If this is a response to a query -->
  <identifier value="[uri]"/><!-- 1..1 Links response to source query -->
  <outcome value="[code]"/><!-- 1..1 ok | limited | refused | error -->
  <total value="[integer]"/><!-- 0..1 Total number of matching records -->
  <parameter><!-- 0..* Extension Parameters server used --></parameter>
  <first><!-- 0..* Extension To get first page (if paged) --></first>
  <previous><!-- 0..* Extension To get previous page (if paged) --></previous>
  <next><!-- 0..* Extension To get next page (if paged) --></next>
  <last><!-- 0..* Extension To get last page (if paged) --></last>
  <reference><!-- 0..* Resource(Any) Resources that are the results of the search --></reference>
 </response>
</Query>

Alternate definitions: Schema/Schematron, Resource Profile

6.11.3.1 Terminology Bindings

PathDefinitionTypeReference
Query.response.outcome The outcome of processing a query requestFixedhttp://hl7.org/fhir/query-outcome

Notes about the Query resource:

6.11.3.2 Messaging based Queries

In order to initiate a message-based query, a sender sends a message consisting of a Message resource, and a Query resource. The message header resource routes the message to the correct destination, and the query contains the parameters of the search that is requested. See the examples for an example query request message.

The receiver processes the message, and then returns a message with a message header, a query with response details, and either an error in the query response, or a set of resources that meet the query criteria. See the examples for an example query response message.

If the sender wishes to retrieve additional pages from the original search, the sender constructs a new query with the parameters specified by the search processing system, and the cycle starts again.

6.11.3.3 Asynchronous Queries on a REST framework

The query resource can be used on a RESTful interface. Multiple interactions patterns are possible. This is a matter of ongoing investigation during the DSTU period.

6.11.4 Searching the Searches

As a consequence of the general framework, it is possible to search on a set of stored queries, though there is no known particular use case for doing so.

6.11.5 Search Parameters

Search parameters for this resource. The standard parameters also apply as described above.

NameTypeDescriptionPaths
_idtokenThe logical resource id associated with the resource (must be supported by all servers)
_languagetokenThe language of the resource
identifiertokenLinks query and its response(s)Query.identifier
responsetokenLinks response to source queryQuery.response.identifier

comments powered by Disqus