FHIR CI-Build

This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions icon

2.1.28.6.0 Element Definition

FHIR Infrastructure icon Work Group Maturity Level: Normative Standards Status: Normative

Types Framework Cross Reference: Base Types | Datatypes | Resources | Patterns

The definition of an element in a resource or an extension. The definition includes:

  • Path (name), cardinality, and datatype
  • Definitions, usage notes, and requirements
  • Default or fixed values
  • Constraints, length limits, and other usage rules
  • Terminology Binding
  • Mappings to other specifications
  • Structural Usage Information such as Slicing

The ElementDefinition type is the core of the FHIR metadata layer, and is closely (conceptually) aligned to ISO 11179. All the data elements defined in this specification are published as a collection of data elements (XML or JSON).

ElementDefinition is used in StructureDefinition

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. ElementDefinition ΣN Element Definition of an element in a resource or extension
+ Rule: Min <= Max
+ Rule: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding
+ Rule: Fixed value may only be specified if there is one type
+ Rule: Pattern may only be specified if there is one type
+ Rule: Pattern and fixed are mutually exclusive
+ Rule: Binding can only be present for coded elements, string, and uri if using FHIR-defined types
+ Rule: Types must be unique by code
+ Rule: Constraints must be unique by key
+ Rule: default value and meaningWhenMissing are mutually exclusive
+ Rule: sliceName must be composed of proper tokens separated by "/"
+ Rule: Must have a modifier reason if isModifier = true
+ Rule: Element path SHALL be expressed as a set of '.'-separated components with each component restricted to a maximum of 64 characters and with some limits on the allowed choice of characters
+ Warning: The first component of the path should be UpperCamelCase. Additional components (following a '.') should be lowerCamelCase. If this syntax is not adhered to, code generation tools may be broken. Logical models may be less concerned about this implication.
+ Rule: sliceIsConstraining can only appear if slicename is present
+ Guideline: pattern[x] should be used rather than fixed[x]
+ Warning: Order has no meaning (and cannot be asserted to have meaning), so enforcing rules on order is improper
+ Warning: Mappings SHOULD be unique by key
+ Rule: Can't have valueAlternatives if mustHaveValue is true
+ Warning: If there's more than one bindable type, it's usually an error for there to be a binding

Elements defined in Ancestors: id, extension, modifierExtension
... path ΣC 1..1 string Path of the element in the hierarchy of elements
... representation Σ 0..* code xmlAttr | xmlText | typeAttr | cdaText | xhtml
Binding: PropertyRepresentation (Required)

... sliceName ΣC 0..1 string Name for this particular element (in a set of slices)
... sliceIsConstraining ΣCTU 0..1 boolean If this slice definition constrains an inherited slice definition (or not)
... label ΣT 0..1 string String to display with or prompt for element
... code Σ 0..* Coding Corresponding codes in terminologies
Binding: ElementDefinitionCode icon (Example)

... slicing ΣC 0..1 Element This element is sliced - slices follow
.... discriminator Σ 0..* Element Element values that are used to distinguish the slices

..... type Σ 1..1 code value | exists | type | profile | position
Binding: DiscriminatorType (Required)
..... path Σ 1..1 string Path to element value
.... description ΣT 0..1 string Text description of how slicing works (or not)
.... ordered ΣC 0..1 boolean If elements must be in same order as slices
.... rules ΣC 1..1 code closed | open | openAtEnd
Binding: SlicingRules (Required)
... short ΣT 0..1 string Concise definition for space-constrained presentation
... definition ΣT 0..1 markdown Full formal definition as narrative text
... comment ΣT 0..1 markdown Comments about the use of this element
... requirements ΣT 0..1 markdown Requirements satisfied by this element/structure and its constraints
... alias ΣT 0..* string Other names

... min ΣC 0..1 unsignedInt Minimum Cardinality
... max ΣC 0..1 string Maximum Cardinality (a number or *)
+ Rule: Max SHALL be a number or "*"
... base Σ 0..1 Element Base definition information for tools
.... path Σ 1..1 string Path that identifies the base element
.... min Σ 1..1 unsignedInt Min cardinality of the base element
.... max Σ 1..1 string Max cardinality of the base element
... contentReference ΣC 0..1 uri Reference to definition of content for the element
... type ΣC 0..* Element Data type and Profile for this element
+ Rule: Aggregation may only be specified if one of the allowed types for the element is a reference
+ Rule: targetProfile is only allowed if the type is Reference or canonical
+ Warning: profiles SHOULD be unique
+ Warning: targetProfiles SHOULD be unique

