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

Handle repeated groups #726

Closed jingtang10 closed 1 week ago

jingtang10 commented 2 years ago

Is your feature request related to a problem? Please describe. Repeated question groups

Describe the solution you'd like Potentiall we can add a "+" button so that the user can create new groups. Groups that are repeatable can also be deleted with a "-" button

Describe alternatives you've considered NA

Additional context NA

Would you like to work on the issue? NA

joiskash commented 2 years ago

Just flagging that this issue is important to our group. An example use case is :

For every child , please provide details of immunization

cc: @kumaakh @jjtswan

jingtang10 commented 2 years ago

bumping to P1

fredhersch commented 2 years ago

@shelaghm Are you able to provide a Ux mock for this? We are trying to add multiple items for a specific group. For example, I want to record multiple immunizations for a given Patient. Each item group has the same set of fields that are added. So something like a + icon option that adds a new line of fields to complete. Thanks

shelaghm commented 2 years ago

@joiskash @fredhersch @jingtang10

How about something like this?

Screen Shot 2022-03-23 at 11 58 42
kumaakh commented 2 years ago

Some quick comments:

  1. We will need the ability to remove the item if it was inadvertently added
  2. As the single form can end up taking up the whole screen, just vertical growth of the repeated items may be a bad idea from a usability point of view. It will be nicer if an item can be collapsed to a single line so that visually one can count how many have been added.
  3. It should be possible to jump to each item easily.
  4. What happens when a repeated item itself is large enough to need multiple groups (pages)? e.g. "Add another family member"

On Wed, Mar 23, 2022 at 3:00 PM Shelagh McLellan @.***> wrote:

@joiskash https://github.com/joiskash @fredhersch https://github.com/fredhersch @jingtang10 https://github.com/jingtang10

How about something like this? [image: Screen Shot 2022-03-23 at 11 58 42] https://user-images.githubusercontent.com/86378921/159775619-c2f146f7-2386-43d9-8879-e37a6e57083b.png

— Reply to this email directly, view it on GitHub https://github.com/google/android-fhir/issues/726#issuecomment-1076710375, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWFNAUL3T67PJOIINJ4CALVBNS5PANCNFSM5CLSL3SA . You are receiving this because you were mentioned.Message ID: @.***>

f-odhiambo commented 2 years ago

@fredhersch As a follow-up, this can be used in the immunization follow-up questionnaire for Child Immunization for LMH. Will look into this in the next Sprint

CC @Tarun-Bhardwaj

f-odhiambo commented 2 years ago

We also have use cases for recording birth outcomes. Sometimes this is handled with an initial question such as “how many babies?”

fredhersch commented 2 years ago

Some quick comments: 1. We will need the ability to remove the item if it was inadvertently added 2. As the single form can end up taking up the whole screen, just vertical growth of the repeated items may be a bad idea from a usability point of view. It will be nicer if an item can be collapsed to a single line so that visually one can count how many have been added. 3. It should be possible to jump to each item easily. 4. What happens when a repeated item itself is large enough to need multiple groups (pages)? e.g. "Add another family member" On Wed, Mar 23, 2022 at 3:00 PM Shelagh McLellan @.> wrote: @joiskash https://github.com/joiskash @fredhersch https://github.com/fredhersch @jingtang10 https://github.com/jingtang10 How about something like this? [image: Screen Shot 2022-03-23 at 11 58 42] https://user-images.githubusercontent.com/86378921/159775619-c2f146f7-2386-43d9-8879-e37a6e57083b.png — Reply to this email directly, view it on GitHub <#726 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWFNAUL3T67PJOIINJ4CALVBNS5PANCNFSM5CLSL3SA . You are receiving this because you were mentioned.Message ID: @.>

Thanks @kumaakh , a couple of comments:

Open to other thoughts

cc: @jingtang10

f-odhiambo commented 2 years ago

@RaaziaTarique FYI

f-odhiambo commented 2 years ago

This ticket will be a pre-requisite for #1038 CC @Tarun-Bhardwaj

RaaziaTarique commented 2 years ago

As per this link, https://www.hl7.org/fhir/questionnaire-definitions.html#Questionnaire.item.repeats. Questionnaire.item.repeats: An indication, if true, that the item may occur multiple times in the response, collecting multiple answers for questions or multiple sets of answers for groups.

So, for supporting repeats, I am going to first handle groups and questionnaire items which supports multiple answers such as if we need to add multiple given names to a Patient Resource. And for this questionnaire item views will be modified to have a add another item option and and each questionnaire Item will have remove item option.

CC: @f-odhiambo @maimoonak @ekigamba @jingtang10

RaaziaTarique commented 2 years ago

After analysing and trying multiple approaches to add repeated groups support in SDK I ended up in picking the approach to use nested recyclerView for each QuestionnaireItemViewType which means each QuestionnaireItemViewType's view will have a heading, recycler view (with QuestionnaireItemView and remove view button) and add view button. I tried to use this approach for only EditText but it will require some time and using the same approach for the rest of the views will take approximately 2-3 weeks
So, I need confirmation if this approach is a suitable solution or not?

@f-odhiambo @ekigamba @maimoonak @jingtang10

jingtang10 commented 2 years ago

@RaaziaTarique as discussed can you share any progress/investigation you have made? thanks

