FHIR:Vprepub-1.0 FHIR Error handling examples: verschil tussen versies
(MM-3096: .code changes to issue.code conform the FHIR specs) |
(MM-3475: Changed incorrect HTTP status code of request with syntactically incorrect parameter, fixed several typos and inconsistencies) |
||
Regel 81: | Regel 81: | ||
| | | | ||
* HTTP 404 Not Found | * HTTP 404 Not Found | ||
− | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|not-supported}} | + | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|not-supported}}. |
|} | |} | ||
Regel 116: | Regel 116: | ||
| | | | ||
* HTTP 200 OK | * HTTP 200 OK | ||
− | * Empty Bundle of {{fhir|.type}} {{term|searchset}} | + | * Empty Bundle of {{fhir|.type}} {{term|searchset}}. |
− | * OperationOutcome in Bundle as an entry marked with {{fhir|Bundle.entry.search.mode}} | + | * OperationOutcome in Bundle as an entry marked with {{fhir|Bundle.entry.search.mode}} set to {{term|outcome}}. |
− | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|not-found}} and {{fhir|OperationOutcome.severity}} not set to {{term|fatal}} or {{term|error}} | + | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|not-found}} and {{fhir|OperationOutcome.severity}} not set to {{term|fatal}} or {{term|error}}. |
|} | |} | ||
{{Collapse top|XML contents - response}} | {{Collapse top|XML contents - response}} | ||
Regel 167: | Regel 167: | ||
|- | |- | ||
| '''Response''' | | '''Response''' | ||
− | | * HTTP | + | | |
+ | * HTTP 400 Bad Request | ||
+ | * OperationOutcome. There are various issue type codes that could be used, depending on the nature of the error. | ||
|} | |} | ||
+ | |||
{{Collapse top|XML contents - response}} | {{Collapse top|XML contents - response}} | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Regel 192: | Regel 195: | ||
|- | |- | ||
| '''Scenario''' | | '''Scenario''' | ||
− | | The id is not known by the server | + | | The id is not known by the server. |
|- | |- | ||
| '''Request''' | | '''Request''' | ||
Regel 198: | Regel 201: | ||
|- | |- | ||
| '''Response''' | | '''Response''' | ||
− | | * HTTP | + | | |
+ | * HTTP 404 Not Found | ||
+ | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|not-found}}. | ||
|} | |} | ||
+ | |||
{{Collapse top|XML contents - response}} | {{Collapse top|XML contents - response}} | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Regel 229: | Regel 235: | ||
| | | | ||
* HTTP 400 Bad Request | * HTTP 400 Bad Request | ||
− | OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|invalid}} | + | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|invalid}}. |
|} | |} | ||
Regel 264: | Regel 270: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Collapse bottom}} | {{Collapse bottom}} | ||
+ | |||
===Resource syntax or data is incorrect, invalid or unsupported=== | ===Resource syntax or data is incorrect, invalid or unsupported=== | ||
{| class="wikitable" | {| class="wikitable" | ||
Regel 275: | Regel 282: | ||
| '''Response''' | | '''Response''' | ||
| | | | ||
− | * HTTP 400 Bad Request or HTTP 422 | + | * HTTP 400 Bad Request or HTTP 422 Unprocessable Entity |
* OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|invalid}} or a more specific child code. | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|invalid}} or a more specific child code. | ||
|} | |} | ||
Regel 328: | Regel 335: | ||
| '''Response''' | | '''Response''' | ||
| | | | ||
− | * HTTP 400 Bad Request or HTTP 422 | + | * HTTP 400 Bad Request or HTTP 422 Unprocessable Entity |
* OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|invalid}} or a more specific child code. | * OperationOutcome with {{fhir|OperationOutcome.issue.code}} set to {{term|invalid}} or a more specific child code. | ||
|} | |} |
Huidige versie van 24 aug 2022 om 08:14
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 |
|
[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 |
|
[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 |
|
[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 |
---|