-
Notifications
You must be signed in to change notification settings - Fork 302
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
Include the corresponding questionnaireResponseItemComponents for nested items in the group. #2005
Include the corresponding questionnaireResponseItemComponents for nested items in the group. #2005
Conversation
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
Newly added code changes : It traverses the questionnaire items, verifying the presence of corresponding items within the response. If an item is found to be missing, a new empty response item is added to the questionnaire response. (Identifying missing items and maintaining a separate list is insufficient. It is equally important to preserve the order while inserting the missing item to the questionnaire response.) |
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/test/java/com/google/android/fhir/datacapture/QuestionnaireViewModelTest.kt
Outdated
Show resolved
Hide resolved
datacapture/src/test/java/com/google/android/fhir/datacapture/QuestionnaireViewModelTest.kt
Outdated
Show resolved
Hide resolved
datacapture/src/test/java/com/google/android/fhir/datacapture/QuestionnaireViewModelTest.kt
Outdated
Show resolved
Hide resolved
datacapture/src/test/java/com/google/android/fhir/datacapture/QuestionnaireViewModelTest.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed please try to simplify the function signature.
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #1998
Description
The issue was reproducible itself when the QuestionnaireResponse did not include questionnaireResponseItemComponents for nested items within the group type item.
To resolve this issue, it is necessary to include the corresponding questionnaireResponseItemComponents for nested items in the group type during initialization of questionnaire view model. This ensures that the corresponding view item will be created.
#2005 (comment) approach is implemented. With this approach if response contains non-matching item to question item linkId, then it get removed from the questionnaire response.
Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type
Choose one: Bug fix
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.