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

Nested questionnaireResponseComponent with enableWhen in repeated group is missing from questionnaire response. #1940

Merged
merged 8 commits into from
Apr 7, 2023

Conversation

santosh-pingle
Copy link
Collaborator

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #1895

Description
The questionnaire response contains answers to all selected and enabled questionnaire items. However, when copying the questionnaire response, the use of 'getEnabledResponseItems' fails to copy the selected answers of enabled items.
when the type is a repeated group item, the questionnaireResponseItemParentMap is always empty in the findEnableWhenQuestionnaireResponseItem() API. This is because the buildParentList logic in EnablementEvaluator fails to correctly build the parent list for repeated group items.

Alternative(s) considered

Type
Choose one: Bug fix

Screenshots (if applicable)

Checklist

  • I have read and acknowledged the Code of conduct.
  • I have read the Contributing page.
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).

…up is missing from questionnaire response.
@santosh-pingle
Copy link
Collaborator Author

Screen.Recording.2023-03-24.at.5.38.18.PM.mov

@santosh-pingle
Copy link
Collaborator Author

I am adding end to end android test for this fix, but getting below error when Add item get clicked second time to add more repeated group.

androidx.test.espresso.AmbiguousViewMatcherException: 'view.getId() is <2131230792/com.google.android.fhir.datacapture.test:id/add_item>' matches multiple views in the hierarchy.
Problem views are marked with '****MATCHES****' below.

Can we please review the PR? If the Android test gets fixed, I will push the changes; otherwise, I will have a separate PR for this Android test.

@santosh-pingle
Copy link
Collaborator Author

I am adding end to end android test for this fix, but getting below error when Add item get clicked second time to add more repeated group.

androidx.test.espresso.AmbiguousViewMatcherException: 'view.getId() is <2131230792/com.google.android.fhir.datacapture.test:id/add_item>' matches multiple views in the hierarchy.
Problem views are marked with '****MATCHES****' below.

Can we please review the PR? If the Android test gets fixed, I will push the changes; otherwise, I will have a separate PR for this Android test.

android test is added.

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great catch! Thanks for debugging!

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@santosh-pingle thanks again for this change!

@santosh-pingle santosh-pingle enabled auto-merge (squash) April 7, 2023 06:53
@santosh-pingle santosh-pingle merged commit 135feb2 into google:master Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants