FHIR:Vprepub-1.0 FHIR Error handling examples: verschil tussen versies
(MM-1882: Add a "not authorized" example) |
(MM-2205: added Observation example) |
||
Regel 264: | Regel 264: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Collapse bottom}} | {{Collapse bottom}} | ||
− | ===Resource syntax or data is incorrect or | + | ===Resource syntax or data is incorrect, invalid or unsupported=== |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| '''Scenario''' | | '''Scenario''' | ||
− | | Resource syntax or data is incorrect or | + | | Resource syntax or data is incorrect, invalid or unsupported. |
|- | |- | ||
| '''Request''' | | '''Request''' | ||
Regel 313: | Regel 313: | ||
<diagnostics value="value.empty() or system.exists()" /> | <diagnostics value="value.empty() or system.exists()" /> | ||
<location value="Patient.telecom[0]" /> | <location value="Patient.telecom[0]" /> | ||
+ | </issue> | ||
+ | </OperationOutcome> | ||
+ | </syntaxhighlight> | ||
+ | {{Collapse bottom}} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | | '''Scenario''' | ||
+ | | Resource syntax or data is incorrect, invalid or unsupported. | ||
+ | |- | ||
+ | | '''Request''' | ||
+ | | <pre> POST [base]/Observation</pre> | ||
+ | |- | ||
+ | | '''Response''' | ||
+ | | | ||
+ | * HTTP 400 Bad Request or HTTP 422 Uprocessable Entity | ||
+ | * OperationOutcome with {{fhir|OperationOutcome.code}} set to {{term|invalid}} or a more specific child code. | ||
+ | |} | ||
+ | {{Collapse top|XML contents - request}} | ||
+ | <syntaxhighlight lang="xml"> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | |||
+ | <Observation xmlns="http://hl7.org/fhir"> | ||
+ | <id value="example"/> | ||
+ | ... | ||
+ | <category> | ||
+ | <coding> | ||
+ | <system value="http://hl7.org/fhir/observation-category"/> | ||
+ | <code value="vital-signs"/> | ||
+ | <display value="Vital Signs"/> | ||
+ | </coding> | ||
+ | </category> | ||
+ | <code> | ||
+ | <coding> | ||
+ | <system value="http://loinc.org"/> | ||
+ | <code value="39156-5"/> | ||
+ | <display value="Body mass index (BMI)"/> | ||
+ | </coding> | ||
+ | </code> | ||
+ | ... | ||
+ | </Observation> | ||
+ | </syntaxhighlight> | ||
+ | {{Collapse bottom}} | ||
+ | |||
+ | {{Collapse top|XML contents - response}} | ||
+ | <syntaxhighlight lang="xml"> | ||
+ | <OperationOutcome xmlns="http://hl7.org/fhir"> | ||
+ | <id value="c8bc9de0-5141-40dd-9a06-7134109d8ce0" /> | ||
+ | <text> | ||
+ | ... | ||
+ | </text> | ||
+ | <issue> | ||
+ | <severity value="error" /> | ||
+ | <code value="not-supported" /> | ||
+ | <details> | ||
+ | <text value="Unsupported code value" /> | ||
+ | </details> | ||
+ | <location value="Observation.code[0]" /> | ||
</issue> | </issue> | ||
</OperationOutcome> | </OperationOutcome> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Collapse bottom}} | {{Collapse bottom}} |
Versie van 26 jul 2021 om 14:09
Inhoud
[verbergen]1 Error handling examples
This page provides guidance on how a server could handle errors. 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.
1.1 All interactions
1.1.1 Not authorized
Scenario | Not authorized. |
Request | GET [base]/Practitioner/86475712701 |
Response |
|
[tonen]XML contents - response |
---|
1.1.2 Invalid authorization
Scenario | Invalid authorization. |
Request | GET [base]/Patient/20118482245 |
Response |
|
[tonen]XML contents - response |
---|
1.1.3 Resource is not supported
Scenario | The Resource is not supported by the resource server. |
Request | GET [base]/Questionnaire |
Response |
|
[tonen]XML contents - response |
---|
1.2 Search
1.2.1 Unkown or unsupported search parameter value
Scenario |
Unknown or unsupported search parameter value. In this example scenario, the Consent endpoint is supported. Although a system has implemented support for the HCIM TreatmentDirective ( |
Request | GET [base]/Consent?category=http://snomed.info/sct|11341000146107 |
Response |
|
[tonen]XML contents - response |
---|
1.2.2 Syntactically incorrect parameter
Scenario | Syntactically incorrect parameter in the search request. |
Request | GET [base]/Procedure?patient:john |
Response | * HTTP Status code 404 Not Found * OperationOutcome |
[tonen]XML contents - response |
---|
1.3 Read
1.3.1 Request on an unknown id
Scenario | The id is not known by the server |
Request | GET [base]/Patient/wrong-id |
Response | * HTTP Status code 404 Not Found * OperationOutcome |
[tonen]XML contents - response |
---|
1.4 Create/Update
1.4.1 No or incorrect Resource id
Scenario | Update an existing Patient resource, using a wrong id in the Resource. |
Request | PUT [base]/Patient/34235234 |
Response |
OperationOutcome with |
[tonen]XML contents - request |
---|
[tonen]XML contents - response |
---|
1.4.2 Resource syntax or data is incorrect, invalid or unsupported
Scenario | Resource syntax or data is incorrect, invalid or unsupported. |
Request | POST [base]/Patient |
Response |
|
[tonen]XML contents - request |
---|
[tonen]XML contents - response |
---|
Scenario | Resource syntax or data is incorrect, invalid or unsupported. |
Request | POST [base]/Observation |
Response |
|
[tonen]XML contents - request |
---|
[tonen]XML contents - response |
---|