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

Evaluate enable when with newly created repeated groups #2597

Merged
merged 5 commits into from
Jul 4, 2024

Conversation

jingtang10
Copy link
Collaborator

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

Fixes #2590

Description
Reinitialize the enablement evaluator when the questionnaire response tree changes (i.e. repeated groups or items with nested questions are added or removed). This makes sure the pre-order list and parent tree are recreated to reflect the new tree structure of the questionnaire response, and that the question referenced in the enable when can be identified correctly.

Alternative(s) considered
I asked this question in FHIR chat https://chat.fhir.org/#narrow/stream/179266-fhirpath/topic/parent.28.29.20or.20siblings.28.29.3F and Paul and Brian suggested that we could use a variable defined at the parent of the repeated group. If this works in our case still needs to be verified.

Type
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).

@jingtang10 jingtang10 changed the title Repeated group enable when Evaluate enable when with newly created repeated groups Jul 3, 2024
Copy link
Collaborator

@santosh-pingle santosh-pingle left a comment

Choose a reason for hiding this comment

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

thanks Jing.
LGTM!

@jingtang10 jingtang10 enabled auto-merge (squash) July 4, 2024 14:59
@jingtang10 jingtang10 merged commit 445cf3f into google:master Jul 4, 2024
6 checks passed
@jingtang10 jingtang10 deleted the repeated-group-enable-when branch July 4, 2024 16:17
santosh-pingle pushed a commit to santosh-pingle/android-fhir that referenced this pull request Jul 8, 2024
* Update enablement evaluator

* Add test case for calculating enable when with new repeated group

* Add tests for shouldHaveNestedItemsUnderAnswers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Repeated Group: Anomalous behaviour of enableWhen expressions in a repeated group
3 participants