android-fhir
android-fhir copied to clipboard
Add a Wrapper For fhirPath expressions, cqf-calculatedValue, cqf-library and cqf-expression.
Is your feature request related to a problem? Please describe. FhirPathEngine, DataRenderer and related classes to evaluate fhirPath expressions, cqf-calculatedValue, cqf-library and cqf-expression will be used multiple time in the project so it's better to have central wrapper for these classes.
Following issues which may use this wrapper in the future:
https://github.com/google/android-fhir/issues/1040 (This wrapper is a Pre-Requisite) https://github.com/google/android-fhir/issues/1033 https://github.com/google/android-fhir/issues/1059
Describe the solution you'd like Add a wrapper in the common module.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context @jingtang10 proposed this solution in the SDK ticket discussion call held on 18th March, 2022 CC: @f-odhiambo
Would you like to work on the issue? Please state if this issue should be assigned to you or who you think could help to solve this issue.
as a first step to speed up development, i think it's ok to create this new api as an internal api in the datacapture
module. as a next step we can move it to the common
module (which will require a separate release).
I recommend(draft) the following:
class FhirPathWrapper
functions:
-
evaluate
- Can be used bycqf-calculatedValue
,cqf-express
,calculatedExpression
extensions -
evaluateToBoolean
- Can be used byenableWhen
extension
It can also be used in the FHIR Path variable issue at a later point
Most of these output either a boolean or a list of resources.
The wrapper can be extended to support constant extensions that need local support such as %questionnaire
, qitem()
, sum()
etc defined here
FhirPathWrapper
can also be modified to add support for other expressions as well such as answerExpression
and others if needed.
@RaaziaTarique I don't know if this is what @jingtang10 wanted but I believe it's a start based on my understanding
Edited with @RaaziaTarique
@RaaziaTarique @jingtang10 has the approach here been resolved? Thanks
Updates on this
- Min/Max validation Works for Date but not other data types - PR https://github.com/google/android-fhir/pull/1442 ready
- calculated-expression - PR https://github.com/google/android-fhir/pull/1380 ready
- calculated-value - PR https://github.com/google/android-fhir/pull/1442 ready
- Implement calculated-expression extension 1059 | variables -> PR https://github.com/google/android-fhir/pull/1328 ready
- CQF Expression not implemented yet - Needs a discussion CC @maimoonak
CC @fredhersch @jingtang10
- https://github.com/google/android-fhir/pull/1442 has comments to be addressed.
- just left a review. also requested @joiskash to review.
- that's the same PR as 1
- just left a review
- can you set up something please @maimoonak
The expressions support has a long list https://build.fhir.org/ig/HL7/sdc/expressions.html and https://build.fhir.org/ig/HL7/sdc/behavior.html. Some of the expressions discussed in current thread are below
- Date picker restrict -> https://github.com/google/android-fhir/issues/1040 -> PR UNDER REVIEW https://github.com/google/android-fhir/pull/1442
- Initial expression -> https://github.com/google/android-fhir/issues/1033 -> PR MERGED -> https://github.com/google/android-fhir/pull/1228
- Variable support -> https://github.com/google/android-fhir/issues/1059 -> PR APPROVED -> https://github.com/google/android-fhir/pull/1328
- Calculated expression -> https://github.com/google/android-fhir/issues/971 -> PR AWAITING PR 1328 (variables work) -> https://github.com/google/android-fhir/pull/1380
- Calculated value -> PR READY -> https://github.com/google/android-fhir/pull/1442
- Answer expression -> https://github.com/google/android-fhir/issues/1039 -> PR UNDER REVIEW -> https://github.com/google/android-fhir/pull/1480
- EnableWhen expression -> https://github.com/google/android-fhir/issues/819 -> PR MERGED (long ago) -> https://github.com/google/android-fhir/pull/1294
- Candidate expression -> https://github.com/google/android-fhir/issues/1038 -> AWAITING PR 1480 (overlaps functionality)
- CQF Expression -> very vast range http://hl7.org/fhir/R4/extension-cqf-expression.html -> not implemented yet and no specific issue or use case exists/linked - Needs a discussion
@f-odhiambo @jingtang10 @Tarun-Bhardwaj
@fredhersch See the summery above on the related FHIRPath expression tickets
I think as a tracking issue this issue can be closed as the only item left is 1038.