Stream: implementers
Topic: Binary content
Elliot Silver (Jul 14 2016 at 18:40):
If I want to create a DocumentReference, what are my options for uploading the actual document?
As I see it, I can include it in the content.attachement.data, but that means I need to base64 encode it before sending it.
Alternatively, I think I can do it as two transactions: post the content unencoded to the Binary endpoint to create a new Binary resource, then reference that location in the content.attachment.url. However, that means two separate transactions. If I want to do this for multiple documents, I could upload all the new DocumentReferences in a transaction, but each Binary needs to be a separate call.
Does FHIR support an equiavelent to MTOM/XOP, or some similar way of efficiently referencing and transmitting binary content? What about multipart HTTP?
Eric Haas (Jul 14 2016 at 19:03):
Binary also requires base64 encoding. http://hl7-fhir.github.io/binary-definitions.html#Binary
John Moehrke (Jul 14 2016 at 19:13):
Elliot, take a look at MHD. We do the equivalent of XDS Provide&Register with a Bundle holding DocumentReference, DocumentManifest, List, and Binary. One POST, many create requests.
Elliot Silver (Jul 14 2016 at 20:15):
@John Moehrke , it is basically this context I was considering. We would need to base64 encode the document content in order to transmit it. The only way I can see to avoid the extra effort of encoding the document is to do a separate post of the document (unencoded) to the Binary endpoint, and then create a DocumentReference in a separate post.
Grahame Grieve (Jul 14 2016 at 20:23):
certainly that's the only way we describe
Last updated: Apr 12 2022 at 19:14 UTC