shelaghm commented 2 years ago

Here's an updated mock addressing

  1. A way to remove/delete a group by adding a delete button. Button title can say remove instead of delete.
  2. To reduce vertical height of the group, I grouped date and location on one row. There's not enough space for all three text fields on one row and depending on screen size and language it might not fit to have two text fields on one row.
  3. Added a 'chevron' button to allow for expanding and collapsing a group so we can see what the option looks like. It's worth making sure that the expand/collapse is obvious for the people doing the data entry, it might not be a pattern they are familiar with and could be frustrating.
  4. I think numbering the groups by saying "immunization 1, 2, 3 etc makes it easier to navigate if we are going to have a collapse/expand functionality and a list of 3+ groups.

Let me know what you think and if this aligns with the engineering approach?

Screen Shot 2022-04-08 at 16 27 40
maimoonak commented 2 years ago

@f-odhiambo

jingtang10 commented 2 years ago

@kevinmost i wonder if you can take a look at this after what you're working on right now

jingtang10 commented 2 years ago

@juanchazo fyi as well since this is related to sdc lib and ui changes

jingtang10 commented 1 year ago

@kevinmost thanks so much for landing the PR for repeated group! this is great!

reopen to handle deletion. let me know when there's a pr kevin :)

jingtang10 commented 1 year ago

@shelaghm also can you please provide an icon for releated group in the catalog app? thanks!

shelaghm commented 1 year ago

I recommend we use this icon! Will paste link on our internal chat where it is the right color and size.

AbdulmalikAdans commented 1 year ago

📜

HenryRae commented 1 month ago

Here's an updated mock addressing

  1. A way to remove/delete a group by adding a delete button. Button title can say remove instead of delete.
  2. To reduce vertical height of the group, I grouped date and location on one row. There's not enough space for all three text fields on one row and depending on screen size and language it might not fit to have two text fields on one row.
  3. Added a 'chevron' button to allow for expanding and collapsing a group so we can see what the option looks like. It's worth making sure that the expand/collapse is obvious for the people doing the data entry, it might not be a pattern they are familiar with and could be frustrating.
  4. I think numbering the groups by saying "immunization 1, 2, 3 etc makes it easier to navigate if we are going to have a collapse/expand functionality and a list of 3+ groups.

Let me know what you think and if this aligns with the engineering approach?

Screen Shot 2022-04-08 at 16 27 40

Great solution here @shelaghm. @jingtang10 would one be able to still add repeat groups anywhere in the form e.g incases where the date is the same and they would want it separated from the groups and thus have date field above Immunization 1 group, and then the groups (immunization 1, 2, 3) below it.

jingtang10 commented 4 weeks ago

Here's an updated mock addressing

  1. A way to remove/delete a group by adding a delete button. Button title can say remove instead of delete.
  2. To reduce vertical height of the group, I grouped date and location on one row. There's not enough space for all three text fields on one row and depending on screen size and language it might not fit to have two text fields on one row.
  3. Added a 'chevron' button to allow for expanding and collapsing a group so we can see what the option looks like. It's worth making sure that the expand/collapse is obvious for the people doing the data entry, it might not be a pattern they are familiar with and could be frustrating.
  4. I think numbering the groups by saying "immunization 1, 2, 3 etc makes it easier to navigate if we are going to have a collapse/expand functionality and a list of 3+ groups.

Let me know what you think and if this aligns with the engineering approach?

Screen Shot 2022-04-08 at 16 27 40

Great solution here @shelaghm. @jingtang10 would one be able to still add repeat groups anywhere in the form e.g incases where the date is the same and they would want it separated from the groups and thus have date field above Immunization 1 group, and then the groups (immunization 1, 2, 3) below it.

hey @HenryRae - in that case wouldn't date just be a question that precedes the repeated group? i think that can be easily supported with small modification to the authored questionnaire. hope i understand the question correctly and this makes sense.

HenryRae commented 3 weeks ago

Yes @jingtang10, you got that right. It would precede the repeated group like below. Great then if it can be easily supported with small modification to the authored questionnaire. Thank you image

santosh-pingle commented 2 weeks ago

Reopening this issue instead of creating a new one, as this issue already mentions repeated group UI changes.

allan-on commented 2 weeks ago

Hello @santosh-pingle I've tested the changes introduced in this PR https://github.com/google/android-fhir/pull/1994 and it appears adding repeated groups in a paginated Questionnaire introduces an empty group.

empty_group

empty_repeated_group

empty_repeated_group_3

Are the group headers (labels) configurable?

cc @jingtang10

santosh-pingle commented 1 week ago

thanks! I used the catalog app's repeated group component, which has the default layout, and did not see the issue there. However, as you suggested, I will check the paginated layout by adding a repeated group item. I will update you if the mentioned edge case is reproducible.

Are the group headers (labels) configurable? => In PR #2571, Repeated Group, Group1, Group2, etc., are configurable and are the text values mentioned for the repeated group questionnaire item.

santosh-pingle commented 1 week ago

@allan-on can you please check whether #2574 fix your issue?

allan-on commented 1 week ago

@allan-on can you please check whether #2574 fix your issue?

Hi @santosh-pingle Yes, the issue is fixed with that PR ✅