client-py
client-py copied to clipboard
No good way to use multiple versions of the library in a single project?
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.
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!
This gets a lot easier if we limit to Python 3, huh? I might contemplate a branch to explore that...
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
@p2 would you be able to take a look at #81 ?