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 questions nested under repeated answers #910

Open
joiskash opened this issue Nov 3, 2021 · 3 comments
Open

Handle questions nested under repeated answers #910

joiskash opened this issue Nov 3, 2021 · 3 comments
Assignees
Labels
effort:large Large effort - 5 to 10 days P1 High priority issue type:enhancement New feature or request

Comments

@joiskash
Copy link
Collaborator

joiskash commented Nov 3, 2021

Is your feature request related to a problem? Please describe.
Currently the SDC library supports repeated answers, but not items nested in answers that can repeat. Also full support for repeated answers is not yet available in the SDC library

Describe the solution you'd like
To support the spec completely we need to be able to handle all the questionnaireItem types that are shown in the diagram bellow.

Questionnaire ResponseTree_V2

linkId item.repeats item.type == group hasNestedItem isSupported
item_1 true false true false
item_7 true false false true
item_2 false false false true
not in image false false true true
item_group_3 false true true true
item__group_4 true true true false

One important thing to note in the above table is that if there are nested items within unsupported types, then they will automatically not be supported. Also the behavior of the library with a questionnaire which contains unsupported types is unknown.

Additional context
This also requires some thinking from the UX/UI point of view. eg: How do we handle a checkbox type with nested items? do we keep extra buttons to clear the nested answers/ edit nested items? What will the view look like?

Would you like to work on the issue?
I had started some initial work . Below are the following suggestions:

  1. Change the key of the linkIdToQuestionnaireResponseItemMap and maybe the linkIdToQuestionnaireItemMap to a data class that will contain information like how many repeated answers/ items are currently in the item.
  2. The data class questionnaireItemViewItem should probably have an optional questionnaireItemAnswerComponent
  3. New callback to handle change in a particular answer within an item to make sure the change is propagated through the tree.

cc: @jingtang10

@joiskash
Copy link
Collaborator Author

joiskash commented May 19, 2022

@RaaziaTarique I had created this diagram to get a hold of the tree structure of the questionnaireResponse for various types of questionnaireItem. It maybe of use while you implement the refactoring in #1369

@jingtang10 jingtang10 linked a pull request Jun 22, 2022 that will close this issue
7 tasks
@f-odhiambo
Copy link
Collaborator

Any update on this @kevinmost? What's the ETA for this?

@Tarun-Bhardwaj Tarun-Bhardwaj moved this to In Progress in Android FHIR SDK Sep 12, 2022
@Tarun-Bhardwaj Tarun-Bhardwaj moved this from In Progress to Backlog in Android FHIR SDK Sep 14, 2022
@Tarun-Bhardwaj Tarun-Bhardwaj added P1 High priority issue and removed P3 Low priority issue Data capture labels Sep 15, 2022
@fredhersch fredhersch moved this from Backlog to In Progress in Android FHIR SDK Sep 23, 2022
@fredhersch fredhersch moved this from In Progress to Backlog in Android FHIR SDK Sep 23, 2022
@jingtang10
Copy link
Collaborator

I think we should focus on rendering of nested questions under repeated answers in this ticket. Repeated groups are handled by kevin in a different issue #726

@jingtang10 jingtang10 changed the title Allow rendering of complex questions with repeated answers and nested items, repeated groups and nested items Handle questions nested under repeated answers Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:large Large effort - 5 to 10 days P1 High priority issue type:enhancement New feature or request
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

5 participants