HL7 / emedicinal-product-info

Gravitate Health Project
15 stars 8 forks source link

Using DocumentReference to Send Images #27

Closed mundij01 closed 2 years ago

mundij01 commented 2 years ago

Currently, it is proposed to use the Binary resource to transmit images associated with the ePI. In a current proof-of concept, we found that high-resolution images were needed for the user interface (consumer of the ePI content.) Base64 encoding the larger images significantly increased the size of the Bundle. Thinking about a production setting, there are several consequences of using the Binary resource:

Would it be more appropriate to use a DocumentReference to transmit this information? The trade-off is that the client will need to makes requests to retrieve the referenced documents/files, but I think the extra requests from the client offset the consequences listed above. Interested in hearing others' opinions. Thanks.

jkiddo commented 2 years ago

the FHIR server will need to store images base64-encoded (use more storage) or convert them before transmission (use more memory and processing.)

Storage is cheap - like really cheap. Its does take some CPU cycles and mem though to pack it.

the client will need to base64-decode the image, resulting in extra processing on their side

Client side processing shouldn't be a bottleneck here. They'll have plenty of resources to do the unwrapping.

authoring / editing of the XML requires editor capabilities that can handle such large files (my VS Code XML plug-in ran out of memory and I needed to increase some settings.)

The image sizes I would expect wouldn't go way beyond something like 1 meg or so pr. image. What kind of images/sizes did you have in mind @mundij01 ?

cander2 commented 2 years ago

Wondering if we can reuse FDA's SPL image rules here. Their validation rules say images must be <1 MB. See page 30 of SPL Implementation Guide section 2.2.3.5 (https://www.fda.gov/media/84201/download).

Would that solve this if we include this rule in our IG?

jkiddo commented 2 years ago

The question is if we're ready to make such hard constraints already

gcangioli commented 2 years ago

Would it be more appropriate to use a DocumentReference to transmit this information? The trade-off is that the client will need to makes requests to retrieve the referenced documents/files, but I think the extra requests from the client offset the consequences listed above. Interested in hearing others' opinions. Thanks.

@mundij01 What do you mean with using DocumentReference ? store in a repository images and provide a link to them ? Or include them as attachment DocumentReference.content.attachment within the DocumentReference resource ? (Attachment.data is still a base64 binary...