android-fhir
android-fhir copied to clipboard
Restricting DatePicker to select date from outside the defined Range (Min/Max). Added support for fhir path expression in Min / Max Validators
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #1040
Description The min/max validators are updated to use fhir path expressions. For date picker specifically, the widget doesn't allow input outside of the date range, this is a widget specific behavior. User can specify minimum and maximum date range using minValue and maxValue expression in questionnaire in order to prevent selecting the dates from outside the specified range. cqf-calculatedvalue expression is used to make the expression dynamic and use for some purpose as Age case (for example we can only registered a child that is born after 2020) (min value case).
Alternative(s) considered Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type Choose one: Feature
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. - [ ] 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).
Codecov Report
Merging #1442 (9896a87) into master (eb894de) will decrease coverage by
35.30%
. The diff coverage isn/a
.
:exclamation: Current head 9896a87 differs from pull request most recent head 1e5bc7b. Consider uploading reports for the commit 1e5bc7b to get more accurate results
@@ Coverage Diff @@
## master #1442 +/- ##
============================================
- Coverage 35.30% 0 -35.31%
============================================
Files 144 0 -144
Lines 4830 0 -4830
Branches 853 0 -853
============================================
- Hits 1705 0 -1705
+ Misses 2904 0 -2904
+ Partials 221 0 -221
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Thanks for the change. This PR actually does 2 things:
- the min/max validators are updated to use fhir path expressions. for this part, please add unit tests
- for date picker specifically, the widget doesn't allow input outside of the date range, this is a widget specfic behavior
Please update the description to reflect this.
@jingtang10 This PR is ready for review CC @Tarun-Bhardwaj
https://user-images.githubusercontent.com/35099184/180433662-5c6fde87-bbcf-4558-b2f7-ad1d47f7eeb7.mp4
I've resolved non-test case classes feedback, can you please review so that i can move to resolve the unit test cases. thanks in advance. @jingtang10
cc @f-odhiambo
@aurangzaibumer please fix build errors (run spotlessApply)
@aurangzaibumer please fix build errors (run spotlessApply)
done. thanks
Hello @omarismail94 I've tried updating the branch with master couple of times but PR gateways are still failing. Error Caused by: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 120000 ms Can you please guide me on this. Thanks
For testing purpose updating example
"resourceType": "Questionnaire",
"item": [
{
"linkId": "1",
"text": "When was your last menstrual period? (LMP)",
"type": "date",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/maxValue",
"valueDate": "2022-12-30"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/minValue",
"valueDate": "2022-12-21"
}
]
...