Stream: dotnet
Topic: Extensions & ComplexTypes
Kim Ruben Vatnehagen (Jun 20 2019 at 07:04):
Hey, how does one add a list of complex type extensions to an extension?
Specifically, how would you go about creating the norwegian practitioner profile via dotnet pocos?
GD-Practitioner: https://simplifier.net/grunndata/gd-practitioner-v01-duplicate-2
What I'm after is how to create: Practitioner.qualification.specialty if I have say 10 specialities I want to put into the specialty extension.
Michel Rutten (Jun 20 2019 at 10:02):
All PoCo classes in the dotNET API provide a common Extensions
collection. First create and initialize an instance of the desired extension (e.g. specialty
). Then you can add the initialized extension instance to the Extensions
collection of the target element in the receiving profile.
Kim Ruben Vatnehagen (Jun 20 2019 at 11:31):
Nice! Thanks for the quick reply :) I sorta thought of the url as a key, and therefore had a mindblock of adding multiple extensions using the same url to an extension. Wrote a quick test using the R4 Citizenship for Patient and it works flawlessly.
Keep up the good work!
Michel Rutten (Jun 20 2019 at 11:58):
No problem.
The specific practitioner profile (https://simplifier.net/grunndata/gd-practitioner-v01-duplicate-2) defines the Practitioner.qualification.specialty
extension element with cardinality 0...*
, stating that it is valid for an instance to contain a list of specialties.
In the .NET FHIR API, the Element.Extension
collection is modeled as a List<T>, i.e. not as a keyed collection. The Extension.url
child element value represents the canonical url of the associated extension definition.
In your case, repeated specialty values on an instance element will all refer to the same canonical url of the specialty extension definition.
Brian Postlethwaite (Jun 20 2019 at 23:22):
Interesting design Michel, @Brett Esler we should look at this for the AU profiles along with comparing to the VhDir guide. Which extends the qualification too
Last updated: Apr 12 2022 at 19:14 UTC