.... code ΣC 1..1 uri Data type or Resource (reference to definition)
Binding: Element Definition Types (Extensible)
.... profile Σ 0..* canonical(StructureDefinition | ImplementationGuide) Profiles (StructureDefinition or IG) - one must apply

.... targetProfile ΣC 0..* canonical(StructureDefinition | ImplementationGuide) Profile (StructureDefinition or IG) on the Reference/canonical target - one must apply

.... aggregation ΣC 0..* code contained | referenced | bundled - how aggregated
Binding: AggregationMode (Required)

.... versioning Σ 0..1 code either | independent | specific
Binding: ReferenceVersionRules (Required)
... defaultValue[x] ΣC 0..1 * Specified value if missing from instance
... meaningWhenMissing ΣTC 0..1 markdown Implicit meaning when this element is missing
... orderMeaning ΣC 0..1 string What the order of the elements means
... fixed[x] ΣC 0..1 * Value must be exactly this
... pattern[x] ΣC 0..1 * Value must have at least these property values
... example ΣC 0..* Element Example value (as defined for type)

.... label ΣT 1..1 string Describes the purpose of this example
.... value[x] Σ 1..1 * Value of Example (one of allowed types)
... minValue[x] ΣC 0..1 Minimum Allowed Value (for some types)
.... minValueDate date
.... minValueDateTime dateTime
.... minValueInstant instant
.... minValueTime time
.... minValueDecimal decimal
.... minValueInteger integer
.... minValueInteger64 integer64
.... minValuePositiveInt positiveInt
.... minValueUnsignedInt unsignedInt
.... minValueQuantity Quantity
... maxValue[x] ΣC 0..1 Maximum Allowed Value (for some types)
.... maxValueDate date
.... maxValueDateTime dateTime
.... maxValueInstant instant
.... maxValueTime time
.... maxValueDecimal decimal
.... maxValueInteger integer
.... maxValueInteger64 integer64
.... maxValuePositiveInt positiveInt
.... maxValueUnsignedInt unsignedInt
.... maxValueQuantity Quantity
... maxLength ΣC 0..1 integer Max length for string type data
... condition Σ 0..* id Reference to invariant about presence

... constraint ΣC 0..* Element Condition that must evaluate to true
+ Warning: Constraints should have an expression or else validators will not be able to enforce them
+ Rule: Errors cannot be suppressed

.... key ΣC 1..1 id Target of 'condition' reference above
.... requirements Σ 0..1 markdown Why this constraint is necessary or appropriate
.... severity ΣC 1..1 code error | warning
Binding: ConstraintSeverity (Required)
.... suppress ΣCTU 0..1 boolean Suppress warning or hint in profile
.... human ΣT 1..1 string Human description of constraint
.... expression ΣC 0..1 string FHIRPath expression of constraint
.... source Σ 0..1 canonical(StructureDefinition) Reference to original source of constraint
... mustHaveValue ΣCTU 0..1 boolean For primitives, that a value must be present - not replaced by an extension
... valueAlternatives ΣCTU 0..* canonical(StructureDefinition) Extensions that are allowed to replace a primitive value

... mustSupport Σ 0..1 boolean If the element must be supported (discouraged - see obligations)
... isModifier ΣC 0..1 boolean If this modifies the meaning of other elements
... isModifierReason ΣC 0..1 string Reason that this element is marked as a modifier
... isSummary Σ 0..1 boolean Include when _summary = true?
... binding ΣC 0..1 Element ValueSet details if this is coded
+ Rule: ValueSet SHALL start with http:// or https:// or urn: or #
+ Rule: binding SHALL have either description or valueSet
+ Rule: If the strength is 'descriptive' no value set can ve provided
+ Guideline: if there's a required binding with no usage, it should be the base binding
.... strength Σ 1..1 code required | extensible | preferred | example | descriptive
Binding: BindingStrength (Required)
.... description ΣTC 0..1 markdown Guidance on the codes to be used
.... valueSet ΣC 0..1 canonical(ValueSet) Source of value set
.... additional ΣCTU 0..* Element Additional Bindings - more rules about the binding
+ Guideline: additionalBindings should have a key

