This page is part of the FHIR Specification (v4.6.0: R5 Draft Ballot - see ballot notes). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions
FHIR Infrastructure Work Group | Maturity Level: Normative | Standards Status: Partially Normative |
This page has been approved as part of an ANSI standard. See the Infrastructure Package for further details. |
The FHIR specification defines many different types in the following general categories:
This page defines the base abstract types that provide the foundation for all those types:
Legend: see Standards Status Colors
See also Detailed Descriptions, Mappings, Profiles & Extensions and R3 Conversions.
The Base type that all other types specialize. This type has no properties or constraints.
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Base | «I»N | Base for all types and resources | ||
Documentation for this format |
UML Diagram (Legend)
Changes since Release 3
This complex-type did not exist in Release 2
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Base | «I»N | Base for all types and resources | ||
Documentation for this format |
Specializations:
In addition, this type is used in Logical Models that don't have or want id
/extension
.
Note: implementations often use this type to introduce the navigation features defined in the FHIRPath specification .
See also Detailed Descriptions, Mappings, Profiles & Extensions and R3 Conversions.
The base definition for all elements contained inside a resource. All elements, whether defined as a Data Type (including primitives) or as part of a resource structure, have this base content:
There are 3 kinds of descendant types that specialize Element
:
Note that resources themselves all specialize the base type Resource.
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Element | «I»N | Base | Base for all elements + Rule: All FHIR elements must have a @value or children Elements defined in Ancestors: | |
id | 0..1 | string | Unique id for inter-element referencing | |
extension | 0..* | Extension | Additional content defined by implementations | |
Documentation for this format |
UML Diagram (Legend)
Changes since Release 3
Element |
|
See the Full Difference for further information
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Element | «I»N | Base | Base for all elements + Rule: All FHIR elements must have a @value or children Elements defined in Ancestors: | |
id | 0..1 | string | Unique id for inter-element referencing | |
extension | 0..* | Extension | Additional content defined by implementations | |
Documentation for this format |
As the base type for all elements included in a resource, Element
is an important structural element of FHIR. Even the primitive types inherit
the base features and representation rules that apply to the Element type.
Constraints
id | Level | Location | Description | Expression |
ele-1 | Rule | (base) | All FHIR elements must have a @value or children | hasValue() or (children().count() > id.count()) |
This constraint exists to reduce syntactical variation in resource contents. If an element has no children, then it is always omitted from the resource, as opposed to optionally present without any content.
XML
Elements are represented by an XML element. The name of the element comes from
the context in which it is used, not from the type. The internal <use id="[internal id]"> <extension url="..."/> ... if there are any extensions <extension> .. elements for sub-type... </use> |
JSON
Elements (except for primitive types, see below) are represented by a JSON
object property. The name of the property comes from
the context in which it is used, not from the type. The internal { "use" : { "id" : "[internal id]", "extension" : [ ..extensions, if present... ], .. properties for sub-type... } } |
Note that there are special rules for representation of Primitive types - see below.
The id
property of the element is defined to allow implementers
to build implementation functionality that makes use of internal references
inside the resource. This specification does not define any general use for
the internal id, though some resources (e.g. StructureDefinition) and
extensions (e.g. originalText, narrativeLink) make use of it.
The internal id is unique within the scope of the resource that contains it. Specifically, this means:
id
element does not have extensions itselfThese rules ensure that there is no need to change internal identifiers while exchanging resources.
See also Detailed Descriptions, Mappings, Profiles & Extensions and R3 Conversions.
The base definition for complex elements defined as part of a resource definition - that is, elements that have children that are defined in the resource. Data Type elements do not use this type.
For instance, Patient.contact is an element that is defined as part of the patient resource, so it automatically
has the type BackboneElement
.
Note that the descendant types of BackboneElement
are all declared implicitly as
part of the definitions of the resources.
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
BackboneElement | «I»N | Element | Base for elements defined inside a resource Elements defined in Ancestors: id, extension | |
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized |
Documentation for this format |
UML Diagram (Legend)
Changes since Release 3
BackboneElement |
|
See the Full Difference for further information
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
BackboneElement | «I»N | Element | Base for elements defined inside a resource Elements defined in Ancestors: id, extension | |
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized |
Documentation for this format |
See also Detailed Descriptions, Mappings, Profiles & Extensions and R3 Conversions.
The base definition for the useable types defined by the FHIR Specification.
See FHIR Data Types for specialization of this type.
See also Detailed Descriptions, Mappings, Profiles & Extensions and R3 Conversions.
The base definition for the few data types that allow modifier extensions:
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
BackboneType | «I»N | Element | Base for datatypes that can carry modifier extensions Elements defined in Ancestors: id, extension | |
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized |
Documentation for this format |
UML Diagram (Legend)
Changes since Release 3
This complex-type did not exist in Release 2
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
BackboneType | «I»N | Element | Base for datatypes that can carry modifier extensions Elements defined in Ancestors: id, extension | |
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized |
Documentation for this format |
See also Detailed Descriptions, Mappings, Profiles & Extensions and R3 Conversions.
The base type for all re-useable types defined that have a simple property. See Primitive Types for the list of defined primitives types.
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
PrimitiveType | «I»N | DataType | Parent type for DataTypes with a simple value Elements defined in Ancestors: id, extension | |
Documentation for this format |
UML Diagram (Legend)
Changes since Release 3
This complex-type did not exist in Release 2
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
PrimitiveType | «I»N | DataType | Parent type for DataTypes with a simple value Elements defined in Ancestors: id, extension | |
Documentation for this format |
XML
The actual primitive value appears as an XML attribute named <status id="[internal id]" value="[value of code]""> <extension url="..."/> <extension> </status> |
JSON
The actual primitive value appears as a JSON string or number property with
the name of the element. If an internal id or extensions are present,
they appear as a JSON object with the name of the primitive value property with
"_" prepended. For example, a property of type code named
{ "status" : "[value of code]", "_status" : { "id" : "[internal id]", "extension" : [ ... extensions, if present ... ] } } The exact use of this pattern is described here. |