client-py icon indicating copy to clipboard operation
client-py copied to clipboard

No good way to use multiple versions of the library in a single project?

Open jmandel opened this issue 7 years ago • 4 comments
trafficstars

In S4S we're building some demo apps that connect to DSTU2 clinical data servers and an STU3 financial server from CMS. I tried loading two versions of the library at different paths, but

https://github.com/smart-on-fhir/client-py/blob/master/fhirclient/init.py#L5

seems to clobber the namespaces. Has this come up before? I can think about ways to improve the module loading, but wanted to start with a quick sanity check.

jmandel avatar Mar 07 '18 17:03 jmandel

The problem has come up already, yes, but not a good solution. IIRC this was the only way we found so that imports from within client-py as well as from a higher level in Python 2 and Python 3 would work. If you have a solution you should push it!

p2 avatar Mar 07 '18 17:03 p2

This gets a lot easier if we limit to Python 3, huh? I might contemplate a branch to explore that...

jmandel avatar Mar 07 '18 19:03 jmandel

Could you support the different versions as packages e.g. fhirclient.models.DSTU2, fhirclient.models.STU3 etc. Then allow instantiating FHIRClient to use the version you want.

Similar to how fhir.resources is packaged https://github.com/nazrulworld/fhir.resources/tree/master/fhir/resources

rectalogic avatar Oct 10 '19 18:10 rectalogic

@p2 would you be able to take a look at #81 ?

rectalogic avatar Oct 15 '19 16:10 rectalogic