google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
465 stars 246 forks source link

Add support for multi attachment #1797

Open FikriMilano opened 1 year ago

FikriMilano commented 1 year ago

Is your feature request related to a problem? Please describe. The current Attachment widget is only able to handle single attachment.

Describe the solution you'd like Update Attachment widget to be able to handle multi attachment.

Describe alternatives you've considered N/A

Additional context

Would you like to work on the issue? Limited bandwidth, feel free to assign someone

FikriMilano commented 1 year ago

@f-odhiambo @jingtang10

FikriMilano commented 1 year ago

This ticket is not ready for development yet

FikriMilano commented 1 year ago

My main concern is when submitting Questionnaire, the answers will get too big because of the multi attachments, which will cause the app to crash.

FikriMilano commented 1 year ago

Perhaps we need some changes when submitting a Questionnaire, if it's too big, then process it in small parts

FikriMilano commented 1 year ago

In the past we have encountered this problem in FHIRCore as well, since it's not SDK, there's no way to change the process when submitting a Questionnaire.

But here in SDK, I hope we can address this first, before going forward with this ticket

FikriMilano commented 1 year ago

EDIT: Moved to this ticket https://github.com/google/android-fhir/issues/1858

Summary from earlier discussion, we can put the base64 encoded file into one of the mentioned FHIR resource below, and append the link into the Attachment Url.

@jingtang10 @f-odhiambo @dubdabasoduba @aditya-07

dubdabasoduba commented 1 year ago

@jingtang10 does it makes sense to also have max file size for the SDK? I don't think we want to allow people to upload GBs of data.

FikriMilano commented 1 year ago

@dubdabasoduba yeah, we have the maxSize merged https://github.com/google/android-fhir/pull/1688

jingtang10 commented 5 months ago

hey @FikriMilano what needs to be done in this ticket

FikriMilano commented 4 months ago

@jingtang10

  1. Related to QuestionnaireResponse, do change the logic from "replacing old answer with new one" to "adding more answers to the questionnaireResponseItem"
  2. Related to UI, add a new ViewGroup to the attachment widget XML then add each new file/photo to the ViewGroup as child view

Another note before we start on this ticket: We need to make sure the app won't crash because of OOM when processing the files/images on submission, currently we are reading the bytes of the file and pass it to the answer, which I don't think the app can handle well.

I think we need to solve ticket https://github.com/google/android-fhir/issues/1858 first before we start w this one.