opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
50 stars 41 forks source link

Implement feature to compute distance between two locations via Rules #3107

Closed Lentumunai-Mark closed 2 months ago

Lentumunai-Mark commented 4 months ago

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #3039 Fixes #https://github.com/onaio/fhir-resources/issues/2947

Engineer Checklist

Code Reviewer Checklist

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 32.06522% with 125 lines in your changes are missing coverage. Please review.

Project coverage is 29.9%. Comparing base (ac82739) to head (60328be). Report is 41 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/opensrp/fhircore/pull/3107/graphs/tree.svg?width=650&height=150&src=pr&token=IJUTHZUGGH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp)](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) ```diff @@ Coverage Diff @@ ## main #3107 +/- ## ========================================= + Coverage 29.6% 29.9% +0.3% - Complexity 658 673 +15 ========================================= Files 239 243 +4 Lines 11204 11431 +227 Branches 1948 1981 +33 ========================================= + Hits 3323 3429 +106 - Misses 7447 7553 +106 - Partials 434 449 +15 ``` | [Flag](https://app.codecov.io/gh/opensrp/fhircore/pull/3107/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | Coverage Δ | | |---|---|---| | [geowidget](https://app.codecov.io/gh/opensrp/fhircore/pull/3107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | `47.2% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | Coverage Δ | | |---|---|---| | [...gister/fhircore/engine/rulesengine/RulesFactory.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Frulesengine%2FRulesFactory.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvcnVsZXNlbmdpbmUvUnVsZXNGYWN0b3J5Lmt0) | `69.6% <100.0%> (+0.3%)` | :arrow_up: | | [...gister/fhircore/engine/util/SharedPreferenceKey.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Futil%2FSharedPreferenceKey.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvdXRpbC9TaGFyZWRQcmVmZXJlbmNlS2V5Lmt0) | `100.0% <100.0%> (ø)` | | | [.../engine/rulesengine/services/LocationCoordinate.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Frulesengine%2Fservices%2FLocationCoordinate.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvcnVsZXNlbmdpbmUvc2VydmljZXMvTG9jYXRpb25Db29yZGluYXRlLmt0) | `85.7% <85.7%> (ø)` | | | [...r/fhircore/engine/util/location/PermissionUtils.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Futil%2Flocation%2FPermissionUtils.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvdXRpbC9sb2NhdGlvbi9QZXJtaXNzaW9uVXRpbHMua3Q=) | `0.0% <0.0%> (ø)` | | | [...re/quest/ui/questionnaire/QuestionnaireActivity.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fquest%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fquest%2Fui%2Fquestionnaire%2FQuestionnaireActivity.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9xdWVzdC9zcmMvbWFpbi9qYXZhL29yZy9zbWFydHJlZ2lzdGVyL2ZoaXJjb3JlL3F1ZXN0L3VpL3F1ZXN0aW9ubmFpcmUvUXVlc3Rpb25uYWlyZUFjdGl2aXR5Lmt0) | `3.2% <0.0%> (+0.3%)` | :arrow_up: | | [...gister/fhircore/engine/datastore/ProtoDataStore.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Fdatastore%2FProtoDataStore.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvZGF0YXN0b3JlL1Byb3RvRGF0YVN0b3JlLmt0) | `65.9% <58.8%> (+0.3%)` | :arrow_up: | | [...store/serializers/LocationCoordinatesSerializer.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Fdatastore%2Fserializers%2FLocationCoordinatesSerializer.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvZGF0YXN0b3JlL3NlcmlhbGl6ZXJzL0xvY2F0aW9uQ29vcmRpbmF0ZXNTZXJpYWxpemVyLmt0) | `42.8% <42.8%> (ø)` | | | [...fhircore/engine/util/adapter/InstantTypeAdapter.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Futil%2Fadapter%2FInstantTypeAdapter.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvdXRpbC9hZGFwdGVyL0luc3RhbnRUeXBlQWRhcHRlci5rdA==) | `0.0% <0.0%> (ø)` | | | [...ore/engine/rulesengine/services/LocationService.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Frulesengine%2Fservices%2FLocationService.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvcnVsZXNlbmdpbmUvc2VydmljZXMvTG9jYXRpb25TZXJ2aWNlLmt0) | `73.9% <73.9%> (ø)` | | | [...ter/fhircore/engine/util/location/LocationUtils.kt](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree&filepath=android%2Fengine%2Fsrc%2Fmain%2Fjava%2Forg%2Fsmartregister%2Ffhircore%2Fengine%2Futil%2Flocation%2FLocationUtils.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#diff-YW5kcm9pZC9lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvc21hcnRyZWdpc3Rlci9maGlyY29yZS9lbmdpbmUvdXRpbC9sb2NhdGlvbi9Mb2NhdGlvblV0aWxzLmt0) | `0.0% <0.0%> (ø)` | | | ... and [1 more](https://app.codecov.io/gh/opensrp/fhircore/pull/3107?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/opensrp/fhircore/pull/3107/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp)
ndegwamartin commented 3 months ago

@marklosh since the feature is tested and working and the tests are running on CI lets merge this in and track the CI issue on a separate ticket. You can @Ignore the failing test case for now.

Please create the new ticket with the details.

Lentumunai-Mark commented 2 months ago

@ndegwamartin here is the ticket #3251