FHIR:V1.0 Search result examples
Naar navigatie springen
Naar zoeken springen
1 Search result examples
This page provides guidance on how a server could return search results. Examples are provided in XML format but could have been in JSON format as well. Please note: these examples are not considered to be part of the normative content of the implementation guide.
2 Examples
2.1 Server supports the read operation for all resources
Scenario | The server offers read support for all resources that it has, meaning that each resource has a stable Resource.id and is accessible through a stable RESTful URL.
|
Request | GET [base]/Observation?code=http://loinc.org|85354-9 |
Response |
|
Response content
(click to expand) |
▶ Response - XML
▶ Response - JSON
|
2.2 Server doesn't support read operations
Scenario | The server supports doesn't support the read operation, for example because it's a FHIR facade that is unable to link a stable id to a certain entry in the underlying database. For this reason, it only supports searching for data. |
Request | GET [base]/Observation?code=http://loinc.org|85354-9 |
Response |
|
Response content
(click to expand) |
▶ Response - XML
▶ Response - JSON
|
2.3 Server supports read for some resources (hypothetical)
Scenario | The server is able to produce a stable RESTful URL for the Patient resource, but not for the Observation resource. This is a highly hypothetical situation to demonstrate the boundaries of the reference resolving mechanism in FHIR Bundles. |
Request | GET [base]/Observation?code=http://loinc.org|85354-9 |
Response |
|
Response content
(click to expand) |
▶ Response - XML
▶ Response - JSON
|
2.4 Invalid: server doesn't support read operations and uses contained resources instead
| |||
Scenario | The server supports doesn't support the read operation, for example because it's a FHIR facade that is unable to link a stable id to a certain entry in the underlying database. For this reason, it only supports searching for data. | ||
Request | GET [base]/Observation?code=http://loinc.org|85354-9 | ||
Response |
This approach is invalid! Resources should only be contained if they cannot have an independent existence outside of the resource containing it. This is not the case in the current situation. | ||
Response content
(click to expand) |
▶ Response - XML
▶ Response - JSON
|