-
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
enableWhenExpression follow up PR for maintaining CodeHealth #1369
enableWhenExpression follow up PR for maintaining CodeHealth #1369
Conversation
…ementEvaluator.kt
Codecov Report
@@ Coverage Diff @@
## master #1369 +/- ##
============================================
+ Coverage 85.65% 85.67% +0.01%
+ Complexity 713 709 -4
============================================
Files 149 149
Lines 10746 10745 -1
Branches 855 854 -1
============================================
+ Hits 9205 9206 +1
+ Misses 1104 1103 -1
+ Partials 437 436 -1
Continue to review full report at Codecov.
|
@@ -164,3 +150,25 @@ val fhirPathEngine: FHIRPathEngine = | |||
with(FhirContext.forCached(FhirVersionEnum.R4)) { | |||
FHIRPathEngine(HapiWorkerContext(this, DefaultProfileValidationSupport(this))) | |||
} | |||
|
|||
/** Map from link IDs to questionnaire response items. */ | |||
private fun linkIdToQuestionnaireResponseItemMap(questionnaireResponse: QuestionnaireResponse) = |
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.
there is a similar method/map in QuestionnaireViewModel (linkIdToQuestionnaireResponseItemMap). We should utilize that. This map creation every time for each evaluation would be expensive. Or is there any specific reason to not use that map!
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.
We were previously using the same mapping but it was being done in the QuestionnaireViewModel as we were not passing the QuestionnaireResponse to EnablementEvaluator. I can use the same method present QuestionnaireViewModel though.
@joiskash please take a look at this. We spoke about this before. This is a really important refactoring. |
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.
These changes look good, but I am unable to figure out one part:
In questionnaireResponseItemChangedCallback
the linkIdToQuestionnaireResponseItemMap
is modified. Is this map equivalent to the map that you get after createLinkIdToQuestionnaireResponseItemMap
with the updated questionnaireResponse ?
Yes, as I have moved |
@f-odhiambo are you aware if this PR is ready for review by Google? |
This PR is ready for review @Tarun-Bhardwaj |
i'll raise a separate pr |
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #1345
Description
Remove questionnaireResponseItemRetriever and instead implement the functionality of finding the questionnaire response item from linkId inside of the enablement package.
Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type
Choose one: Code health
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.