FHIR:Vprepub-1.0 FHIR Error handling examples: verschil tussen versies

Uit informatiestandaarden
Naar navigatie springen Naar zoeken springen
(MM-1292: Apply writing guidelines and templates)
Regel 19: Regel 19:
 
|  
 
|  
 
* HTTP 401 Unauthorized
 
* HTTP 401 Unauthorized
* OperationOutcome with <code>code</code> set to "''security''" or if applicable a more specific child code.  
+
* OperationOutcome with {{fhir|OperationOutcome.code}} set to {{term|security}} or if applicable a more specific child code.  
 
|}
 
|}
 
{{Collapse top|XML contents - response}}
 
{{Collapse top|XML contents - response}}
Regel 38: Regel 38:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
{{Collapse bottom}}
 
{{Collapse bottom}}
 +
 
===Resource is not supported===
 
===Resource is not supported===
 
{| class="wikitable"  
 
{| class="wikitable"  
Regel 50: Regel 51:
 
|
 
|
 
* HTTP 404 Not Found
 
* HTTP 404 Not Found
* OperationOutcome with <code>code</code> set to "''not-supported''"
+
* OperationOutcome with {{fhir|OperationOutcome.code}} set to {{term|not-supported}}
 
|}
 
|}
  
Regel 70: Regel 71:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
{{Collapse bottom}}
 
{{Collapse bottom}}
 +
 
==Search==
 
==Search==
 
===Unkown or unsupported search parameter value===
 
===Unkown or unsupported search parameter value===
Regel 84: Regel 86:
 
|
 
|
 
* HTTP 200 OK
 
* HTTP 200 OK
* Empty Bundle of <code>type</code> "''searchset''"
+
* Empty Bundle of {{fhir|.type}} {{term|searchset}}
* OperationOutcome in Bundle as an entry marked with <code>Bundle.entry.search.mode</code> of "''outcome''"
+
* OperationOutcome in Bundle as an entry marked with {{fhir|Bundle.entry.search.mode}} of {{term|outcome}}
* OperationOutcome with <code>code</code> set to "''not-found''" and <code>severity</code> not set to "''fatal''" or "''error''"
+
* OperationOutcome with {{fhir|OperationOutcome.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 197: Regel 199:
 
|  
 
|  
 
* HTTP 400 Bad Request
 
* HTTP 400 Bad Request
OperationOutcome with <code>code</code> set to "''invalid''"
+
OperationOutcome with {{fhir|OperationOutcome.code}} set to {{term|invalid}}
 
|}
 
|}
  
Regel 244: Regel 246:
 
|  
 
|  
 
* HTTP 400 Bad Request or HTTP 422 Uprocessable Entity
 
* HTTP 400 Bad Request or HTTP 422 Uprocessable Entity
* OperationOutcome with <code>code</code> set to "''invalid''" or a more specific child code.
+
* OperationOutcome with {{fhir|OperationOutcome.code}} set to {{term|invalid}} or a more specific child code.
 
|}
 
|}
 
{{Collapse top|XML contents - request}}
 
{{Collapse top|XML contents - request}}

Versie van 20 jan 2021 11:16



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 Invalid authorization

Scenario Invalid authorization.
Request
 GET [base]/Patient/20118482245
Response
  • HTTP 401 Unauthorized
  • OperationOutcome with OperationOutcome.code set to security or if applicable a more specific child code.

1.1.2 Resource is not supported

Scenario The Resource is not supported by the resource server.
Request
GET [base]/Questionnaire
Response
  • HTTP 404 Not Found
  • OperationOutcome with OperationOutcome.code set to not-supported

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 (category=http://snomed.info/sct|11291000146105) it has not implemented the HCIM AdvanceDirective (category=http://snomed.info/sct|11341000146107).

Request
GET [base]/Consent?category=http://snomed.info/sct|11341000146107
Response
  • HTTP 200 OK
  • Empty Bundle of .type searchset
  • OperationOutcome in Bundle as an entry marked with Bundle.entry.search.mode of outcome
  • OperationOutcome with OperationOutcome.code set to not-found and OperationOutcome.severity not set to fatal or error

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

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

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
  • HTTP 400 Bad Request

OperationOutcome with OperationOutcome.code set to invalid

1.4.2 Resource syntax or data is incorrect or invalid

Scenario Resource syntax or data is incorrect or invalid.
Request
 POST [base]/Patient
Response
  • HTTP 400 Bad Request or HTTP 422 Uprocessable Entity
  • OperationOutcome with OperationOutcome.code set to invalid or a more specific child code.