..... key Σ 0..1 id Unique identifier so additional bindings to be matched across profiles
..... purpose Σ 1..1 code maximum | minimum | required | extensible | candidate | current | preferred | ui | starter | component
Binding: Additional Binding Purpose ValueSet (Required)
..... valueSet Σ 1..1 canonical(ValueSet) The value set for the additional binding
..... documentation Σ 0..1 markdown Documentation of the purpose of use of the binding
..... shortDoco Σ 0..1 string Concise documentation - for summary tables
..... usage Σ 0..* UsageContext Qualifies the usage - jurisdiction, gender, workflow status etc.

..... any Σ 0..1 boolean Whether binding can applies to all repeats, or just one
... mapping ΣC 0..* Element Map element to another set of definitions

.... identity ΣC 1..1 id Reference to mapping declaration
.... language Σ 0..1 code Computable language of mapping
Binding: Mime Types (Required)
.... map Σ 1..1 string Details of the mapping
.... comment Σ 0..1 markdown Comments about the mapping or its use

doco Documentation for this format icon

Definition: XML | JSON

Constraints

idLevelLocationDescriptionExpression
img eld-2 Rule (base) Min <= Max min.empty() or max.empty() or (max = '*') or iif(max != '*', min <= max.toInteger())
img eld-3 Rule ElementDefinition.max Max SHALL be a number or "*" empty() or ($this = '*') or (toInteger() >= 0)
img eld-4 Rule ElementDefinition.type Aggregation may only be specified if one of the allowed types for the element is a reference aggregation.empty() or (code = 'Reference') or (code = 'canonical') or (code = 'CodeableReference')
img eld-5 Rule (base) if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding contentReference.empty() or (type.empty() and defaultValue.empty() and fixed.empty() and pattern.empty() and example.empty() and minValue.empty() and maxValue.empty() and maxLength.empty() and binding.empty())
img eld-6 Rule (base) Fixed value may only be specified if there is one type fixed.empty() or (type.count() <= 1)
img eld-7 Rule (base) Pattern may only be specified if there is one type pattern.empty() or (type.count() <= 1)
img eld-8 Rule (base) Pattern and fixed are mutually exclusive pattern.empty() or fixed.empty()
img eld-11 Rule (base) Binding can only be present for coded elements, string, and uri if using FHIR-defined types binding.empty() or type.code.empty() or type.code.contains(':') or type.select((code = 'code') or (code = 'Coding') or (code='CodeableConcept') or (code = 'Quantity') or (code = 'string') or (code = 'uri') or (code = 'Duration')).exists()
img eld-12 Rule ElementDefinition.binding ValueSet SHALL start with http:// or https:// or urn: or # valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:') or valueSet.startsWith('#'))
img eld-13 Rule (base) Types must be unique by code type.select(code).isDistinct()
img eld-14 Rule (base) Constraints must be unique by key constraint.select(key).isDistinct()
img eld-15 Rule (base) default value and meaningWhenMissing are mutually exclusive defaultValue.empty() or meaningWhenMissing.empty()
img eld-16 Rule (base) sliceName must be composed of proper tokens separated by "/" sliceName.empty() or sliceName.matches('^[a-zA-Z0-9\\/\\-_\\[\\]\\@]+$')
img eld-17 Rule ElementDefinition.type targetProfile is only allowed if the type is Reference or canonical (code='Reference' or code = 'canonical' or code = 'CodeableReference') or targetProfile.empty()
img eld-18 Rule (base) Must have a modifier reason if isModifier = true (isModifier.exists() and isModifier) implies isModifierReason.exists()
img eld-19 Rule (base) Element path SHALL be expressed as a set of '.'-separated components with each component restricted to a maximum of 64 characters and with some limits on the allowed choice of characters path.matches('^[^\\s\\.,:;\\\'"\\/|?!@#$%&*()\\[\\]{}]{1,64}(\\.[^\\s\\.,:;\\\'"\\/|?!@#$%&*()\\[\\]{}]{1,64}(\\[x\\])?(\\:[^\\s\\.]+)?)*$')
img eld-20 Warning (base) The first component of the path should be UpperCamelCase. Additional components (following a '.') should be lowerCamelCase. If this syntax is not adhered to, code generation tools may be broken. Logical models may be less concerned about this implication. path.matches('^[A-Za-z][A-Za-z0-9]{0,63}(\\.[a-z][A-Za-z0-9]{0,63}(\\[x])?)*$')
img eld-21 Warning ElementDefinition.constraint Constraints should have an expression or else validators will not be able to enforce them expression.exists()
img eld-22 Rule (base) sliceIsConstraining can only appear if slicename is present sliceIsConstraining.exists() implies sliceName.exists()
img eld-23 Rule ElementDefinition.binding binding SHALL have either description or valueSet description.exists() or valueSet.exists()
img eld-24 Guideline (base) pattern[x] should be used rather than fixed[x] fixed.exists().not()
This is (only) a best practice guideline because:

