android-fhir
android-fhir copied to clipboard
Be able to import and use structure maps that have been defined in separate files
Is your feature request related to a problem? Please describe. Our program requires the creation of a 'newly diagnosed client' care plan from separate points in our app. For example, when a patient is first registered, they are assigned a the care plan. Similarly, when potential patient has an HIV test that comes back positive, they should be assigned this same care plan. It's frustrating that I can't just import the same care plan and use it. In addition, for maintainability's sake, it will be good to define this care plan once and import it when needed.
Describe the solution you'd like I would like to import the structure map as shown here and use it's groups.
Describe alternatives you've considered The only alternative is duplicating the code in separate files.
Additional context N/A
Would you like to work on the issue? Not sure but your help would be greatly appreciated
@f-odhiambo Kindly take a look
The fhir StructureMapUtilities loads the imported map from IWorkerContext. The SDK ResourceMapper currently uses SimpleWorkerContext for worker support. The worker allows caching resources including questionnaires, structuremaps etc. We can try calling public void cacheResource(Resource r)
on SimpleWorkerContext passed to application and cache all structure-maps which inturn would be used internally when a group is referenced from any other strcuture-map
Check flow from ResourceMapper.extractByStructureMap, StructureMapUtilities.findMatchingMaps, SimpleWorkerContext.listTransforms, BaseWorkerContext.getTransform, BaseWorkerContext.cacheResource
I'll check the flow and respond accordingly
I'll check the flow and respond accordingly
@KhumboLihonga , are these changes needed based on the workaround provided by @maimoonak ?
@sevenreup could you check this out?
i think this is related to @joiskash and @nsabale7 's work to provide additional packages through knowledge manager to the transformation of structure maps.