Stream: implementers
Topic: Element Types
Ben Spencer (Apr 18 2017 at 10:38):
https://www.hl7.org/fhir/element.html lists 3 subtypes of Element, but Extension is also defined as an Element. Is it considered a Complex Type, or a special case of its own?
Michel Rutten (Apr 18 2017 at 11:04):
Extension is a foundational/infrastructural complex datatype that is also derived from Element:
https://www.hl7.org/implement/standards/fhir/extensibility.html#Extension
Michel Rutten (Apr 18 2017 at 11:06):
FYI you can find the associated base type by inspecting the StructureDefinition.base property.
Grahame Grieve (Apr 18 2017 at 20:43):
more simply: yes, Extension is a complex type
Oliver (Oct 24 2018 at 15:39):
If I want to slice an element and use slices with different data types, don't I need to add data types to the base element in the profile which then become the data type options for the resulting slices? I'm asking because I get an error if I try to add anything other than the identifier data type to the identifier element. In reality, I may want to use string or another data type in some cases.
Michel Rutten (Oct 24 2018 at 16:02):
FHIR only allows you to constrain an element type, i.e. further limit the list of type options allowed by the base profile. It is illegal for a profile to introduce an element type that is not compatible with one of the element types accepted by the base profile - as this would break compatibility.
In other words, if a profile constrains an element to type Identifier, then a derived profile cannot override the element type to e.g. a string.
Oliver (Oct 24 2018 at 16:19):
(deleted)
Michel Rutten (Oct 24 2018 at 16:26):
For example, see the official definition of Patient.identifier:
http://hl7.org/fhir/patient-definitions.html#Patient.identifier
=> Type = Identifier
Michel Rutten (Oct 24 2018 at 16:27):
Identifier itself is a complex datatype that introduces child elements:
http://hl7.org/fhir/datatypes.html#Identifier
Michel Rutten (Oct 24 2018 at 16:28):
Typically, an identifier specifies both a system and a value.
Michel Rutten (Oct 24 2018 at 16:28):
The identifier value child element is defined as type string:
http://hl7.org/fhir/datatypes-definitions.html#Identifier.value
Last updated: Apr 12 2022 at 19:14 UTC