pattern[x] is generally preferred over fixed[x] because it doesn't preclude the use of id and additional extensions, though there are corner cases when it's appropriate to exclude those

img eld-25 Warning (base) Order has no meaning (and cannot be asserted to have meaning), so enforcing rules on order is improper orderMeaning.empty() implies slicing.where(rules='openAtEnd' or ordered).exists().not()
img eld-26 Rule ElementDefinition.constraint Errors cannot be suppressed (severity = 'error') implies suppress.empty()
img eld-27 Warning (base) Mappings SHOULD be unique by key mapping.select(identity).isDistinct()
img eld-28 Rule (base) Can't have valueAlternatives if mustHaveValue is true mustHaveValue.value implies valueAlternatives.empty()
img eld-29 Warning ElementDefinition.type profiles SHOULD be unique profile.isDistinct()
img eld-30 Warning ElementDefinition.type targetProfiles SHOULD be unique targetProfile.isDistinct()
img eld-31 Guideline ElementDefinition.binding.additional additionalBindings should have a key key.exists()
This is (only) a best practice guideline because:

AdditionalBinding.key is necessary to allow a binding to be constrained

img eld-32 Rule ElementDefinition.binding If the strength is 'descriptive' no value set can ve provided strength = 'descriptive' implies valueSet.empty()
img eld-33 Warning (base) If there's more than one bindable type, it's usually an error for there to be a binding type.where(code in 'code' | 'Coding' | 'CodeableConcept' | 'CodeableReference' | 'uri' | 'string' | 'Quantity').count() > 1 implies binding.empty()
img eld-34 Guideline ElementDefinition.binding if there's a required binding with no usage, it should be the base binding strength != 'required' implies additional.where(purpose = 'required' and usage.empty()).empty()
This is (only) a best practice guideline because:

Authors are encouraged to but the max value set on the root, and provide other additional value sets as additional bindings

 

The path element is the most important property of the element definition. It both names the element, and locates the element within a hierarchy defined within a particular context. Within the FHIR specification, there is only one original definition for each path. This is the master definition to which all the other definitions with the same path must conform.

All elements defined within the FHIR specification itself are defined within a StructureDefinition that defines a resource, or a datatype. This defines the identity of the element and provides the context in which the meaning of the element is understood. When Elements are defined, the following rules apply:

  • Element names (the parts of a path delineated by the '.' character) SHALL NOT contain whitespace (i.e. Unicode characters marked as whitespace)
  • Element names SHALL NOT contain the characters ,:;'"/|?!@#$%^&*()[]{}
  • Element names SHOULD not contain non-ASCII characters
  • Element names SHALL NOT exceed 64 characters in length
  • Element paths cannot imply elements that are not explicitly defined i.e. a.b.c.d cannot be defined unless a.b.c is explicitly defined
  • By convention, each path starts with an uppercase letter (type) but all the element names that follow this are lowercase (not type names). All resources and datatypes (except for Primitive datatypes) follow this convention, but logical models are not required to do so

If the element is polymorphic (has more than one datatype), then the end of the path for the element SHALL be "[x]" to designate that the name of the element may vary when serialized. The "[x]" is not considered to be part of the official element name, though it may frequently appear in documentation that way.

Elements may be defined in:

  • StructureDefinitions of kind = resource, complex-type or primitive-type, where derivation = specialization. These are either Resources or Datatypes defined in the specification
  • StructureDefinitions of kind = logical
  • Data Elements

StructureDefinitions with derivation = constraint (i.e. Resource and Datatype profiles) are not allowed to define or include ElementDefinitions with a path not defined within the base type definition from which they derive (e.g. in the FHIR specification).

In addition to the path, every ElementDefinition SHALL have a populated id, and the id SHALL have a unique value populated by following this algorithm:

  • The id will be constructed as a dot separated string, each part corresponding to a token in the path
  • For each token in the path, use the syntax pathpart:slicename/reslicename
  • For type choice elements, the id reflects the type slice. e.g. For path = Patient.deceased[x], the id of the boolean slice type element is Patient.deceased[x]:deceasedBoolean

Note that in a profile with no slices, this id will match the path exactly and entirely. id values constructed in this fashion are unique, and persistent, and may be used as the target of external references into the definition, where necessary.

