-
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
Add support for Answer Options Toggle Extension #2034
Add support for Answer Options Toggle Extension #2034
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
50024ac
to
5799d2f
Compare
6a89c2d
to
ed9eb82
Compare
@LZRS thanks for the PR :D |
Yes, it's ready for review |
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.
Thanks for this change - really good tests and in general high quality code!
The most important comment is my first comment in QuestionnaireViewItem.kt
. Please take a look and address. I think as a result this will also improve the general code quality of the SDC library. At the moment we're incorrectly handling some answer option logic in the UI code - this should be changed.
Thanks!
datacapture/src/main/java/com/google/android/fhir/datacapture/views/QuestionnaireViewItem.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
...capture/src/test/java/com/google/android/fhir/datacapture/views/QuestionnaireViewItemTest.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/views/QuestionnaireViewItem.kt
Outdated
Show resolved
Hide resolved
...capture/src/test/java/com/google/android/fhir/datacapture/views/QuestionnaireViewItemTest.kt
Show resolved
Hide resolved
...capture/src/test/java/com/google/android/fhir/datacapture/views/QuestionnaireViewItemTest.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.
Thanks for the good work! :D
I left a comment.
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.
Looks great, thanks @LZRS :D
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
…er-options-toggle
To ensure that getQuestionnaireState is always called in suspend and avoids runBlocking
...rc/main/java/com/google/android/fhir/datacapture/enablement/EnabledAnswerOptionsEvaluator.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
Show resolved
Hide resolved
@omarismail94 @FikriMilano I want to bring this PR to your attention too. @LZRS managed to remove one call to initialize the questionnaire state whilst maintaining the correct behavior (I assume he tested this thoroughly 😀) - I wonder if this PR would have a positive impact on the performance. Can you two take a look at this? Thanks |
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
…er-options-toggle
Head branch was pushed to by a user without write access
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
After evaluation of enabled answer options, and therefore disabled questionnaire response answers
...c/main/java/com/google/android/fhir/datacapture/expressions/EnabledAnswerOptionsEvaluator.kt
Outdated
Show resolved
Hide resolved
...c/main/java/com/google/android/fhir/datacapture/expressions/EnabledAnswerOptionsEvaluator.kt
Outdated
Show resolved
Hide resolved
...c/main/java/com/google/android/fhir/datacapture/expressions/EnabledAnswerOptionsEvaluator.kt
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
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.
thanks for this - just a really small comment otherwise good to merge
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #1773
Description
Clear and concise code change description.
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 | Feature | Documentation | Testing | Code health | Builds | Releases | Other)
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.