FHIR Chat · Binary responses from operations · implementers

Stream: implementers

Topic: Binary responses from operations


view this post on Zulip Lloyd McKenzie (Jul 17 2018 at 02:51):

When an operation has a single return type with the name "return" and with a data type of one of the FHIR resources, the operation is expected to return a bare resource instance of the specified type rather than a Parameters instance. My question is what happens if the specified resource type is Binary. Is the invocation of the operation allowed to follow the same behaviors as if you were doing a GET on Binary - i.e. you can actually get back the raw binary instance (XHTML, PDF, JPEG, etc.) or does it have to be in standard resource format?

view this post on Zulip Grahame Grieve (Jul 17 2018 at 02:53):

depends on the mime type

view this post on Zulip Lloyd McKenzie (Jul 17 2018 at 13:24):

So you agree that an operation returning a binary would behave the same as a read returning a binary? If you don't specify a mime type or specify a binary mime type (e.g. application/pdf) that matches the resource content, you'll get back raw binary content, whereas if you have an Accept header of fhir+xml, you'll get back the FHIR resource.

view this post on Zulip Lloyd McKenzie (Jul 17 2018 at 13:24):

Do you think it makes sense to make that explicit on the operations page?

view this post on Zulip Grahame Grieve (Jul 17 2018 at 21:23):

server discretion if no mime type is specified

view this post on Zulip Grahame Grieve (Jul 17 2018 at 21:23):

we should mention it somewhere, I guess

view this post on Zulip Lloyd McKenzie (Jul 17 2018 at 21:33):

Is it server discretion when doing a GET on Binary too? If not, why would we make it server discretion for operations?

view this post on Zulip Grahame Grieve (Jul 17 2018 at 21:34):

no we don't and we should be consistent. I remembered the binary rules wrong

view this post on Zulip Lloyd McKenzie (Jul 17 2018 at 21:50):

GF#17498


Last updated: Apr 12 2022 at 19:14 UTC