android-fhir
android-fhir copied to clipboard
Support evaluation of variables, launchContext and other FHIR contexts for cqf-calculatedValue expressions
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2292 #1759
Description Add support for evaluation of variable and x-fhir-query expressions(through launchContext) in cqf-calculatedValue expressions, currently supported in minValue and maxValue extensions
Some of the changes included in this PR are
- Refactor Validator object classes in the validation module to accept
expressionEvaluator
function that would be used in validation to evaluate cqf-calculatedValue expressions - Remove
Type.valueOrCalculateValue
and replaced it's usage by passing the evaluated calculated value to thevalidate
method of the different validator classes - Remove
resolveCqfExpression
and replaced it withevaluateExpressionValue
in theExpressionEvaluator
class - Refactor
QuestionnaireViewItem
to accept two more parametersminAnswerValue
andmaxAnswerValue
that could then be used within view factory classes to validate constraints
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
- [x] I have read and acknowledged the Code of conduct.
- [x] I have read the Contributing page.
- [x] I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
- [x] I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
- [x] I have run
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project. - [x] I have run
./gradlew check
and./gradlew connectedCheck
to test my changes locally. - [x] 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).
@LZRS please address the above comments by replying and resolving them. just so that it's clear when everything's been addressed. thanks!
can you resolve the merge conflicts
Its a little difficult to follow the changes. Can you please update the description with major changes in this PR that supports the said feature ? Thanks.
I've updated the description of the PR, describing some of the changes included in the PR. You could give it another look
thanks! will take a look shortly. in the future please also reply to comments you've addressed if you've addressed them and resolve them.
thanks! will take a look shortly. in the future please also reply to comments you've addressed if you've addressed them and resolve them.
Thank you! Noted