dorset-ics / healthcare-data-exchange

A FHIR based integration and interoperability platform to support a regional healthcare network.
https://dorset-ics.github.io/healthcare-data-exchange/
MIT License
6 stars 6 forks source link

feat: return OperationOutcome for Fhir exceptions #8

Closed liammoat closed 3 months ago

liammoat commented 3 months ago

FHIR defines an OperationOutcome resource that can be used to convey specific detailed processable error information. The OperationOutcome may be returned with any HTTP 4xx or 5xx response, and provides a consistent way to encapsulate error information to the client.

This PR updates the GlobalExceptionHandler to return an OperationOutcome for the FhirOperationException. PdsSearchFailedException and PdsSearchPatientNotFoundException have been updated to extend FhirOperationException. Furthermore, errors that may be generated by frameworks such as Firely.net will also get handled by this method.

Relevant tests have been updated.

gaurarpit commented 3 months ago

Merging in