The datatype ElementDefinition is used in StructureDefinition. The way its elements are to be used and interpreted depends on the context:

ElementDefinition field Type definition, root element Type definition, following elements Constraint Definition, root element Constraint Definition, following elements
sliceName prohibited prohibited prohibited required for slices, else prohibited
label optional optional recommended recommended
code optional optional optional optional
slicing prohibited optional prohibited optional
short/definition required required required required
requirements prohibited optional prohibited optional
comment optional optional optional optional
alias optional optional optional optional
base snapshot: expected
differential: optional
snapshot: expected
differential: optional
expected expected
type Not expected required optional optional
nameReference prohibited optional prohibited optional
min/max optional§ required optional optional
defaultValue[x] prohibited optional prohibited optional
meaningWhenMissing prohibited optional prohibited optional
fixed[x] prohibited prohibited prohibited optional
pattern[x] prohibited prohibited prohibited optional
example[x] prohibited optional prohibited optional
minValue[x] prohibited prohibited prohibited optional
maxValue[x] prohibited prohibited prohibited optional
maxLength prohibited prohibited prohibited optional
mustSupport optional♉︎ optional♉︎ optional optional
isModifier optional optional optional optional
isSummary Not expected optional Not expected optional
binding prohibited optional optional optional
constraint optional optional optional optional
condition Not expected optional Not expected optional
mapping optional optional optional optional

Notes:♉

  • The root element is the element without . separators in the path. It is not always present in differentials
  • Expected/Not Expected: this is used in the table to indicate that the element SHOULD or SHOULD NOT be present, but that real world StructureDefinitions may be encountered that differ from this guidance, and that these are not invalid
  • Type definition: A StructureDefinition without a baseDefinition element, or where the derivation type is 'specialization'
  • Constraint definition: A StructureDefinition with a baseDefinition element and a derivation of 'constraint' - e.g. a definition of a structure that constrains another base structure, referring to the differential portion
  • : The element's presence, and value, must match the definition in the base definition
  • : The element content must be consistent with that matching element in the base definition
  • ♉︎: In general base definitions should not set mustSupport to true, and no HL7 resources do - mustSupport is usually associated with specific contexts of use
  • : Additional constraints and mappings can be defined, but they do not replace the ones in the base definition
  • §: The cardinality on a type places constraints on references to that type. I.e. profiles referencing the type must fall within the cardinality bounds of the type itself. This most commonly occurs with Extension profiles, where the profile may prohibit the extension from repeating (max=1), or less commonly, make the extension mandatory (min=1) - i.e. if the extension is referenced in a profile, it must be marked as mandatory.
  • For some simple types, rather than pointing to a FHIR datatype, the element will be defined as having a datatype defined by [FHIRPath]. E.g. http://hl7.org/fhirpath/System.String icon. This occurs when the generic behavior of the FHIR primitive type is not desired (e.g. inheriting extension, id, etc.). Implementations should map these FHIRPath datatypes to the appropriate simple datatype defined in their implementation language. For example, in Java, FHIRPath System.String might best map to the `java.lang.String` class.
  • In addition, when an element has a datatype of http://hl7.org/fhirpath/System.String icon then it will typically also include a structuredefinition-fhir-type extension. This extension might further constrain the allowed value of an element that might be treated as a string. For example, limiting the permitted value regex, length, etc. to the corresponding FHIR-defined datatype (but NOT permitting the additional elements such as id and extension). If the extension is not present, no additional constraints apply.

The use of Path and type depends more deeply on the context where the ElementDefinition is used:

Context path (1st element) path (following elements) type (1st element)
Base definition of a datatype
(example: Quantity - XML, JSON)
Name of the type Path inside the datatype Element
A constrained datatype
(example: Money - XML, JSON)
Name of the base type Path inside the datatype Name of the base type
Base definition of a resource
(example: Patient - XML, JSON)
The name of the resource Path inside the resource DomainResource or sometimes Resource
Constraint on a resource
(example: DAF Patient - XML, JSON)
The name of the resource Path inside the resource
(including into the datatypes)
The name of the resource
Base Extension (which is a standard datatype)
(example: Extension - XML, JSON)
Extension Extension.value[x] or Extension.extension Extension
A defined Extension
(example: Extension - XML, JSON)
Extension Extension.value[x] or Extension.extension (for complex extensions) Extension

There are additional notes about the use of ElementDefinition when defining Extensions on the Defining Extensions page.

