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.6 Resource Query - Examples

6.11.6.1 Simple Query Examples (RESTful)

Search for all patients admitted to a particular ward:

GET [svc-root]/Encounter?location=100&_include=Encounter.subject

Note that this query actually returns the current encounters associated with this ward, and asks for the associated patient resources as well. It assumes that the location resource for the ward is already known, and has the logical id "100"


6.11.6.2 Query Message Examples

Example Index:

Simple exampleXMLJSON
Request Message ExampleXMLJSON
Response Message ExampleXMLJSON

6.11.6.3 Simple

XML

Simple example (id = "1")

Raw XML

<Query xmlns="http://hl7.org/fhir">
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml">[Put rendering here]</div>
  </text>

  <!--   this is an extermely simple query - a request to execute the query 'example' on the
   responder   -->
  <identifier value="urn:uuid:42b253f5-fa17-40d0-8da5-44aeb4230376"/>
  <parameter url="http://hl7.org/fhir/query#_query">
    <valueString value="example"/>
  </parameter>
</Query>

JSON

Simple example

{
  "resourceType": "Query",
  "text": {
    "status": "generated",
    "div": "<div>[Put rendering here]</div>"
  },
  "identifier": "urn:uuid:42b253f5-fa17-40d0-8da5-44aeb4230376",
  "parameter": [
    {
      "url": "http://hl7.org/fhir/query#_query",
      "valueString": "example"
    }
  ]
}

comments powered by Disqus