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: Questionnaire Response validator fails if response contains multiple answers #1899

Open
nsabale7 opened this issue Mar 7, 2023 · 1 comment · May be fixed by #2675
Open

Comments

@nsabale7
Copy link
Collaborator

nsabale7 commented Mar 7, 2023

Describe the bug
Suppose a questionnaire response json is passed as a argument with multiple answers for repeated group item. The Questionnaire response validator throws exception.
Caused by: java.lang.IllegalArgumentException: Missing questionnaire item for questionnaire response item question-1 E/AndroidRuntime: at com.google.android.fhir.datacapture.validation.QuestionnaireResponseValidator.checkQuestionnaireResponseItems(QuestionnaireResponseValidator.kt:216) at com.google.android.fhir.datacapture.validation.QuestionnaireResponseValidator.checkQuestionnaireResponseItem(QuestionnaireResponseValidator.kt:236) at com.google.android.fhir.datacapture.validation.QuestionnaireResponseValidator.checkQuestionnaireResponseItems(QuestionnaireResponseValidator.kt:222) at com.google.android.fhir.datacapture.validation.QuestionnaireResponseValidator.checkQuestionnaireResponse(QuestionnaireResponseValidator.kt:202) at com.google.android.fhir.datacapture.QuestionnaireViewModel.<init>(QuestionnaireViewModel.kt:119) at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at androidx.lifecycle.SavedStateViewModelFactory.create(SavedStateViewModelFactory.java:120)

Component
SDC library

To Reproduce
Steps to reproduce the behavior:
Use following questionnaire and questionnaire response
component_repeated_group.txt
component_repeated_group_response_multiple.txt

@jingtang10

@jingtang10 jingtang10 linked a pull request Sep 17, 2024 that will close this issue
7 tasks
@jingtang10
Copy link
Collaborator

@nsabale7 Please see the linked PR above.

It's actually a little bit concerning that the unit test coverage is so bad so that the unit tests still pass after this change...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants