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
A description of a query with a set of parameters.
The resource is used to perform queries using messaging-based exchanges, and to perform asynchronous searches using the RESTful interface.
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.
<Query xmlns="http://hl7.org/fhir"> <!-- 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
Path | Definition | Type | Reference |
---|---|---|---|
Query.response.outcome | The outcome of processing a query request | Fixed | http://hl7.org/fhir/query-outcome |
Notes about the Query resource:
<parameter url="http://hl7.org/fhir/query#subject:Patient.name"> <valueString value="odile"/> </parameter>
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.
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.
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.
Search parameters for this resource. The standard parameters also apply as described above.
Name | Type | Description | Paths |
_id | token | The logical resource id associated with the resource (must be supported by all servers) | |
_language | token | The language of the resource | |
identifier | token | Links query and its response(s) | Query.identifier |
response | token | Links response to source query | Query.response.identifier |