fhircore
fhircore copied to clipboard
Allow reading of configuration resources e.g. Questionnaires, List etc from the local assets director only during development
Describe the feature request.
Read and use content for configuration resources from the configs/app/resources
directory in the assets directory. Ideally, any FHIR resource can be loaded into the application through the assets.
Additional context
The current implementation loads the configuration resources declared in the Composition (including Questionnaires, StructureMaps, PlanDefs, Lists, etc) by retrieving them from the server, which requires the device to be online. This enhancement should allow the user to create config directories for the resources inside /configs/app/resources
. The resources directory name should be in lowercase format e.g. configs/app/resources/binary
, configs/app/resources/questionnaire
, configs/app/resources/structuremap
, configs/app/resources/plandefinition
, etc.
Acceptance criteria
- Be able to introduce a resource directory in the
configs/appId/resources
directory. - Create a new file, copy and paste Resource content
- Read the assets file ONLY when using debug configurations e.g.
app/debug
- Override the database content with the content of the file
Area path A list of ordered steps in the app on usage of the feature to support anyone testing it e.g. Code reviewer, QA e.g.
- Create a new file
config/app/resources/questionnaire/add_household.json
- Update the questionnaire content
- Login to the app using
app/debug
- Click on Household register
- Click on add household from the side navigation or configured fab
- Observe the questionnaire updated
Implementation plan (For Engineers) The plan for implementing the solution e.g. via a description or a check list for the various ordered tasks that will need to be completed. _i.e. Describe how you intend to solve the problem
- Update the functionality for reading local asset configurations to include reading FHIR resources from the
config/resources
directory. - Override the previously loaded resource in the DB
- This functionality should only work during development to improve developer productivity by allowing devs to update Questionnaires, StructureMaps, etc. without the need to post the configurations to the server first.
Could you potential use this to hard-code the initial config into an APK for a specific project?
Could you potentially use this to hard-code the initial config into an APK for a specific project?
Yes, we could if we enable this functionality for release apps.