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

Fetch PractitionerId, PractitionerLocation, PractitionerCareTeam, PractitionerOrganization from Shared Preferences #2903

Merged
merged 20 commits into from
Dec 7, 2023

Conversation

Raynafs
Copy link
Contributor

@Raynafs Raynafs commented Dec 1, 2023

Extract PractitionerId, PractitionerLocation, PractitionerCareTeam, PractitionerOrganization
* Create new enum class called PractitionerKey
* Create a function called extractSharedPrefValues in RulesFactory

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

Fixes #2900
Depends on PR #2873 (Which saves practitioner details on shared preferences)

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

…ractitionerOrganization

* Create new enum class called PractitionerKey
* Create a function called extractSharedPrefValues in RulesFactory
@Raynafs Raynafs added DNM DO NOT MERGE Work In Progress Describes an items that is not complete. Mostly used for scoping issues of discussions labels Dec 1, 2023
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Merging #2903 (79afa10) into main (ad3a737) will increase coverage by 2.2%.
Report is 115 commits behind head on main.
The diff coverage is 63.8%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #2903     +/-   ##
=========================================
+ Coverage     64.5%   66.7%   +2.2%     
- Complexity    1075    1091     +16     
=========================================
  Files          218     222      +4     
  Lines         9635   10187    +552     
  Branches      1897    1881     -16     
=========================================
+ Hits          6218    6803    +585     
+ Misses        2234    2193     -41     
- Partials      1183    1191      +8     
Flag Coverage Δ
engine 70.4% <67.9%> (-2.3%) ⬇️
geowidget 65.5% <33.3%> (+1.1%) ⬆️
quest 64.3% <61.0%> (+5.3%) ⬆️

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

Files Coverage Δ
...ngine/configuration/view/CompoundTextProperties.kt 100.0% <ø> (ø)
...gine/configuration/workflow/ApplicationWorkflow.kt 100.0% <100.0%> (ø)
...r/fhircore/engine/domain/model/RoundingStrategy.kt 100.0% <100.0%> (ø)
...martregister/fhircore/engine/sync/AppSyncWorker.kt 100.0% <ø> (ø)
...r/fhircore/engine/task/FhirResourceExpireWorker.kt 100.0% <100.0%> (ø)
...fhircore/engine/task/FhirTaskStatusUpdateWorker.kt 100.0% <100.0%> (ø)
...g/smartregister/fhircore/engine/ui/theme/Colors.kt 100.0% <100.0%> (ø)
...gister/fhircore/engine/util/SharedPreferenceKey.kt 100.0% <100.0%> (ø)
...rcore/engine/util/extension/FhirEngineExtension.kt 80.0% <100.0%> (+2.8%) ⬆️
...fhircore/engine/util/extension/StringExtensions.kt 91.6% <100.0%> (ø)
... and 78 more

... and 29 files with indirect coverage changes

@Raynafs Raynafs removed DNM DO NOT MERGE Work In Progress Describes an items that is not complete. Mostly used for scoping issues of discussions labels Dec 5, 2023
@SebaMutuku
Copy link
Contributor

@Raynafs it would be nice if you added documentation on how to use this particular rule

@Raynafs
Copy link
Contributor Author

Raynafs commented Dec 5, 2023

Yes sure. Working on it.

@Rkareko
Copy link
Contributor

Rkareko commented Dec 5, 2023

@Raynafs it would be nice if you added documentation on how to use this particular rule

Documentation is part of the implementation plan for the issue

@Raynafs
Copy link
Contributor Author

Raynafs commented Dec 5, 2023

@Rkareko @SebaMutuku I have written the docs now. Thanks


## Using the `extractPractitionerInfoFromSharedPrefs()` rule

This rule is used within the rules engine or workflow to extract `PractitionerId`, `PractitionerCareTeam`, `PractitionerOrganization` and `PractitionerLocation` from `Shared Preference`.
Copy link
Contributor

Choose a reason for hiding this comment

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

List all the enums that are supported by this change e.g in order to fetch PractitionerId which enum would be used?

A tabular format would be easy to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I have done so

@Raynafs
Copy link
Contributor Author

Raynafs commented Dec 6, 2023

@SebaMutuku all the checks have passed.

@Raynafs Raynafs merged commit 0782d87 into main Dec 7, 2023
6 checks passed
@Raynafs Raynafs deleted the fetch-assignment-data-using-rules branch December 7, 2023 12:30
@Raynafs Raynafs self-assigned this Jan 9, 2024
qiarie pushed a commit that referenced this pull request Jan 15, 2025
…ctitionerOrganization from Shared Preferences (#2903)

* Extract PractitionerId, PractitionerLocation, PractitionerCareTeam, PractitionerOrganization
* Create new enum class called PractitionerKey
* Create a function called extractSharedPrefValues in RulesFactory

* Fix spacing and code check

* Change few files

* Fix first failing test

* Add Practitioner Tests and rule tests in household config

* Fix failing engine tests

* Add Practitioner Tests and rule tests in household config

* Fix test view

* provide documentation on how to use extractPractitionerInfoFromSharedPrefs() rule

* Write tabular representation of enums and their infos

* Fix test issue

* run spotless

---------

Co-authored-by: Sebastian <[email protected]>
Co-authored-by: SebaMutuku <[email protected]>
Co-authored-by: Benjamin Mwalimu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add functions to fetch Assignment data using Rules on the Configs
5 participants