FHIR:Vissue-MM-2759 Search result examples: verschil tussen versies

Uit informatiestandaarden
Naar navigatie springen Naar zoeken springen
Regel 61: Regel 61:
 
{{Collapse bottom}}
 
{{Collapse bottom}}
  
=Example 2: server only supports search=
+
=Example 2: server doesn't support read operations=
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.
+
{| class="wikitable"
 
+
|-
 +
| '''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'''
 +
| <pre> GET [base]/Observation</pre>
 +
|-
 +
| '''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 {{fhir|fullUrl}}.
 +
|}
 +
{{Collapse top|XML contents - response}}
 
<syntaxhighlight lang="xml" highlight="">
 
<syntaxhighlight lang="xml" highlight="">
 
<Bundle xmlns="http://hl7.org/fhir">
 
<Bundle xmlns="http://hl7.org/fhir">
Regel 125: Regel 138:
 
</Bundle>
 
</Bundle>
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
{{Collapse bottom}}
  
 
=Example 3: read support for some resources (hypothetical)=
 
=Example 3: read support for some resources (hypothetical)=
The server is able to produce a stable RESTful URL for the Patient resource, but not for the Observation resource.
+
{| class="wikitable"
 
+
|-
 +
| '''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'''
 +
| <pre> GET [base]/Observation</pre>
 +
|-
 +
| '''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 {{fhir|fullUrl}}.
 +
|}
 +
{{Collapse top|XML contents - response}}
 
<syntaxhighlight lang="xml" highlight="">
 
<syntaxhighlight lang="xml" highlight="">
 
<Bundle xmlns="http://hl7.org/fhir" >
 
<Bundle xmlns="http://hl7.org/fhir" >
Regel 171: Regel 198:
 
</Bundle>
 
</Bundle>
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
{{Collapse bottom}}
  
 
=Invalid example: using contained resources=
 
=Invalid example: using contained resources=
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.
+
{| class="wikitable"
 +
|-
 +
| '''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'''
 +
| <pre> GET [base]/Observation</pre>
 +
|-
 +
| '''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.
 +
|}
 +
{{Collapse top|XML contents - response}}
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<Bundle xmlns="http://hl7.org/fhir" >
 
<Bundle xmlns="http://hl7.org/fhir" >
Regel 207: Regel 249:
 
</Bundle>
 
</Bundle>
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
{{Collapes bottom}}

Versie van 16 mei 2022 10:07


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.