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

Stop validating disabled questions #1763

Merged
merged 8 commits into from
Dec 19, 2022

Conversation

jingtang10
Copy link
Collaborator

@jingtang10 jingtang10 commented Dec 9, 2022

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

Fixes #1760

Description

  • Move the logic in findEnableWhenQuestionnaireResponseItem from the QuestionnarieViewModel class to EnablementEvaluator. This is a better logical separation since that is business logic specific to how enableWhen works
  • Related to the previous refactoring, the questionnaireResponseItemPreOrderList and questionnaireResponseItemParentMap are both moved to EnablementEvaluator too.
  • EnablementEvaluator is no longer an object since it is now specific to a QuestionnaireResponse in order to build the structures required for finding the questionnaire response item that determins the enablement status of another question.
  • As a result, QuestionnaireResponseValidator is now able to use EnablementEvaluator in its validation.

Alternative(s) considered
NA

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

Copy link
Contributor

@omarismail94 omarismail94 left a comment

Choose a reason for hiding this comment

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

Awesome change!!! Just a few comments

@jingtang10
Copy link
Collaborator Author

@omarismail94 @aditya-07 please take another look thanks!

@jingtang10 jingtang10 merged commit f41979d into google:master Dec 19, 2022
@jingtang10 jingtang10 deleted the validate-enabled branch December 19, 2022 12:58
kevinmost pushed a commit to kevinmost/android-fhir that referenced this pull request Jan 4, 2023
* Stop validating disabled questions

* Remove questionnaire from the constructor of enablement evaluator

* Fix EnablementEvaluatorTest.kt

* Add test case for disabled question

* Address comments

* Address comments
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 this pull request may close these issues.

SDC | Bug: hidden field showing in validation required highlight
6 participants