--- type: "doc" title: "FHIR Type Framework" source: "source/types.html" ---  \[%settitle Type Framework%\] \[%file newheader%\] \[%file newnavbar%\] <%atheader base%> # FHIR Type Framework | Responsible Owner: [\[%wgt fhir%\]]([%wg fhir%]) Work Group | [Standards Status](versions#std-process):[Normative](versions#std-process) | | --- | --- | Types Framework Cross Reference: Base Types | [Datatypes](datatypes) | [Resources](resourcelist) | [Patterns](patterns) The FHIR specification defines types in the following general categories: 1. [Datatypes](datatypes) 2. [Resources](resourcelist) 3. [Logical Models](logical) This page defines the base abstract types that provide the foundation for all those types: \[%diagram datatypes/abstracts.diagram 3dt%\] Legend: see [Standards Status Colors](versions#std-process) * * * ## Base See also [Detailed Descriptions](types-definitions#Base), [Mappings](types-mappings#Base), [Profiles](types-profiles#Base) and [Extensions]([%extensions-location%]extensions-types#Base) The Base type that all other types specialize. This type has no properties or constraints. \[%adt Base 1%\] Specializations: - [Element](#Element) - [Resource](resource) In addition, this type is used in [Logical Models](types) that don't have or want `id`/`extension`. Note: implementations often use this type to introduce the navigation features defined in the [FHIRPath specification](http://hl7.org/fhirpath/R2/index.html#navigation-model). ## Element See also [Detailed Descriptions](types-definitions#Element), [Mappings](types-mappings#Element), [Profiles](types-profiles#Element) and [Extensions]([%extensions-location%]extensions-types#Element) The base definition for all elements contained inside a resource. All elements, whether defined as a [Datatype](datatypes) (including primitives) or as part of a resource structure, have this base content: - [Extensions](extensibility) - An internal id There are 3 kinds of descendant types that specialize `Element`: - [Primitive datatypes](datatypes#primitive), that add a primitive value property of the specified type - [Complex datatypes](datatypes#complex), that add their own children (all of which are also elements) - [BackboneElement](#BackboneElement), a specialization that adds modifierExtension, which is the super-type of all the element types defined in resource definitions (e.g., [Patient.contact](patient#resource)) Note that resources themselves all specialize the base type [Resource](resource). \[%adt Element 1%\] 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** \[%dt.constraints Element%\] 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. ### Internal Id Scope 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](elementdefinition#id)) and extensions (e.g., [originalText]([%extensions-location%]StructureDefinition-originalText), [narrativeLink]([%extensions-location%]StructureDefinition-narrativeLink)) make use of it. The internal id is unique within the scope of the resource that contains it. Specifically, this means: - The id SHALL be unique within a given resource - The uniqueness boundary extends into contained resources. i.e., a contained resource cannot have the same id as any element in the resource that contains it or any other contained resource - The uniqueness boundary is broken at Bundle.entry.resource and Parameters.parameter.resource, since these are elements that aggregate different resources - The `id` element does not have extensions itself These rules ensure that there is no need to change internal identifiers while exchanging resources. ## BackboneElement See also [Detailed Descriptions](types-definitions#BackboneElement), [Mappings](types-mappings#BackboneElement), [Profiles](types-profiles#BackboneElement) and [Extensions]([%extensions-location%]extensions-types#BackboneElement) 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. [Datatype](datatypes) elements do not use this type. For instance, [Patient.contact](patient#resource) 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. \[%adt BackboneElement 1%\] ## DataType See also [Detailed Descriptions](types-definitions#DataType), [Mappings](types-mappings#DataType), [Profiles](types-profiles#DataType) and [Extensions]([%extensions-location%]extensions-types#DataType) The base definition for the useable types defined by the FHIR Specification. See [FHIR Datatypes](datatypes) for specialization of this type. \[%adt DataType 1%\] ## BackboneType See also [Detailed Descriptions](types-definitions#BackboneType), [Mappings](types-mappings#BackboneType), [Profiles](types-profiles#BackboneType) and [Extensions]([%extensions-location%]extensions-types#BackboneType) The base definition for the few datatypes that allow modifier extensions: - [Timing](datatypes#timing) - [Dosage](dosage#Dosage) - [ElementDefinition](elementdefinition#ElementDefinition) \[%adt BackboneType 1%\] ## PrimitiveType See also [Detailed Descriptions](types-definitions#PrimitiveType), [Mappings](types-mappings#PrimitiveType), [Profiles](types-profiles#PrimitiveType) and [Extensions]([%extensions-location%]extensions-types#PrimitiveType) The base type for all re-useable types defined that have a simple property. See [Primitive Types](datatypes#primitive) for the list of defined primitives types. \[%adt PrimitiveType 1%\] \[%file newfooter%\] try { var currentTabIndex = sessionStorage.getItem('fhir-resource-tab-index'); } catch(exception){ } if (!currentTabIndex) currentTabIndex = '0'; $( '#tabs-Base' ).tabs({ active: currentTabIndex, activate: function( event, ui ) { store(ui.newTab.index()); } }); $( '#tabs-Element' ).tabs({ active: currentTabIndex, activate: function( event, ui ) { store(ui.newTab.index()); } }); $( '#tabs-BackboneElement' ).tabs({ active: currentTabIndex, activate: function( event, ui ) { store(ui.newTab.index()); } }); $( '#tabs-DataType' ).tabs({ active: currentTabIndex, activate: function( event, ui ) { store(ui.newTab.index()); } }); $( '#tabs-BackboneType' ).tabs({ active: currentTabIndex, activate: function( event, ui ) { store(ui.newTab.index()); } }); $( '#tabs-PrimitiveType' ).tabs({ active: currentTabIndex, activate: function( event, ui ) { store(ui.newTab.index()); } }); function store(currentTab) { try { sessionStorage.setItem('fhir-resource-tab-index', currentTab); } catch(exception){ } $( '#tabs-Base' ).tabs('option', 'active', currentTab); $( '#tabs-Element' ).tabs('option', 'active', currentTab); $( '#tabs-BackboneElement' ).tabs('option', 'active', currentTab); $( '#tabs-DataType' ).tabs('option', 'active', currentTab); $( '#tabs-BackboneType' ).tabs('option', 'active', currentTab); $( '#tabs-PrimitiveType' ).tabs('option', 'active', currentTab); document.activeElement.blur(); }