Stream: implementers
Topic: Response code for incomplete data
Saren Currie (Mar 01 2017 at 01:14):
We're currently implementing an aggregated FHIR API and were wondering what HTTP status code to return when one of the sources is in error and so the data is incomplete. We were intending to return whatever data was available with an operation outcome to notify consumers that the data is incomplete, but we're not sure what HTTP status would be best for this situation.
Grahame Grieve (Mar 01 2017 at 02:18):
I think the status is 200 - the search operation succeeded, with an operation outcome indicating that data is incomplete for some reason
Saren Currie (Mar 01 2017 at 02:23):
We were thinking that 200 might be misleading. Consumers of the API might see that and assume that there is nothing wrong with the response (even though assuming incomplete data is complete could be a significant risk).
Grahame Grieve (Mar 01 2017 at 02:27):
well, all you can do is write in your documentation that an OperationOutcome must be displayed to the user, I think
Brian Postlethwaite (Mar 01 2017 at 02:52):
And the specific issue code in that operation outcome (as some of those searches may also return operation outcomes with their own issues)
Saren Currie (Mar 01 2017 at 03:01):
I don't think you can necessarily rely on all consumers of the API having comprehensive understanding of the documentation. Personally, I would interpret a 200 code as a response with nothing wrong with it.
Grahame Grieve (Mar 01 2017 at 03:26):
yes. where as a 4xx or 5xx will be interpreted as total failure
Lloyd McKenzie (Mar 01 2017 at 03:40):
200 just says "some aspects executed successfully". You get a 200 on a batch response too - even if all of the entries in the batch failed.
Last updated: Apr 12 2022 at 19:14 UTC