-
Notifications
You must be signed in to change notification settings - Fork 295
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
enable when expression can access variable #2132
enable when expression can access variable #2132
Conversation
- enableWhenExpression can access variablesMap and launchContextMap - variableExpression can access launchContextMap
hello this is ready for review |
demo/src/main/java/com/google/android/fhir/demo/AddPatientViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt
Outdated
Show resolved
Hide resolved
...com/google/android/fhir/datacapture/QuestionnaireValidationErrorMessageDialogFragmentTest.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.
I think we have too many parameter dependencies in functions. Lot of parameters are constant for a specific questionnaire session, for example, questionnaire
, questionnaireItemParentMap
, questionnaireLaunchContextMap
.
What we can do is create a constructor based EnablementEvaluator & ExpressionEvaluator which takes in the above parameters. And maintain an object of these in the QuestionnaireViewModel. Then for each APIs in EnablementEvaluator & ExpressionEvaluator we won't need to pass those parameters. Think about this.
datacapture/src/main/java/com/google/android/fhir/datacapture/enablement/EnablementEvaluator.kt
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/enablement/EnablementEvaluator.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/FhirPathUtil.kt
Outdated
Show resolved
Hide resolved
- With unmerged PR google#2032 - With unmerged PR #1 - With unmerged PR google#1669 - With unmerged PR google#2132 - With unmerged PR #9
- With unmerged PR google#2032 - With unmerged PR #1 - With unmerged PR google#1669 - With unmerged PR google#2132
- With unmerged PR google#2032 - With unmerged PR #1 - With unmerged PR google#1669 - With unmerged PR google#2132 - With unmerged PR #9 - With unmerged PR google#2076 - With unmerged PR #10
@MJ1998 I like the idea, makes sense 👍 |
- ExpressionEvaluator, EnablementEvaluator, EnabledAnswerOptionsEvaluator. - Moving the params from method to class constructor for easier use of methods by having less params.
Out of topic, my hands can't resist fixing this issue.
is this ready for review fikri? |
@jingtang10 updating the kotlin doc is the only thing left |
…fhirpath/FhirPathUtil.kt
…fhirpath/ExpressionEvaluator.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluator.kt
…fhirpath/ExpressionEvaluator.kt
…fhirpath/ExpressionEvaluatorTest.kt
…fhirpath/ExpressionEvaluatorTest.kt
Some small changes I've just applied - and ran spotless. Thanks again @FikriMilano for this great PR! |
these have been addressed. |
Jajoo - I'm satisfied that your review comments have been addressed and I've approved this PR. So I've "dismissed" your review to unblock merge. But if you have any further comments please add them and/or create another issue. |
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2096 #2094
Description
Provide proper contextMap when evaluating the following:
Alternative(s) considered
N/A
Type
Feature
Video
Demo.webm
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.