Stream: implementers
Topic: Making instance from structure defs extedngin complex types?
Chris Munro (Jun 28 2017 at 13:52):
It is possible to create a structure definition extending the core profiles (e.g. Patient) or the datatypes (e.g. Coding).
Are there any examples/documentation on how to create instances of the second case? E.g. I extended Coding https://simplifier.net/ELabNetwork/Coding2 but I would like to know what the XML would look like to create an instance?
Thanks for any ideas
Richard Kavanagh (Jun 28 2017 at 14:19):
To see how a datatype extension works see http://hl7.org/fhir/STU3/patient-example.xml.html and look at 'birthDate' you will see that this Date datatype has an extension.
Lloyd McKenzie (Jun 28 2017 at 20:19):
You can't add new data elements. I.e. You couldn't create a StructureDefinition that introduced Patient.favoriteColor, but you can slice the 'extension' element to talk about the use of specific extensions.
Chris Munro (Jul 03 2017 at 14:38):
Thanks @Richard Kavanagh and @Lloyd McKenzie
In forge it is possible to make a structure definition that extends a datatype and then add extensions to it, e.g. extend Patient or Coding and add an extension for favouriteColor. It was an instance of this that I am looking to make in XML, however are you saying that it is invalid to produce such a structure definition? This is an example of such one: https://simplifier.net/ELabNetwork/Coding2
Lloyd McKenzie (Jul 03 2017 at 15:04):
The sort order is a little weird - I'd expect all of the extensions at the top. But yes, it's fine to use extensions. You just can't add non-extension elements. Technically, extensions aren't really extending - they're slicing - and thus constraining - the existing generic extension element that's present in the base data type.
Last updated: Apr 12 2022 at 19:14 UTC