For a description of slicing, see Slicing

  • Slicing is only allowed when constraining an existing structure
  • slicing can only be used on the first repetition of an element. This first element that declares slicing is considered to be the slicing entry
  • All elements following the first repeat that containing a slicing SHALL have a sliceName
  • The special slice name @default applies to all entries that are not in any other slice
  • The first entry (the one having the slicing information) is understood to be the set of constraints that apply to all slices and entries, whether they have a defined slice or not It's use follows the "normal case", except:
    • slicing must be present
    • min governs the number of total occurrences of the sliced element including the number of occurrences in the open portion of the slice (individual slices may have a different min value).

Elements that allow a choice of multiple types can be constrained. In principle, there are two different types of constraints to apply:

  • A constraint that applies to the element as a whole - e.g. as restricting the cardinality, or limiting the choice of types
  • A constraint that applies to the use of a particular type - e.g. value set binding

When constraining elements with multiple types, the following rules apply:

  • Constraints limiting the acceptable list of types must be applied to the original "[x]" element as this is where the list of acceptable types is defined
  • The inclusion of a type specific element (such as "Patient.deceased[x]:deceasedBoolean") SHALL NOT be interpreted as constraining allowed types, but instead, it constrains the use of a particular type
  • the original element SHALL always be represented in a snapshot; the type specific variants are only represented when needed
  • If there is no StructureDefinition.baseDefinition: min and max are always required
  • Otherwise, in StructureDefinition.differential: min and max are always optional; if they are not present, they default to the min and max from the base definition
  • In StructureDefinition.snapshot: min and max are always required
  • If min = 0, and there is a fixed or pattern value present, the fixed or pattern value only applies if the element is actually present. If the element is omitted, it is NOT treated as though the fixed value or pattern had been specified

This section and the elements mustHaveValue and valueAlternatives are considered Trial Use for FHIR Release 5.

All primitive data types have a value and also extensions. Even if the element is present, the value might not be present; instead, an extension may be present the either provides information about why the value is not present, or provides an expression that might be used to generate a value in a particular context. Some common extensions that might appear in place of a primitive value:

In many cases, profiles want to make a primitive element required (min = 1), and also want to say that when a primitive element is present, the value must be present, since the value is what is processed by applications. The flag mustHaveValue can be set to true to indicate that the primitive data type must have value if present (so it has impact whatever the value of min). Note that this flag is a short cut, equivalent to the profile walking into the primitive data type and setting min = 1 for the value. The short cut is preferable because it's simpler and more concise for implementers.

Alternatively, profiles may wish to allow the primitive value to be replaced by some extensions but not others. In this case, the profiles can list the allowable extensions using the valueAlternatives element, which contains a list of the extensions that can appear if the primitive value is not present. Note that this list is a short cut for actually profiling the extensions on the primitive data type and making a co-occurence constraint, but has no effect when the value is present.

For further discussion regarding populating primitive values, see Exchanging Data using FHIR.

  • If an aggregationMode is present in the definition, the 'reference' element SHALL be present and have a value and the target of the reference SHALL be aggregated as defined
  • If type.versioning is present in the definition, the 'reference' element SHALL be present and have a value and the reference SHALL be populated as the versioning constraint dictates.

Most elements have a minimum cardinality of 0, which means that they may be missing from a resource when it is exchanged between systems. Generally, when an element is missing, all that an application processing the resource can say about the element is that the value is unknown - it may have a correct value, but it has not been provided for security or workflow reasons. On the other hand, it might not have a value at all. All the application can say is that the value is unknown.

This also applies when the element is present, but has no value or child elements, and only has extensions instead.

However, for some elements, this specification makes specific rules about what it means if the element is missing. Constraints on other structures cannot change the missing meaning of an element. Here is a list of all elements with a default value or a missing meaning:

This specification does not define any default values for resources or datatypes because:

  • The value must be known by all implementations
  • When an element has a default value, it can never be unknown - e.g. it is implicitly mandatory
  • The default value can never be changed
  • The presence of a default value interacts with minimum cardinality and the :missing search token in ways that create confusion for implementations

Note that default values can be defined in Logical Models.

For further information about bindings, see Terminology bindings.

The primary focus of the FHIR specification is on correct application behavior around what is exchanged and how: valid APIs and resource instances. However many FHIR implementation guides are interested in specifying additional obligations about how the applications involved handle the data that is being exchanged.

Element Definitions use the property mustSupport to indicate that there are rules that apply to how the data is handled. In addition, the Obligation Extension extension can be used to make more detailed statements about application behavior. See Implementation Obligations for the proper use of these features.