FHIR Chat · Adding an extension to a Canonical · python

Stream: python

Topic: Adding an extension to a Canonical


view this post on Zulip Kristine S. Beckmann (Jan 19 2022 at 10:03):

Hello all,
I'm specifically wanting to add an extension to the questionnaire element in the QuestionnaireResponse resource. It is not possible to simply call the extension as I can with a domain resource. That is, I would want to do something like :
questionnaire_response = QuestionnaireResponse()
questionnaire_response.questionnaire.extension = [
{
"url": "http://hl7.org/fhir/StructureDefinition/display",
"valueString": "KOLS skjema"
}
]

But this is not possible as questionnaire (a Canonical) does not accept extension.
I'm using the fhirclient library.

Does anyone have some tips?
Best,
Kristine

view this post on Zulip Julian Sass (Jan 19 2022 at 12:20):

It's currently not possible to add extensions to primitive elements with the fhirclient library. You may want to check out the fhir.resources library which supports extensions on primitive types.

view this post on Zulip Kristine S. Beckmann (Jan 19 2022 at 12:37):

Okay, thanks for the tip!

view this post on Zulip Eric Haas (Jan 19 2022 at 17:32):

here is a jupyter file on how to primitive extension using fhir.resources and why I switched thanks again @Md Nazrul Islam !

https://github.com/Healthedata1/MyNotebooks/blob/master/fhirprimitiveextensions.ipynb

view this post on Zulip Kristine S. Beckmann (Jan 20 2022 at 06:25):

That's great, thanks! :D


Last updated: Apr 12 2022 at 19:14 UTC