Skip to content
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

Implement inequality operators (<, >, <=, >=) in the enable when statement #848

Merged
merged 20 commits into from
Nov 25, 2021

Conversation

santosh-pingle
Copy link
Collaborator

@santosh-pingle santosh-pingle commented Oct 21, 2021

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #818

Description
Implement inequality operators (<, >, <=, >=) in the enable when statement

Alternative(s) considered
no

Type
Choose one: Bug fix

Screenshots (if applicable)

Checklist

  • I have read and acknowledged the Code of conduct
  • I have read How to Contribute
  • I have read the Developer's guide
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach
  • 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
  • I have built and run the reference app(s) to verify my change fixes the issue and/or does not break the reference app(s)

@santosh-pingle santosh-pingle changed the title Sp/inequality Implement inequality operators (<, >, <=, >=) in the enable when statement Oct 21, 2021
@santosh-pingle santosh-pingle marked this pull request as ready for review October 21, 2021 16:02
@santosh-pingle santosh-pingle added this to In progress in Data capture library via automation Oct 21, 2021
@jingtang10
Copy link
Collaborator

please update this PR now that #847 is merged

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please udpate

@santosh-pingle
Copy link
Collaborator Author

Updating PR.

@codecov
Copy link

codecov bot commented Nov 9, 2021

Codecov Report

Merging #848 (edeff1d) into master (e3b7e7e) will increase coverage by 0.13%.
The diff coverage is 76.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #848      +/-   ##
============================================
+ Coverage     88.55%   88.68%   +0.13%     
- Complexity      467      469       +2     
============================================
  Files           107      107              
  Lines          9137     9147      +10     
  Branches        609      614       +5     
============================================
+ Hits           8091     8112      +21     
+ Misses          715      704      -11     
  Partials        331      331              
Impacted Files Coverage Δ
...src/main/java/com/google/android/fhir/MoreTypes.kt 79.41% <72.72%> (+11.55%) ⬆️
...fhir/datacapture/enablement/EnablementEvaluator.kt 78.26% <100.00%> (+4.57%) ⬆️
...main/java/com/google/android/fhir/UnitConverter.kt 69.23% <0.00%> (+69.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3b7e7e...edeff1d. Read the comment docs.

@santosh-pingle
Copy link
Collaborator Author

@jingtang10
Can you please review it?
I will check whether I can add more tests to increase code coverage.

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, merge the MoreTypes.kt files and move it to the common module and use the Type.compareTo rather than defining the extension functions on the QuestionnaireItemEnableWhenComponent.

@santosh-pingle
Copy link
Collaborator Author

Working on review comments.

@santosh-pingle
Copy link
Collaborator Author

santosh-pingle commented Nov 16, 2021

#923 (move moretypes file to common module)

@santosh-pingle
Copy link
Collaborator Author

as discussed, merge the MoreTypes.kt files and move it to the common module and use the Type.compareTo rather than defining the extension functions on the QuestionnaireItemEnableWhenComponent.

done.

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general we shouldn't be making any code change without unit test change.

If MoreTypes.kt file is changed please add unit tests as well.

I don't believe the quantity type needs to be singled out in the unit test for the enablement evaluator -- that's an irrelevant detail in the code of enablement evaluator. but that's a relevant detail in the MoreTypes.kt file, so the tests should reside there.

@santosh-pingle
Copy link
Collaborator Author

yes, quantity tests need to be moved to MoreTypes.kt, thanks!

@santosh-pingle
Copy link
Collaborator Author

Updating code as per review comments.

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @santosh-pingle!

@santosh-pingle santosh-pingle merged commit 6e722c6 into master Nov 25, 2021
Data capture library automation moved this from In progress to Done Nov 25, 2021
@santosh-pingle santosh-pingle deleted the sp/inequality branch November 25, 2021 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement inequality operators (<, >, <=, >=) in the enable when statement
3 participants