FHIR:Vissue-MM-2759 Search result examples

Uit informatiestandaarden
Naar navigatie springen Naar zoeken springen


Example: read support 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
Response
  • Searchset Bundle containing 1 Observation resource.
  • References from the Observation resource are to other resources on the server.

Example 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
Response
  • Searchset Bundle containing 1 Observation resource and all referenced resources.
  • References from the Observation resource are to other resources within the Bundle.
  • All resources in the Bundle are identified using a temporary fullUrl.

Example 3: read support 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
Response
  • Searchset Bundle containing 1 Observation resource.
  • References from the Observation resource are to other resources on the server, using an absolute URL.
  • The Observation resource is identified using a temporary fullUrl.

Invalid example: using contained resources

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
Response
  • Searchset Bundle containing 1 Observation resource.
  • The referenced Patient resource is contained within the Observation resource.

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.