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 Practioner Location Id using Rules on the Configs from the SharedPreferences #3281

Merged
merged 6 commits into from
May 24, 2024

Conversation

Rkareko
Copy link
Contributor

@Rkareko Rkareko commented May 21, 2024

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

Part of the fixes for #2900

Adds the functionality for fetching the current practitioner's location Id.

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

@Rkareko Rkareko requested review from allan-on and ellykits May 21, 2024 09:00
@Rkareko Rkareko self-assigned this May 21, 2024
Copy link

codecov bot commented May 21, 2024

Codecov Report

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

Project coverage is 28.0%. Comparing base (ac82739) to head (511d679).
Report is 59 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3281     +/-   ##
=========================================
- Coverage     29.6%   28.0%   -1.7%     
- Complexity     658     690     +32     
=========================================
  Files          239     264     +25     
  Lines        11204   12396   +1192     
  Branches      1948    2164    +216     
=========================================
+ Hits          3323    3477    +154     
- Misses        7447    8460   +1013     
- Partials       434     459     +25     
Flag Coverage Δ
engine 64.9% <100.0%> (-1.4%) ⬇️
geowidget 18.7% <ø> (-28.5%) ⬇️

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

Files Coverage Δ
...gister/fhircore/engine/rulesengine/RulesFactory.kt 70.1% <100.0%> (+0.7%) ⬆️
...gister/fhircore/engine/util/SharedPreferenceKey.kt 100.0% <100.0%> (ø)
...register/fhircore/quest/ui/login/LoginViewModel.kt 1.6% <0.0%> (-0.1%) ⬇️

... and 11 files with indirect coverage changes

Comment on lines 646 to 656
ReflectionHelpers.callInstanceMethod<LoginViewModel>(
loginViewModel,
"writePractitionerDetailsToShredPref",
ReflectionHelpers.ClassParameter.from(List::class.java, listOf("")),
ReflectionHelpers.ClassParameter.from(List::class.java, listOf("")),
ReflectionHelpers.ClassParameter.from(List::class.java, listOf("")),
ReflectionHelpers.ClassParameter.from(PractitionerDetails::class.java, PractitionerDetails()),
ReflectionHelpers.ClassParameter.from(List::class.java, listOf("")),
ReflectionHelpers.ClassParameter.from(List::class.java, listOf("")),
ReflectionHelpers.ClassParameter.from(List::class.java, listOf(locationId)),
ReflectionHelpers.ClassParameter.from(List::class.java, listOf(LocationHierarchy())),
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can just make the function public instead of using reflections here.

@codecov-commenter
Copy link

codecov-commenter commented May 24, 2024

Codecov Report

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

Project coverage is 28.0%. Comparing base (ac82739) to head (f588869).
Report is 60 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3281     +/-   ##
=========================================
- Coverage     29.6%   28.0%   -1.7%     
- Complexity     658     690     +32     
=========================================
  Files          239     264     +25     
  Lines        11204   12396   +1192     
  Branches      1948    2164    +216     
=========================================
+ Hits          3323    3477    +154     
- Misses        7447    8460   +1013     
- Partials       434     459     +25     
Flag Coverage Δ
engine 64.9% <100.0%> (-1.4%) ⬇️
geowidget 18.7% <ø> (-28.5%) ⬇️
quest 5.2% <0.0%> (-0.2%) ⬇️

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

Files Coverage Δ
...gister/fhircore/engine/rulesengine/RulesFactory.kt 70.1% <100.0%> (+0.7%) ⬆️
...gister/fhircore/engine/util/SharedPreferenceKey.kt 100.0% <100.0%> (ø)
...register/fhircore/quest/ui/login/LoginViewModel.kt 1.6% <0.0%> (-0.1%) ⬇️

... and 11 files with indirect coverage changes

@Rkareko Rkareko merged commit e88724e into main May 24, 2024
4 of 5 checks passed
@Rkareko Rkareko deleted the fetch-practitioner-location-id-from-shared-pref branch May 24, 2024 08:29
qiarie pushed a commit that referenced this pull request Jan 15, 2025
…edPreferences (#3281)

* Load practitioner location Id from the shared prefs via rules engine service

* Add unit test for writing practitioner location id to shared preferences

* Run spotlessApply

* Update unit test

* Run spotless Apply
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.

3 participants