Stream: implementers
Topic: operation outcome on success
Kevin Olbrich (Apr 20 2017 at 17:59):
Scenario: A user creates a resource with a POST that succeeds and they specify a Prefer header of return=OperationOutcome
. It seems like the correct response would be an OperationOutcome with an issue that has a severity of information
, but the required code
is unclear since all of the values in the referenced ValueSet are for failures and none of them are things like The resource was successfully created
. What is the right thing to do in this scenario?
Ben Spencer (Apr 20 2017 at 18:09):
there's an informational value: https://www.hl7.org/fhir/codesystem-issue-type.html#issue-type-informational
David Hay (Apr 20 2017 at 18:09):
I wondered that too, but the description is "A message unrelated to the processing success of the completed operation "
Kevin Olbrich (Apr 20 2017 at 18:11):
Yeah the description of that is off and I would expect the codes to line up with HTTP status codes, so it seems like there should be a 'success', 'created', and 'accepted' code at least.
Lloyd McKenzie (Apr 20 2017 at 19:45):
My read on return=OperationOutcome is that you get an OperationOutcome if there is one, not that you have to get one. Essentially the option is there so you can get back warnings instead of a copy of the created artifact if that's your preference - and if there are any.
Kevin Olbrich (Apr 20 2017 at 19:48):
wouldn't that make return=OperationOutcome
entirely pointless? The standard says you should return an OperationOutcome in the event of an error anyway, so in what circumstance would setting a Prefer header of return=OperationOutcome
actually be useful if it doesn't return an operation outcome on success?
Lloyd McKenzie (Apr 20 2017 at 19:54):
As I said, it applies when there's warnings.
Kevin Olbrich (Apr 20 2017 at 19:55):
That makes more sense (when I re-read it again...)
Grahame Grieve (Apr 20 2017 at 20:21):
I return an empty OperationOutcome if there's no hints or warnings when prefer=OperationOutcome
Kevin Olbrich (Apr 20 2017 at 20:27):
@Grahame Grieve doesn't the spec require at least one issue for an OperationOutcome?
Grahame Grieve (Apr 20 2017 at 20:28):
so it does.
Last updated: Apr 12 2022 at 19:14 UTC