Stream: implementers
Topic: 4xx or 5xx Status Codes SHALL vs may have OperationOutcome
Ken Sinn (May 06 2020 at 20:23):
Noticed some possible discrepancy in conformance language:
https://www.hl7.org/fhir/http.html#Status-Codes:
The OperationOutcome may be returned with any HTTP 4xx or 5xx response, but this is not required - many of these errors may be generated by generic server frameworks underlying a FHIR server.
https://www.hl7.org/fhir/http.html#search:
If the search fails (cannot be executed, not that there are no matches), the return value return value SHALL be a status code 4xx or 5xx with an OperationOutcome.
Common HTTP Status codes returned on FHIR-related errors (in addition to normal HTTP errors related to security, header and content type negotiation issues):
400 Bad Request - search could not be processed or failed basic FHIR validation rules
401 Not Authorized - authorization is required for the interaction that was attempted
404 Not Found - resource type not supported, or not a FHIR end-point
Wondering if the "SHALL" in the latter quotation refers to simply 4xx/5xx, or also to the "with an OperationOutcome" -- which would be a strange constraint, especially paired with the subsequent line. It would imply that just for Searches, unauthorized searches must return an OO, but unauthorized anything-else does not need to return an OO.
Could I get clarification on whether the OO SHALL be returned with a 4xx/5xx for Searches?
Thank you!
Ken Sinn (May 06 2020 at 20:24):
p.s.: also, there's a typo in the second quote "the return value return value" =)
Lloyd McKenzie (May 06 2020 at 21:22):
Please submit a change request for the typo and clarification as to whether or not the OperationOutcome is mandated for all error codes - personally, I don't see that OperationOutcome would be necessary for all possible codes, but it's certainly a SHOULD for a 400 and some of the others.
Ken Sinn (May 06 2020 at 21:24):
Thanks Lloyd - just so I understand the conformance language in the Search section: the "SHALL be a status 4xx or 5xx" is the target of the conformance, while "with an OperationOutcome" is optional?
Ken Sinn (May 06 2020 at 21:26):
As written, it's causing some issues with interpretation, as it can be interpreted as "status codes 4xx/5xx must also come with an OO".
Lloyd McKenzie (May 06 2020 at 21:26):
I think it's unclear and needs to be clarified. I can't swear as to the original intent, but my leaning is that it shouldn't be a SHALL.
Lloyd McKenzie (May 06 2020 at 21:26):
Others may disagree though.
Grahame Grieve (May 06 2020 at 21:27):
operation outcome is not a shall since 4xx and 5xx can be generated in the stack long before FHIR comes into relevance
Lloyd McKenzie (May 06 2020 at 21:28):
K. That sounds like a clear answer. @Ken Sinn Please reference this thread when you submit the change request
Ken Sinn (May 06 2020 at 21:29):
Thank you @Lloyd McKenzie and @Grahame Grieve
Ken Sinn (May 06 2020 at 21:51):
Created: https://jira.hl7.org/browse/FHIR-27051
Vassil Peytchev (May 08 2020 at 06:03):
I think the way this was written suggests that there are specific FHIR-related failures when trying to execute a search, where an OperationOutcome is required. Of the 3 examples given, the first seems to fit such a requirement, but I am not sure about the other two...
Last updated: Apr 12 2022 at 19:14 UTC