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

Repeated Group: Answers within group are not present in the QuestionnaireResponse, if child question depends on enableWhen condition of another child question #1776

Closed
nsabale7 opened this issue Dec 22, 2022 · 4 comments · Fixed by #1787
Assignees
Labels
P1 High priority issue

Comments

@nsabale7
Copy link
Collaborator

Describe the bug
Suppose a child question depends on enableWhen condition of another child question and both the questions are part of repeated groups, answers are not present in the QuestionnaireResponse for the question which depends on enableWhen condition.

Component
SDC library

To Reproduce
Steps to reproduce the behavior:
Use test-questionnaire.txt as questionnaire json.

repeated-groups-bug.mp4

@jingtang10

@jingtang10 jingtang10 added the P1 High priority issue label Dec 22, 2022
@jingtang10 jingtang10 moved this from New to In Progress in Android FHIR SDK Dec 22, 2022
@jingtang10 jingtang10 self-assigned this Dec 22, 2022
@jingtang10
Copy link
Collaborator

fyi @kevinmost

@joiskash
Copy link
Collaborator

joiskash commented Dec 23, 2022

http://community.fhir.org/t/questionnaire-repeating-groups-what-is-the-correct-format/2276/3

Repeating groups appear multiple times. Repeating questions have multiple answers

It looks like we are adding multiple answers to the repeated group response item. Instead we should have multiple repeated group response items with one answer each

EDIT: Looks like this is happening in the end in getEnabledResponseItems

@joiskash
Copy link
Collaborator

joiskash commented Jan 9, 2023

The implementation currently adds answers to item.answer for repeated groups, and then later createRepeatedGroupResponse takes care of putting answerItemComponents to the repeated groups item.item field.
While writing the UT I have set the initial answer of the child question of the repeated group. But the code that populates questionnaireResponse with initial answers adds the answer of the repeated groups in item.item , so this results in createRepeatedGroupResonse returning an empty list, since it cannot find any answers in the item.answer field.

Suggested change : Initial answer for repeated groups should be set in the item.answer field so that it is consistent with the rest of the repeated group flow.

cc: @jingtang10 @kevinmost

@nsabale7
Copy link
Collaborator Author

nsabale7 commented Mar 2, 2023

This issue has been resolved. There is a new issue related with this #1895.

@nsabale7 nsabale7 closed this as completed Mar 2, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Complete in Android FHIR SDK Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority issue
Projects
Status: Complete
3 participants