FHIR Chat · Operation's return · implementers

Stream: implementers

Topic: Operation's return


view this post on Zulip Yunwei Wang (Apr 29 2018 at 19:21):

Can an FHIR operation returns both Resource and OperationOutcome?

view this post on Zulip Lloyd McKenzie (Apr 29 2018 at 19:35):

You can't return both. If you want both, set the Prefer header to return=OperationOutcome, then query for the version created by the operation based on the Location header.

view this post on Zulip Richard Kavanagh (Apr 30 2018 at 10:19):

Could you not just have two "OUT" parameters for the operation?

view this post on Zulip Grahame Grieve (Apr 30 2018 at 10:34):

well, that depends on whether Yunwei means an 'operation' in the general sense - what the spec calls 'interactions', or if he means a $operation.

view this post on Zulip Grahame Grieve (Apr 30 2018 at 10:35):

Lloyd answered the first, you answered the second

view this post on Zulip Richard Kavanagh (Apr 30 2018 at 10:35):

:-)

view this post on Zulip Yunwei Wang (Apr 30 2018 at 19:19):

I mean the spec defined $ operation. such as ValueSet.$expand returns ValueSet resource. Can I return both OperationOutcome and ValueSet?

view this post on Zulip Grahame Grieve (Apr 30 2018 at 20:02):

build.fhir.org/operations.html#response : If there is only one out parameter, which is a Resource with the parameter name "return" then the parameter format is not used, and the response is simply the resource itself

view this post on Zulip Grahame Grieve (Apr 30 2018 at 20:04):

so answer is: unless that sentence applies, you can add an operation outcome. If this sentence does - and it does for $expand - then returning a parameters resource with the expansion and an operation outcome will be legal but I bet none of the clients would handle it. Mine won't (though I'll update it at some stage0

view this post on Zulip Rob Hausam (May 03 2018 at 00:22):

The returning a "resource with the expansion and an operation outcome" was a thought that I had at one point for dealing with identifying when the server returns a limited expansion (typically because returning the full expansion would be too costly), but with $expand having only the 'return' parameter it wasn't really an option - at least one that clients would be able to deal with, as Grahame says. But it is interesting that we don't consider it to be "illegal" to do so, and maybe it's something that would have some utility and we could consider in the future (for "limited expansions" and similar situations).


Last updated: Apr 12 2022 at 19:14 UTC