Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle repeated groups #726

Closed
jingtang10 opened this issue Aug 18, 2021 · 29 comments · Fixed by #1559, #1994, #2050, #2564 or #2571
Closed

Handle repeated groups #726

jingtang10 opened this issue Aug 18, 2021 · 29 comments · Fixed by #1559, #1994, #2050, #2564 or #2571
Assignees
Labels
effort:large Large effort - 5 to 10 days P1 High priority issue type:enhancement New feature or request ux

Comments

@jingtang10
Copy link
Collaborator

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
Copy link
Collaborator

joiskash commented Mar 16, 2022

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

For every child , please provide details of immunization

  • Time of immunization
  • Place of immunization

cc: @kumaakh @jjtswan

@jingtang10 jingtang10 added P1 High priority issue and removed P2 Medium priority issue labels Mar 18, 2022
@jingtang10
Copy link
Collaborator Author

bumping to P1

@fredhersch
Copy link
Collaborator

@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
Copy link

@joiskash @fredhersch @jingtang10

How about something like this?
Screen Shot 2022-03-23 at 11 58 42

@kumaakh
Copy link

kumaakh commented Mar 23, 2022 via email

@f-odhiambo
Copy link
Collaborator

@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
Copy link
Collaborator

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

@fredhersch
Copy link
Collaborator

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:

  • Agree about + / - options (@shelaghm - we will need to be able to remove an item group too)
  • Making each group collapsible could be a nice Ux element - @shelaghm
  • For something like adding an entire new family member with multiple steps, this seems more like a workflow process we are trying to enable. To me this may need a different solution / approach.

Open to other thoughts

cc: @jingtang10

@f-odhiambo
Copy link
Collaborator

@RaaziaTarique FYI

@f-odhiambo
Copy link
Collaborator

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

@RaaziaTarique
Copy link
Contributor

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
Copy link
Contributor

RaaziaTarique commented Apr 6, 2022

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
Copy link
Collaborator Author

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

@shelaghm
Copy link

shelaghm commented Apr 8, 2022

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

@jingtang10 jingtang10 linked a pull request Apr 14, 2022 that will close this issue
7 tasks
@maimoonak
Copy link
Collaborator

maimoonak commented Jun 8, 2022

  • The PR has some sample working code which would need refactor of methods like getGuestionnaireResponse1, commented out code... etc
  • Test with latest code and make any changes required
  • Add folding button as in mockup above
  • The ResourceMapper and extraction and population not updated to handle the changes
  • Validation of questionnaire and response to be tested
  • Add sample layout in library
  • Unit tests
  • Handle any edge cases and test for group, and other types as well

@f-odhiambo

@jingtang10
Copy link
Collaborator Author

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

@jingtang10
Copy link
Collaborator Author

jingtang10 commented Nov 11, 2022

@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 jingtang10 removed their assignment Nov 11, 2022
@jingtang10
Copy link
Collaborator Author

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

@shelaghm
Copy link

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

@omarismail94 omarismail94 removed this from the Data Capture Library 0.1.0-beta07 milestone Jan 19, 2023
@jingtang10 jingtang10 added the effort:large Large effort - 5 to 10 days label Feb 23, 2023
@AbdulmalikAdans
Copy link

📜

@HenryRae
Copy link

HenryRae commented May 28, 2024

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
Copy link
Collaborator Author

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
Copy link

HenryRae commented Jun 3, 2024

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
Copy link
Collaborator

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

@allan-on
Copy link
Contributor

allan-on commented Jun 14, 2024

Hello @santosh-pingle I've tested the changes introduced in this PR #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
Copy link
Collaborator

santosh-pingle commented Jun 17, 2024

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
Copy link
Collaborator

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

@allan-on
Copy link
Contributor

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment