FHIR Chat · New python libraries/modules · python

Stream: python

Topic: New python libraries/modules


view this post on Zulip Bob Milius (Jul 06 2021 at 20:32):

A couple of years ago, I learned a bit about python programming and fhir using the smart-on-fhir client-py models. I've been away from that for a while and now I'm getting back into the game and notice there are few other players on the field. I now see the beda software fhir-py, and also the fhir.resources module. Has a favorite emerged? What's your opinion of these? Is smart-on-fhir client-py still being developed? The last commit was 4 months ago, and the current models support R4, so it not exactly dead. Just wondering if I should switch?

view this post on Zulip Eric Haas (Jul 06 2021 at 21:01):

hey @ Bob Milius , I switched to fhir.resources ( which I think still used the same model generating tooling as client-py.)
It is based on pydantic and allowing typing and theoretically using Fast-API to create swagger files ( this last part I have not figured out yet). Importantly for me it supports FHIR primitives , YAML out of the box and has a sweet factory method construct_fhir_element

IMO to gotchas are :

  • An open issue on having to scrub None-like objects [] and {} when serializing
  • Using datetime library instead of a fhirDate - but this turns out to work better and more 'pythonic' IMO
  • integration with fast API as mentioned above

view this post on Zulip Eric Haas (Jul 06 2021 at 21:03):

see my example here: https://chat.fhir.org/#narrow/stream/179218-python/topic/FHIR.20resource.20converter/near/245060684

view this post on Zulip Eric Haas (Jul 06 2021 at 21:04):

p.s. I wanted to host a python track at the last connecathon but did not garner enough interest. Maybe is time to float this idea again...


Last updated: Apr 12 2022 at 19:14 UTC