android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

Be able to import and use structure maps that have been defined in separate files

Open KhumboLihonga opened this issue 1 year ago • 6 comments

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

KhumboLihonga avatar Aug 06 '22 12:08 KhumboLihonga

@f-odhiambo Kindly take a look

Gental-Giant avatar Aug 11 '22 12:08 Gental-Giant

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

maimoonak avatar Aug 15 '22 09:08 maimoonak

I'll check the flow and respond accordingly

KhumboLihonga avatar Aug 17 '22 15:08 KhumboLihonga

I'll check the flow and respond accordingly

@KhumboLihonga , are these changes needed based on the workaround provided by @maimoonak ?

Tarun-Bhardwaj avatar Sep 14 '22 07:09 Tarun-Bhardwaj

@sevenreup could you check this out?

KhumboLihonga avatar Sep 27 '22 14:09 KhumboLihonga

i think this is related to @joiskash and @nsabale7 's work to provide additional packages through knowledge manager to the transformation of structure maps.

jingtang10 avatar Jan 30 '24 12:01 jingtang10