FHIR Chat · fhir.resources R4, STU3, DSTU2 · python

Stream: python

Topic: fhir.resources R4, STU3, DSTU2


view this post on Zulip Md Nazrul Islam (Jul 05 2020 at 15:59):

Revolutionary evolution of #fhir.resources,
So excited to announce the first beta release of
https://lnkd.in/ga5k5q2
#rewritten in modern python, powered by #pydantic, faster than ever.

view this post on Zulip Md Nazrul Islam (Sep 24 2020 at 19:14):

Happy to announce the new release of fhir.resources which is now supporting orjson (super fast) and also bug fixes.

view this post on Zulip Md Nazrul Islam (Dec 17 2020 at 09:14):

Happy to announce that finally a stable version of the "fhir.resources" has been released! Thanks :pray: to all contributors for their hard workings, and also those, who did bugs reports.
:fire::fire:Enjoy the revolutionary evolution.:fire::fire: https://pypi.org/project/fhir.resources/6.0.0/

view this post on Zulip Eric Haas (Dec 17 2020 at 16:30):

does your model support primitive extensions like this one (would be nice to support YAML natively so the json comment thing become moot too ;-):

- id: Observation.subject
  path: Observation.subject
  min: 1
  max: '1'
  type:
    - code: Reference
      targetProfile:
        - 'http://hl7.org/fhir/StructureDefinition/Patient'
        - 'http://hl7.org/fhir/StructureDefinition/Group'
        - 'http://hl7.org/fhir/StructureDefinition/Device'
        - 'http://hl7.org/fhir/StructureDefinition/Location'
      _targetProfile:  #<<<<<<<<<<<<<<  Primitive extension
        - extension:
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: true
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: false
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: false
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: false
  mustSupport: true

view this post on Zulip Md Nazrul Islam (Dec 17 2020 at 17:03):

Eric Haas said:

does your model support primitive extensions like this one (would be nice to support YAML natively so the json comment thing become moot too ;-):

- id: Observation.subject
  path: Observation.subject
  min: 1
  max: '1'
  type:
    - code: Reference
      targetProfile:
        - 'http://hl7.org/fhir/StructureDefinition/Patient'
        - 'http://hl7.org/fhir/StructureDefinition/Group'
        - 'http://hl7.org/fhir/StructureDefinition/Device'
        - 'http://hl7.org/fhir/StructureDefinition/Location'
      _targetProfile:  #<<<<<<<<<<<<<<  Primitive extension
        - extension:
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: true
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: false
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: false
          - url : http://hl7.org/fhir/StructureDefinition/type-must-support
            valueBoolean: false
  mustSupport: true

Yes, primitive extensions are supported by default.
About native support to YMAL is a really good idea, Please add issue here https://github.com/nazrulworld/fhir.resources/issues/

view this post on Zulip Md Nazrul Islam (Mar 31 2021 at 06:25):

Super excited 🥳🥳 to announce the first beta release of fhir.resources, series 6.2.X.
Experimental features XML and YAML-based serializers/deserializers are included.
Meaning that you can export as YAML/XML string alongside JSON from any Resource Model! also reverse way from YAML string/file to Resource Model.
Your suggestions, bug reports are much appreciated 🙏🏽🙏🏽🙏🏽
https://pypi.org/project/fhir.resources/6.2.0b1/

view this post on Zulip Łukasz Kułakowski (Oct 15 2021 at 11:47):

Hello everyone,
Is fhir.resources library capable of accessing resource data in Fhirpath way? E.g. I'm trying to get Observation.category.coding data, where category is a list. Right now I can't access it just by stating var = Observation.category.coding, i need to take into account that category is a list object.

view this post on Zulip Eric Haas (Oct 18 2021 at 21:47):

no...access the list member pythonically...

Import from YAML file Observation template

from fhir.resources.observation import Observation
from fhir.resources import construct_fhir_element
obs_obj = Observation.parse_file("fhir_templates/Observation_a1c.yml")#"Observation_wt.yml")
#print(obs_obj.yaml())
print(obs_obj.category[0].coding)
[Coding(resource_type='Coding', fhir_comments=None, extension=None, id=None, id__ext=None, code='laboratory', code__ext=None, display='Laboratory', display__ext=None, system='http://terminology.hl7.org/CodeSystem/observation-category', system__ext=None, userSelected=None, userSelected__ext=None, version=None, version__ext=None)]

view this post on Zulip Eric Haas (Oct 18 2021 at 21:54):

check out https://pypi.org/project/fhirpath/

@Md Nazrul Islam can they be combined???

view this post on Zulip Md Nazrul Islam (Oct 21 2021 at 11:13):

Eric Haas said:

check out https://pypi.org/project/fhirpath/

Md Nazrul Islam can they be combined???

I think, in the case of fhirpath way, still need to consider the collection type. That means Observation.category.coding would not return from 0 the index automatically.

view this post on Zulip Md Nazrul Islam (Jan 01 2022 at 12:03):

Announcing the next-generation release of fhir.resources, check out new features. For example XML, YAML serialisation/deserialisation!
https://pypi.org/project/fhir.resources/6.2.0/

view this post on Zulip Eric Haas (Jan 03 2022 at 18:38):

thanks again for the YAML part.

view this post on Zulip May Terry (Jan 10 2022 at 22:55):

+1 with Eric's comment. I love the new YAML serialization feature. :smile:


Last updated: Apr 12 2022 at 19:14 UTC