-
Notifications
You must be signed in to change notification settings - Fork 56
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
Load FHIR Resources from configs in assets directory #3065
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3065 +/- ##
=========================================
- Coverage 29.6% 28.0% -1.7%
- Complexity 658 693 +35
=========================================
Files 239 266 +27
Lines 11204 12472 +1268
Branches 1948 2172 +224
=========================================
+ Hits 3323 3495 +172
- Misses 7447 8518 +1071
- Partials 434 459 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
|
...ngine/src/main/java/org/smartregister/fhircore/engine/configuration/ConfigurationRegistry.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Raynafs based on the issue description, it seems the code doesn't load resources from the configMap or configJson. Do you mind adding that functionality?
You can create your method in configurationsRegistry to retrieve any resource. Here's a sample method you can use inline fun <reified T : Resource> retrieveResourcesFromConfigMap(resourceId: String): T {
return configsJsonMap.getValue(resourceId).decodeResourceFromString()
} and now invoke it whenever a resource is to be loaded from the configMap in debug mode. E.g Questionnaire, StructureMap, PlanDefinition, List. |
Hi Seb. Yes sure. working on it |
@SebaMutuku Did you verify if the implementation follows the directory structure required by FHIRCore tools as proposed before? |
@ellykits yes, the resources will be loaded from a folder inside the configs called |
@Raynafs is there anything pending on this PR. Can we close? |
Hey @SebaMutuku I believe I have completed the full implementation for this. Unless @ellykits would like me to add something. |
@ellykits This is a video showing that the resources have been loaded from the resources folder when the app Id is app/debug Screencast.from.03-04-2024.11.01.01.ASUBUHI.webmHere is a video showing that the questionnaire that is in assets actually appears in the app Screencast.from.03-04-2024.11.08.16.ASUBUHI.webm |
/debug
android/engine/src/main/java/org/smartregister/fhircore/engine/task/FhirCarePlanGenerator.kt
Outdated
Show resolved
Hide resolved
android/engine/src/main/java/org/smartregister/fhircore/engine/task/FhirCarePlanGenerator.kt
Outdated
Show resolved
Hide resolved
Pull request was closed
791a040
to
79b564e
Compare
…m:opensrp/fhircore into implement-reading-configuration-resources
…m:opensrp/fhircore into implement-reading-configuration-resources
/debug
I have refactored some lines of code. I've also corrected the file names for the resources directory. The directory should be inside the |
Signed-off-by: Elly Kitoto <[email protected]>
…m:opensrp/fhircore into implement-reading-configuration-resources
Signed-off-by: Elly Kitoto <[email protected]>
Configs should be added to the map and FHIR resources saved to SQLite database. Signed-off-by: Elly Kitoto <[email protected]>
Signed-off-by: Elly Kitoto <[email protected]>
IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes #3041
Engineer Checklist
strings.xml
file./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the project's style guideCode Reviewer Checklist
strings.xml
file