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

Refactor register filter with REL tags #3488

Merged
merged 46 commits into from
Sep 20, 2024
Merged

Conversation

ellykits
Copy link
Collaborator

@ellykits ellykits commented Sep 11, 2024

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

Fixes #3473

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@ellykits ellykits added the Work In Progress Describes an items that is not complete. Mostly used for scoping issues of discussions label Sep 11, 2024
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 47.28507% with 233 lines in your changes missing coverage. Please review.

Project coverage is 27.8%. Comparing base (2f8055b) to head (d487f2d).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...er/fhircore/engine/data/local/DefaultRepository.kt 51.1% 122 Missing and 32 partials ⚠️
...er/fhircore/geowidget/screens/GeoWidgetFragment.kt 0.0% 49 Missing ⚠️
...rcore/engine/util/extension/FhirEngineExtension.kt 66.6% 4 Missing and 3 partials ⚠️
.../fhircore/engine/ui/multiselect/MultiSelectView.kt 0.0% 5 Missing ⚠️
...ine/configuration/view/ViewPropertiesSerializer.kt 0.0% 1 Missing and 2 partials ⚠️
...ircore/engine/configuration/view/ViewProperties.kt 71.4% 2 Missing ⚠️
...e/engine/data/local/register/RegisterRepository.kt 84.6% 0 Missing and 2 partials ⚠️
...gister/fhircore/engine/rulesengine/RulesFactory.kt 0.0% 2 Missing ⚠️
.../fhircore/engine/util/extension/BitmapExtension.kt 0.0% 2 Missing ⚠️
...ster/fhircore/engine/p2p/dao/BaseP2PTransferDao.kt 0.0% 1 Missing ⚠️
... and 6 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3488     +/-   ##
=========================================
+ Coverage     27.2%   27.8%   +0.5%     
- Complexity     749     752      +3     
=========================================
  Files          275     275             
  Lines        13940   13805    -135     
  Branches      2532    2487     -45     
