android-fhir
android-fhir copied to clipboard
Repeated Group: Questionnaire Response validator fails if response contains multiple answers
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