=========================================
+ Hits          3794    3838     +44     
+ Misses        9622    9432    -190     
- Partials       524     535     +11     
Flag Coverage Δ
engine 63.9% <52.8%> (-0.4%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...core/engine/configuration/ConfigurationRegistry.kt 68.3% <100.0%> (+0.7%) ⬆️
...core/engine/configuration/view/ButtonProperties.kt 86.7% <100.0%> (ø)
...re/engine/data/remote/shared/TokenAuthenticator.kt 76.1% <100.0%> (ø)
...smartregister/fhircore/engine/pdf/HtmlPopulator.kt 86.6% <100.0%> (ø)
...ster/fhircore/engine/task/FhirCarePlanGenerator.kt 78.1% <100.0%> (ø)
...tregister/fhircore/engine/task/FhirResourceUtil.kt 82.9% <100.0%> (ø)
...tregister/fhircore/engine/ui/base/AlertDialogue.kt 78.6% <100.0%> (ø)
...hircore/engine/util/extension/AndroidExtensions.kt 62.5% <ø> (ø)
...re/engine/util/extension/QuestionnaireExtension.kt 59.3% <100.0%> (ø)
...ircore/engine/util/extension/ReferenceExtension.kt 71.4% <ø> (ø)
... and 45 more

... and 1 file with indirect coverage changes

@dubdabasoduba
Copy link
Member

This works well on the app, the performance is not great but it works

Screenrecorder-2024-09-12-16-31-21-294.mp4

ellykits and others added 17 commits September 13, 2024 17:30
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
This fix ensures all the nested related resources are loaded too.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
A lot of memory was used in heap during the allocation. Emojis are not
used in the app so intializing them automatically is unnecessary.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
* Refactor load images tests for different views.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Remove unutilized imports.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Refactor load images tests for different views.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Resolve conflicts.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

---------

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
ellykits and others added 4 commits September 19, 2024 13:14
* Load map data in batches

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update observer

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Deactivate infinite scroll by default

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

---------

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
…#3456)

* Fetch search results in batches for when loading all

* Fix infinite loop for mocks with FhirEngine#search in tests

* Add comparable FhirEngine#search vs batchedSearch integration tests
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@ellykits ellykits marked this pull request as ready for review September 19, 2024 14:41
ellykits and others added 15 commits September 19, 2024 17:42
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
We need to reload all features when the search term is reset

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@dubdabasoduba
Copy link
Member

@ellykits I am going to merge this. We can also improve the coverage on this ticket

@dubdabasoduba dubdabasoduba merged commit 62c9e89 into main Sep 20, 2024
2 of 5 checks passed
@dubdabasoduba dubdabasoduba deleted the fix-register-filters branch September 20, 2024 13:08
qiarie pushed a commit that referenced this pull request Jan 15, 2025
* Refactor register filter with REL tags

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update default pageSize to 15

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix loading locations on map

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor data structure used on base resource search results

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor code

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Delete unnecessary code

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor retrieving related resources

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Optimize data structures and perform parallel processing

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Use recent version of rules engine library

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor implementation for decoding image resources to bitmap

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix related resource count on register

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix loading related resources

This fix ensures all the nested related resources are loaded too.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Batch related resource queries

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Map resources to RepositoryResourceData with async map

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Make infinite scroll the default register behavior

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Disable automatic intialization of emoji2

A lot of memory was used in heap during the allocation. Emojis are not
used in the app so intializing them automatically is unnecessary.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* ⬆️ Update the map box and kujaku versions

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update tests for displaying images (#3506)

* Refactor load images tests for different views.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Remove unutilized imports.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Refactor load images tests for different views.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Resolve conflicts.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

---------

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor navigation to GeowidgetLauncher workflow

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Load map data in batches (#3511)

* Load map data in batches

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update observer

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Deactivate infinite scroll by default

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

---------

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix failing tests

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Batch searching when list might be large or when count is not defined (#3456)

* Fetch search results in batches for when loading all

* Fix infinite loop for mocks with FhirEngine#search in tests

* Add comparable FhirEngine#search vs batchedSearch integration tests

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix Geowidget tests

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix spotlessCheck

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Add missing import

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix rules execution before map render

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* - Update android manifest to use exported values

* Prevent leaking map features via viewmodel

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Format code

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Only search map features via keyboard action

We need to reload all features when the search term is reset

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

---------

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>
Co-authored-by: Benjamin Mwalimu <dubdabasoduba@gmail.com>
Co-authored-by: Lentumunai Mark <90028422+Lentumunai-Mark@users.noreply.github.com>
Co-authored-by: L≡ZRS <12814349+LZRS@users.noreply.github.com>
asad-zaman pushed a commit to Mpower-social/fhircore-smart-health-bd that referenced this pull request Jan 20, 2025
* Refactor register filter with REL tags

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update default pageSize to 15

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix loading locations on map

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor data structure used on base resource search results

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor code

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Delete unnecessary code

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor retrieving related resources

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Optimize data structures and perform parallel processing

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Use recent version of rules engine library

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor implementation for decoding image resources to bitmap

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix related resource count on register

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix loading related resources

This fix ensures all the nested related resources are loaded too.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Batch related resource queries

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Map resources to RepositoryResourceData with async map

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Make infinite scroll the default register behavior

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Disable automatic intialization of emoji2

A lot of memory was used in heap during the allocation. Emojis are not
used in the app so intializing them automatically is unnecessary.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* ⬆️ Update the map box and kujaku versions

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update tests for displaying images (opensrp#3506)

* Refactor load images tests for different views.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Remove unutilized imports.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Refactor load images tests for different views.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

* Resolve conflicts.

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>

---------

Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor navigation to GeowidgetLauncher workflow

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Load map data in batches (opensrp#3511)

* Load map data in batches

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update observer

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Deactivate infinite scroll by default

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

---------

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix failing tests

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Batch searching when list might be large or when count is not defined (opensrp#3456)

* Fetch search results in batches for when loading all

* Fix infinite loop for mocks with FhirEngine#search in tests

* Add comparable FhirEngine#search vs batchedSearch integration tests

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix Geowidget tests

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix spotlessCheck

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Add missing import

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix rules execution before map render

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* - Update android manifest to use exported values

* Prevent leaking map features via viewmodel

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Format code

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Only search map features via keyboard action

We need to reload all features when the search term is reset

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

---------

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Lentumunai-Mark <lentumunai.mark@students.jkuat.ac.ke>
Co-authored-by: Benjamin Mwalimu <dubdabasoduba@gmail.com>
Co-authored-by: Lentumunai Mark <90028422+Lentumunai-Mark@users.noreply.github.com>
Co-authored-by: L≡ZRS <12814349+LZRS@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Work In Progress Describes an items that is not complete. Mostly used for scoping issues of discussions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Locations not displayed when too many locations selected.
4 participants