This page is part of the FHIR Specification (v0.0.82: DSTU 1). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

1.21.0 Element Definition

Introduction

1.21.0.1 Content

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. ElementDefinition IElementDefinition of an elements in a resource or extension
Types must be unique by the combination of code and profile
Constraints must be unique by key
Binding can only be present for coded elements, string, and uri
Pattern and value are mutually exclusive
Constraint names must be unique.
default value and meaningWhenMissing are mutually exclusive
Min <= Max
Pattern may only be specified if there is one type
Fixed value may only be specified if there is one type
Either a namereference or a fixed value (but not both) is permitted
... path 1..1stringThe path of the element (see the Detailed Descriptions)
... representation 0..*codeHow this element is represented in instances
PropertyRepresentation (Required)
... name 0..1stringName for this particular element definition (reference target)
... label 0..1stringName for element to display with or prompt for element
... code 0..*CodingDefining code
... slicing I0..1ElementThis element is sliced - slices follow
If there are no discriminators, there must be a definition
.... discriminator 0..*stringElement values that used to distinguish the slices
.... description I0..1stringText description of how slicing works (or not)
.... ordered 0..1booleanIf elements must be in same order as slices
.... rules 1..1codeclosed | open | openAtEnd
SlicingRules (Required)
... short 0..1stringConcise definition for xml presentation
... definition 0..1stringFull formal definition as narrative text
... comments 0..1stringComments about the use of this element
... requirements 0..1stringWhy is this needed?
... alias 0..*stringOther names
... min I0..1integerMinimum Cardinality
... max I0..1stringMaximum Cardinality (a number or *)
Max SHALL be a number or "*"
... type I0..*ElementData type and Profile for this element
Aggregation may only be specified if one of the allowed types for the element is a resource
.... code 1..1codeName of Data type or Resource
DataType (Required)
.... profile 0..1uriProfile.structure to apply
.... aggregation I0..*codecontained | referenced | bundled - how aggregated
AggregationMode (Required)
... nameReference I0..1stringTo another element constraint (by element.name)
... defaultValue[x] I0..1*Specified value it missing from instance
... meaningWhenMissing I0..1stringImplicit meaning when this element is missing
... fixed[x] I0..1*Value must be exactly this
... pattern[x] I0..1*Value must have at least these property values
... example[x] 0..1*Example value: [as defined for type]
... maxLength 0..1integerMax length for strings
... condition 0..*idReference to invariant about presence
... constraint 0..*ElementCondition that must evaluate to true
.... key I1..1idTarget of 'condition' reference above
.... name I0..1stringShort human label
.... severity 1..1codeerror | warning
ConstraintSeverity (Required)
.... human 1..1stringHuman description of constraint
.... xpath 1..1stringXPath expression of constraint
... mustSupport 0..1booleanIf the element must supported
... isModifier 0..1booleanIf this modifies the meaning of other elements
... isSummary 0..1booleanInclude when _summary = true?
... binding I0..1ElementValueSet details if this is coded
Example value sets are always extensible
provide either a reference or a description (or both)
.... name 1..1stringDescriptive Name
.... strength 1..1coderequired | extensible | preferred | example
BindingStrength (Required)
.... description I0..1stringHuman explanation of the value set
.... valueSet[x] ISource of value set
uri SHALL start with http:// or https://
..... valueSetUri0..1uri
..... valueSetReference0..1ValueSet
... mapping 0..*ElementMap element to another set of definitions
.... identity 1..1idReference to mapping declaration
.... language 0..1codeComputable language of mapping
MimeType (Required)
.... map 1..1stringDetails of the mapping

UML Diagram

ElementExtensions - as described for all elements: additional information that is not part of the basic definition of the resource / typeextension : Extension 0..*ElementDefinitionThe path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extensionpath : string 1..1Codes that define how this element is represented in instances, when the deviation varies from the normal caserepresentation : code 0..* « How a property is represented on the wirePropertyRepresentation »The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same elementname : string 0..1The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or formlabel : string 0..1A code that provides the meaning for the element according to a particular terminologycode : Coding 0..*A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification)short : string 0..1Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resourcedefinition : string 0..1Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etccomments : string 0..1Explains why this element is needed and why it's been constrained as it hasrequirements : string 0..1Identifies additional names by which this element might also be knownalias : string 0..*The minimum number of times this element SHALL appear in the instancemin : integer 0..1The maximum number of times this element is permitted to appear in the instancemax : string 0..1Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current elementnameReference : string 0..1The value that should be used if there is no value stated in the instancedefaultValue[x] : * 0..1The Implicit meaning that is to be understood when this element is missingmeaningWhenMissing : string 0..1Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missingfixed[x] : * 0..1Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.)pattern[x] : * 0..1A sample value for this element demonstrating the type of information that would typically be capturedexample[x] : * 0..1Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the elementmaxLength : integer 0..1A reference to an invariant that may make additional statements about the cardinality or value in the instancecondition : id 0..*If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supportedmustSupport : boolean 0..1If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular systemisModifier : boolean 0..1Whether the element should be included if a client requests a search with the parameter _summary=trueisSummary : boolean 0..1SlicingDesignates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slicesdiscriminator : string 0..*A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiateddescription : string 0..1If the matching elements have to occur in the same order as defined in the profileordered : boolean 0..1Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the endrules : code 1..1 « How slices are interpreted when evaluating an instanceSlicingRules »TypeRefName of Data type or Resource that is a(or the) type used for this elementcode : code 1..1 « The type of an element - one of the FHIR data typesDataType »Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profileprofile : uri 0..1If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundleaggregation : code 0..* « How resource references can be aggregatedAggregationMode »ConstraintAllows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinalitykey : id 1..1Used to label the constraint in OCL or in short displays incapable of displaying the full human descriptionname : string 0..1Identifies the impact constraint violation has on the conformance of the instanceseverity : code 1..1 « SHALL applications comply with this constraint?ConstraintSeverity »Text that can be used to describe the constraint in messages identifying that the constraint has been violatedhuman : string 1..1An XPath expression of constraint that can be executed to see if this constraint is metxpath : string 1..1BindingA descriptive name for this - can be useful for generating implementation artifactsname : string 1..1Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instancesstrength : code 1..1 « Indication of the degree of conformance expectations associated with a bindingBindingStrength »Describes the intended use of this particular set of codesdescription : string 0..1Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be usedvalueSet[x] : uri|Reference(ValueSet) 0..1MappingAn internal reference to the definition of a mappingidentity : id 1..1Identifies the computable language in which mapping.map is expressedlanguage : code 0..1 « The mime type of an attachmentMimeType »Expresses what part of the target specification corresponds to this elementmap : string 1..1Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)slicing0..1The data type or resource that the value of this element is permitted to betype0..*Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instanceconstraint0..*Binds to a value set if this element is coded (code, Coding, CodeableConcept)binding0..1Identifies a concept from an external specification that roughly corresponds to this elementmapping0..*

XML Template

<[name] xmlns="http://hl7.org/fhir"> doco
 <!-- from Element: extension -->
 <path value="[string]"/><!-- 1..1 The path of the element (see the Detailed Descriptions) -->
 <representation value="[code]"/><!-- 0..* How this element is represented in instances -->
 <name value="[string]"/><!-- 0..1 Name for this particular element definition (reference target) -->
 <label value="[string]"/><!-- 0..1 Name for element to display with or prompt for element -->
 <code><!-- 0..* Coding Defining code --></code>
 <slicing>  <!-- 0..1 This element is sliced - slices follow -->
  <discriminator value="[string]"/><!-- 0..* Element values that used to distinguish the slices -->
  <description value="[string]"/><!-- ?? 0..1 Text description of how slicing works (or not) -->
  <ordered value="[boolean]"/><!-- 0..1 If elements must be in same order as slices -->
  <rules value="[code]"/><!-- 1..1 closed | open | openAtEnd -->
 </slicing>
 <short value="[string]"/><!-- 0..1 Concise definition for xml presentation -->
 <definition value="[string]"/><!-- 0..1 Full formal definition as narrative text -->
 <comments value="[string]"/><!-- 0..1 Comments about the use of this element -->
 <requirements value="[string]"/><!-- 0..1 Why is this needed? -->
 <alias value="[string]"/><!-- 0..* Other names -->
 <min value="[integer]"/><!-- ?? 0..1 Minimum Cardinality -->
 <max value="[string]"/><!-- ?? 0..1 Maximum Cardinality (a number or *) -->
 <type>  <!-- ?? 0..* Data type and Profile for this element -->
  <code value="[code]"/><!-- 1..1 Name of Data type or Resource -->
  <profile value="[uri]"/><!-- 0..1 Profile.structure to apply -->
  <aggregation value="[code]"/><!-- ?? 0..* contained | referenced | bundled - how aggregated -->
 </type>
 <nameReference value="[string]"/><!-- ?? 0..1 To another element constraint (by element.name) -->
 <defaultValue[x]><!-- ?? 0..1 * Specified value it missing from instance --></defaultValue[x]>
 <meaningWhenMissing value="[string]"/><!-- ?? 0..1 Implicit meaning when this element is missing -->
 <fixed[x]><!-- ?? 0..1 * Value must be exactly this --></fixed[x]>
 <pattern[x]><!-- ?? 0..1 * Value must have at least these property values --></pattern[x]>
 <example[x]><!-- 0..1 * Example value: [as defined for type] --></example[x]>
 <maxLength value="[integer]"/><!-- 0..1 Max length for strings -->
 <condition value="[id]"/><!-- 0..* Reference to invariant about presence -->
 <constraint>  <!-- 0..* Condition that must evaluate to true -->
  <key value="[id]"/><!-- ?? 1..1 Target of 'condition' reference above -->
  <name value="[string]"/><!-- ?? 0..1 Short human label -->
  <severity value="[code]"/><!-- 1..1 error | warning -->
  <human value="[string]"/><!-- 1..1 Human description of constraint -->
  <xpath value="[string]"/><!-- 1..1 XPath expression of constraint -->
 </constraint>
 <mustSupport value="[boolean]"/><!-- 0..1 If the element must supported -->
 <isModifier value="[boolean]"/><!-- 0..1 If this modifies the meaning of other elements -->
 <isSummary value="[boolean]"/><!-- 0..1 Include when _summary = true? -->
 <binding>  <!-- ?? 0..1 ValueSet details if this is coded -->
  <name value="[string]"/><!-- 1..1 Descriptive Name -->
  <strength value="[code]"/><!-- 1..1 required | extensible | preferred | example -->
  <description value="[string]"/><!-- ?? 0..1 Human explanation of the value set -->
  <valueSet[x]><!-- ?? 0..1 uri|Reference(ValueSet) Source of value set --></valueSet[x]>
 </binding>
 <mapping>  <!-- 0..* Map element to another set of definitions -->
  <identity value="[id]"/><!-- 1..1 Reference to mapping declaration -->
  <language value="[code]"/><!-- 0..1 Computable language of mapping -->
  <map value="[string]"/><!-- 1..1 Details of the mapping -->
 </mapping>
</[name]>

JSON Template


{doco
  // from Element: extension
  "path" : "<string>", // R!  The path of the element (see the Detailed Descriptions)
  "representation" : ["<code>"], // How this element is represented in instances
  "name" : "<string>", // Name for this particular element definition (reference target)
  "label" : "<string>", // Name for element to display with or prompt for element
  "code" : [{ Coding }], // Defining code
  "slicing" : { // This element is sliced - slices follow
    "discriminator" : ["<string>"], // Element values that used to distinguish the slices
    "description" : "<string>", // C? Text description of how slicing works (or not)
    "ordered" : <boolean>, // If elements must be in same order as slices
    "rules" : "<code>" // R!  closed | open | openAtEnd
  },
  "short" : "<string>", // Concise definition for xml presentation
  "definition" : "<string>", // Full formal definition as narrative text
  "comments" : "<string>", // Comments about the use of this element
  "requirements" : "<string>", // Why is this needed?
  "alias" : ["<string>"], // Other names
  "min" : <integer>, // C? Minimum Cardinality
  "max" : "<string>", // C? Maximum Cardinality (a number or *)
  "type" : [{ // C? Data type and Profile for this element
    "code" : "<code>", // R!  Name of Data type or Resource
    "profile" : "<uri>", // Profile.structure to apply
    "aggregation" : ["<code>"] // C? contained | referenced | bundled - how aggregated
  }],
  "nameReference" : "<string>", // C? To another element constraint (by element.name)
  // defaultValue[x]: Specified value it missing from instance. One of these 23:
  "defaultValueInteger" : <integer>,
  "defaultValueDecimal" : <decimal>,
  "defaultValueDateTime" : "<dateTime>",
  "defaultValueDate" : "<date>",
  "defaultValueInstant" : "<instant>",
  "defaultValueString" : "<string>",
  "defaultValueUri" : "<uri>",
  "defaultValueBoolean" : <boolean>,
  "defaultValueCode" : "<code>",
  "defaultValueBase64Binary" : "<base64Binary>",
  "defaultValueCoding" : { Coding },
  "defaultValueCodeableConcept" : { CodeableConcept },
  "defaultValueAttachment" : { Attachment },
  "defaultValueIdentifier" : { Identifier },
  "defaultValueQuantity" : { Quantity },
  "defaultValueRange" : { Range },
  "defaultValuePeriod" : { Period },
  "defaultValueRatio" : { Ratio },
  "defaultValueHumanName" : { HumanName },
  "defaultValueAddress" : { Address },
  "defaultValueContactPoint" : { ContactPoint },
  "defaultValueSchedule" : { Schedule },
  "defaultValueReference" : { Reference },
  "meaningWhenMissing" : "<string>", // C? Implicit meaning when this element is missing
  // fixed[x]: Value must be exactly this. One of these 23:
  "fixedInteger" : <integer>,
  "fixedDecimal" : <decimal>,
  "fixedDateTime" : "<dateTime>",
  "fixedDate" : "<date>",
  "fixedInstant" : "<instant>",
  "fixedString" : "<string>",
  "fixedUri" : "<uri>",
  "fixedBoolean" : <boolean>,
  "fixedCode" : "<code>",
  "fixedBase64Binary" : "<base64Binary>",
  "fixedCoding" : { Coding },
  "fixedCodeableConcept" : { CodeableConcept },
  "fixedAttachment" : { Attachment },
  "fixedIdentifier" : { Identifier },
  "fixedQuantity" : { Quantity },
  "fixedRange" : { Range },
  "fixedPeriod" : { Period },
  "fixedRatio" : { Ratio },
  "fixedHumanName" : { HumanName },
  "fixedAddress" : { Address },
  "fixedContactPoint" : { ContactPoint },
  "fixedSchedule" : { Schedule },
  "fixedReference" : { Reference },
  // pattern[x]: Value must have at least these property values. One of these 23:
  "patternInteger" : <integer>,
  "patternDecimal" : <decimal>,
  "patternDateTime" : "<dateTime>",
  "patternDate" : "<date>",
  "patternInstant" : "<instant>",
  "patternString" : "<string>",
  "patternUri" : "<uri>",
  "patternBoolean" : <boolean>,
  "patternCode" : "<code>",
  "patternBase64Binary" : "<base64Binary>",
  "patternCoding" : { Coding },
  "patternCodeableConcept" : { CodeableConcept },
  "patternAttachment" : { Attachment },
  "patternIdentifier" : { Identifier },
  "patternQuantity" : { Quantity },
  "patternRange" : { Range },
  "patternPeriod" : { Period },
  "patternRatio" : { Ratio },
  "patternHumanName" : { HumanName },
  "patternAddress" : { Address },
  "patternContactPoint" : { ContactPoint },
  "patternSchedule" : { Schedule },
  "patternReference" : { Reference },
  // example[x]: Example value: [as defined for type]. One of these 23:
  "exampleInteger" : <integer>,
  "exampleDecimal" : <decimal>,
  "exampleDateTime" : "<dateTime>",
  "exampleDate" : "<date>",
  "exampleInstant" : "<instant>",
  "exampleString" : "<string>",
  "exampleUri" : "<uri>",
  "exampleBoolean" : <boolean>,
  "exampleCode" : "<code>",
  "exampleBase64Binary" : "<base64Binary>",
  "exampleCoding" : { Coding },
  "exampleCodeableConcept" : { CodeableConcept },
  "exampleAttachment" : { Attachment },
  "exampleIdentifier" : { Identifier },
  "exampleQuantity" : { Quantity },
  "exampleRange" : { Range },
  "examplePeriod" : { Period },
  "exampleRatio" : { Ratio },
  "exampleHumanName" : { HumanName },
  "exampleAddress" : { Address },
  "exampleContactPoint" : { ContactPoint },
  "exampleSchedule" : { Schedule },
  "exampleReference" : { Reference },
  "maxLength" : <integer>, // Max length for strings
  "condition" : ["<id>"], // Reference to invariant about presence
  "constraint" : [{ // Condition that must evaluate to true
    "key" : "<id>", // C? R!  Target of 'condition' reference above
    "name" : "<string>", // C? Short human label
    "severity" : "<code>", // R!  error | warning
    "human" : "<string>", // R!  Human description of constraint
    "xpath" : "<string>" // R!  XPath expression of constraint
  }],
  "mustSupport" : <boolean>, // If the element must supported
  "isModifier" : <boolean>, // If this modifies the meaning of other elements
  "isSummary" : <boolean>, // Include when _summary = true?
  "binding" : { // C? ValueSet details if this is coded
    "name" : "<string>", // R!  Descriptive Name
    "strength" : "<code>", // R!  required | extensible | preferred | example
    "description" : "<string>", // C? Human explanation of the value set
    // valueSet[x]: Source of value set. One of these 2:
    "valueSetUri" : "<uri>"
    "valueSetReference" : { Reference(ValueSet) }
  },
  "mapping" : [{ // Map element to another set of definitions
    "identity" : "<id>", // R!  Reference to mapping declaration
    "language" : "<code>", // Computable language of mapping
    "map" : "<string>" // R!  Details of the mapping
  }]
}

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. ElementDefinition IElementDefinition of an elements in a resource or extension
Types must be unique by the combination of code and profile
Constraints must be unique by key
Binding can only be present for coded elements, string, and uri
Pattern and value are mutually exclusive
Constraint names must be unique.
default value and meaningWhenMissing are mutually exclusive
Min <= Max
Pattern may only be specified if there is one type
Fixed value may only be specified if there is one type
Either a namereference or a fixed value (but not both) is permitted
... path 1..1stringThe path of the element (see the Detailed Descriptions)
... representation 0..*codeHow this element is represented in instances
PropertyRepresentation (Required)
... name 0..1stringName for this particular element definition (reference target)
... label 0..1stringName for element to display with or prompt for element
... code 0..*CodingDefining code
... slicing I0..1ElementThis element is sliced - slices follow
If there are no discriminators, there must be a definition
.... discriminator 0..*stringElement values that used to distinguish the slices
.... description I0..1stringText description of how slicing works (or not)
.... ordered 0..1booleanIf elements must be in same order as slices
.... rules 1..1codeclosed | open | openAtEnd
SlicingRules (Required)
... short 0..1stringConcise definition for xml presentation
... definition 0..1stringFull formal definition as narrative text
... comments 0..1stringComments about the use of this element
... requirements 0..1stringWhy is this needed?
... alias 0..*stringOther names
... min I0..1integerMinimum Cardinality
... max I0..1stringMaximum Cardinality (a number or *)
Max SHALL be a number or "*"
... type I0..*ElementData type and Profile for this element
Aggregation may only be specified if one of the allowed types for the element is a resource
.... code 1..1codeName of Data type or Resource
DataType (Required)
.... profile 0..1uriProfile.structure to apply
.... aggregation I0..*codecontained | referenced | bundled - how aggregated
AggregationMode (Required)
... nameReference I0..1stringTo another element constraint (by element.name)
... defaultValue[x] I0..1*Specified value it missing from instance
... meaningWhenMissing I0..1stringImplicit meaning when this element is missing
... fixed[x] I0..1*Value must be exactly this
... pattern[x] I0..1*Value must have at least these property values
... example[x] 0..1*Example value: [as defined for type]
... maxLength 0..1integerMax length for strings
... condition 0..*idReference to invariant about presence
... constraint 0..*ElementCondition that must evaluate to true
.... key I1..1idTarget of 'condition' reference above
.... name I0..1stringShort human label
.... severity 1..1codeerror | warning
ConstraintSeverity (Required)
.... human 1..1stringHuman description of constraint
.... xpath 1..1stringXPath expression of constraint
... mustSupport 0..1booleanIf the element must supported
... isModifier 0..1booleanIf this modifies the meaning of other elements
... isSummary 0..1booleanInclude when _summary = true?
... binding I0..1ElementValueSet details if this is coded
Example value sets are always extensible
provide either a reference or a description (or both)
.... name 1..1stringDescriptive Name
.... strength 1..1coderequired | extensible | preferred | example
BindingStrength (Required)
.... description I0..1stringHuman explanation of the value set
.... valueSet[x] ISource of value set
uri SHALL start with http:// or https://
..... valueSetUri0..1uri
..... valueSetReference0..1ValueSet
... mapping 0..*ElementMap element to another set of definitions
.... identity 1..1idReference to mapping declaration
.... language 0..1codeComputable language of mapping
MimeType (Required)
.... map 1..1stringDetails of the mapping

UML Diagram

ElementExtensions - as described for all elements: additional information that is not part of the basic definition of the resource / typeextension : Extension 0..*ElementDefinitionThe path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extensionpath : string 1..1Codes that define how this element is represented in instances, when the deviation varies from the normal caserepresentation : code 0..* « How a property is represented on the wirePropertyRepresentation »The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same elementname : string 0..1The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or formlabel : string 0..1A code that provides the meaning for the element according to a particular terminologycode : Coding 0..*A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification)short : string 0..1Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resourcedefinition : string 0..1Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etccomments : string 0..1Explains why this element is needed and why it's been constrained as it hasrequirements : string 0..1Identifies additional names by which this element might also be knownalias : string 0..*The minimum number of times this element SHALL appear in the instancemin : integer 0..1The maximum number of times this element is permitted to appear in the instancemax : string 0..1Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current elementnameReference : string 0..1The value that should be used if there is no value stated in the instancedefaultValue[x] : * 0..1The Implicit meaning that is to be understood when this element is missingmeaningWhenMissing : string 0..1Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missingfixed[x] : * 0..1Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.)pattern[x] : * 0..1A sample value for this element demonstrating the type of information that would typically be capturedexample[x] : * 0..1Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the elementmaxLength : integer 0..1A reference to an invariant that may make additional statements about the cardinality or value in the instancecondition : id 0..*If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supportedmustSupport : boolean 0..1If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular systemisModifier : boolean 0..1Whether the element should be included if a client requests a search with the parameter _summary=trueisSummary : boolean 0..1SlicingDesignates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slicesdiscriminator : string 0..*A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiateddescription : string 0..1If the matching elements have to occur in the same order as defined in the profileordered : boolean 0..1Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the endrules : code 1..1 « How slices are interpreted when evaluating an instanceSlicingRules »TypeRefName of Data type or Resource that is a(or the) type used for this elementcode : code 1..1 « The type of an element - one of the FHIR data typesDataType »Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profileprofile : uri 0..1If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundleaggregation : code 0..* « How resource references can be aggregatedAggregationMode »ConstraintAllows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinalitykey : id 1..1Used to label the constraint in OCL or in short displays incapable of displaying the full human descriptionname : string 0..1Identifies the impact constraint violation has on the conformance of the instanceseverity : code 1..1 « SHALL applications comply with this constraint?ConstraintSeverity »Text that can be used to describe the constraint in messages identifying that the constraint has been violatedhuman : string 1..1An XPath expression of constraint that can be executed to see if this constraint is metxpath : string 1..1BindingA descriptive name for this - can be useful for generating implementation artifactsname : string 1..1Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instancesstrength : code 1..1 « Indication of the degree of conformance expectations associated with a bindingBindingStrength »Describes the intended use of this particular set of codesdescription : string 0..1Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be usedvalueSet[x] : uri|Reference(ValueSet) 0..1MappingAn internal reference to the definition of a mappingidentity : id 1..1Identifies the computable language in which mapping.map is expressedlanguage : code 0..1 « The mime type of an attachmentMimeType »Expresses what part of the target specification corresponds to this elementmap : string 1..1Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)slicing0..1The data type or resource that the value of this element is permitted to betype0..*Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instanceconstraint0..*Binds to a value set if this element is coded (code, Coding, CodeableConcept)binding0..1Identifies a concept from an external specification that roughly corresponds to this elementmapping0..*

XML Template

<[name] xmlns="http://hl7.org/fhir"> doco
 <!-- from Element: extension -->
 <path value="[string]"/><!-- 1..1 The path of the element (see the Detailed Descriptions) -->
 <representation value="[code]"/><!-- 0..* How this element is represented in instances -->
 <name value="[string]"/><!-- 0..1 Name for this particular element definition (reference target) -->
 <label value="[string]"/><!-- 0..1 Name for element to display with or prompt for element -->
 <code><!-- 0..* Coding Defining code --></code>
 <slicing>  <!-- 0..1 This element is sliced - slices follow -->
  <discriminator value="[string]"/><!-- 0..* Element values that used to distinguish the slices -->
  <description value="[string]"/><!-- ?? 0..1 Text description of how slicing works (or not) -->
  <ordered value="[boolean]"/><!-- 0..1 If elements must be in same order as slices -->
  <rules value="[code]"/><!-- 1..1 closed | open | openAtEnd -->
 </slicing>
 <short value="[string]"/><!-- 0..1 Concise definition for xml presentation -->
 <definition value="[string]"/><!-- 0..1 Full formal definition as narrative text -->
 <comments value="[string]"/><!-- 0..1 Comments about the use of this element -->
 <requirements value="[string]"/><!-- 0..1 Why is this needed? -->
 <alias value="[string]"/><!-- 0..* Other names -->
 <min value="[integer]"/><!-- ?? 0..1 Minimum Cardinality -->
 <max value="[string]"/><!-- ?? 0..1 Maximum Cardinality (a number or *) -->
 <type>  <!-- ?? 0..* Data type and Profile for this element -->
  <code value="[code]"/><!-- 1..1 Name of Data type or Resource -->
  <profile value="[uri]"/><!-- 0..1 Profile.structure to apply -->
  <aggregation value="[code]"/><!-- ?? 0..* contained | referenced | bundled - how aggregated -->
 </type>
 <nameReference value="[string]"/><!-- ?? 0..1 To another element constraint (by element.name) -->
 <defaultValue[x]><!-- ?? 0..1 * Specified value it missing from instance --></defaultValue[x]>
 <meaningWhenMissing value="[string]"/><!-- ?? 0..1 Implicit meaning when this element is missing -->
 <fixed[x]><!-- ?? 0..1 * Value must be exactly this --></fixed[x]>
 <pattern[x]><!-- ?? 0..1 * Value must have at least these property values --></pattern[x]>
 <example[x]><!-- 0..1 * Example value: [as defined for type] --></example[x]>
 <maxLength value="[integer]"/><!-- 0..1 Max length for strings -->
 <condition value="[id]"/><!-- 0..* Reference to invariant about presence -->
 <constraint>  <!-- 0..* Condition that must evaluate to true -->
  <key value="[id]"/><!-- ?? 1..1 Target of 'condition' reference above -->
  <name value="[string]"/><!-- ?? 0..1 Short human label -->
  <severity value="[code]"/><!-- 1..1 error | warning -->
  <human value="[string]"/><!-- 1..1 Human description of constraint -->
  <xpath value="[string]"/><!-- 1..1 XPath expression of constraint -->
 </constraint>
 <mustSupport value="[boolean]"/><!-- 0..1 If the element must supported -->
 <isModifier value="[boolean]"/><!-- 0..1 If this modifies the meaning of other elements -->
 <isSummary value="[boolean]"/><!-- 0..1 Include when _summary = true? -->
 <binding>  <!-- ?? 0..1 ValueSet details if this is coded -->
  <name value="[string]"/><!-- 1..1 Descriptive Name -->
  <strength value="[code]"/><!-- 1..1 required | extensible | preferred | example -->
  <description value="[string]"/><!-- ?? 0..1 Human explanation of the value set -->
  <valueSet[x]><!-- ?? 0..1 uri|Reference(ValueSet) Source of value set --></valueSet[x]>
 </binding>
 <mapping>  <!-- 0..* Map element to another set of definitions -->
  <identity value="[id]"/><!-- 1..1 Reference to mapping declaration -->
  <language value="[code]"/><!-- 0..1 Computable language of mapping -->
  <map value="[string]"/><!-- 1..1 Details of the mapping -->
 </mapping>
</[name]>

JSON Template

{doco
  // from Element: extension
  "path" : "<string>", // R!  The path of the element (see the Detailed Descriptions)
  "representation" : ["<code>"], // How this element is represented in instances
  "name" : "<string>", // Name for this particular element definition (reference target)
  "label" : "<string>", // Name for element to display with or prompt for element
  "code" : [{ Coding }], // Defining code
  "slicing" : { // This element is sliced - slices follow
    "discriminator" : ["<string>"], // Element values that used to distinguish the slices
    "description" : "<string>", // C? Text description of how slicing works (or not)
    "ordered" : <boolean>, // If elements must be in same order as slices
    "rules" : "<code>" // R!  closed | open | openAtEnd
  },
  "short" : "<string>", // Concise definition for xml presentation
  "definition" : "<string>", // Full formal definition as narrative text
  "comments" : "<string>", // Comments about the use of this element
  "requirements" : "<string>", // Why is this needed?
  "alias" : ["<string>"], // Other names
  "min" : <integer>, // C? Minimum Cardinality
  "max" : "<string>", // C? Maximum Cardinality (a number or *)
  "type" : [{ // C? Data type and Profile for this element
    "code" : "<code>", // R!  Name of Data type or Resource
    "profile" : "<uri>", // Profile.structure to apply
    "aggregation" : ["<code>"] // C? contained | referenced | bundled - how aggregated
  }],
  "nameReference" : "<string>", // C? To another element constraint (by element.name)
  // defaultValue[x]: Specified value it missing from instance. One of these 23:
  "defaultValueInteger" : <integer>,
  "defaultValueDecimal" : <decimal>,
  "defaultValueDateTime" : "<dateTime>",
  "defaultValueDate" : "<date>",
  "defaultValueInstant" : "<instant>",
  "defaultValueString" : "<string>",
  "defaultValueUri" : "<uri>",
  "defaultValueBoolean" : <boolean>,
  "defaultValueCode" : "<code>",
  "defaultValueBase64Binary" : "<base64Binary>",
  "defaultValueCoding" : { Coding },
  "defaultValueCodeableConcept" : { CodeableConcept },
  "defaultValueAttachment" : { Attachment },
  "defaultValueIdentifier" : { Identifier },
  "defaultValueQuantity" : { Quantity },
  "defaultValueRange" : { Range },
  "defaultValuePeriod" : { Period },
  "defaultValueRatio" : { Ratio },
  "defaultValueHumanName" : { HumanName },
  "defaultValueAddress" : { Address },
  "defaultValueContactPoint" : { ContactPoint },
  "defaultValueSchedule" : { Schedule },
  "defaultValueReference" : { Reference },
  "meaningWhenMissing" : "<string>", // C? Implicit meaning when this element is missing
  // fixed[x]: Value must be exactly this. One of these 23:
  "fixedInteger" : <integer>,
  "fixedDecimal" : <decimal>,
  "fixedDateTime" : "<dateTime>",
  "fixedDate" : "<date>",
  "fixedInstant" : "<instant>",
  "fixedString" : "<string>",
  "fixedUri" : "<uri>",
  "fixedBoolean" : <boolean>,
  "fixedCode" : "<code>",
  "fixedBase64Binary" : "<base64Binary>",
  "fixedCoding" : { Coding },
  "fixedCodeableConcept" : { CodeableConcept },
  "fixedAttachment" : { Attachment },
  "fixedIdentifier" : { Identifier },
  "fixedQuantity" : { Quantity },
  "fixedRange" : { Range },
  "fixedPeriod" : { Period },
  "fixedRatio" : { Ratio },
  "fixedHumanName" : { HumanName },
  "fixedAddress" : { Address },
  "fixedContactPoint" : { ContactPoint },
  "fixedSchedule" : { Schedule },
  "fixedReference" : { Reference },
  // pattern[x]: Value must have at least these property values. One of these 23:
  "patternInteger" : <integer>,
  "patternDecimal" : <decimal>,
  "patternDateTime" : "<dateTime>",
  "patternDate" : "<date>",
  "patternInstant" : "<instant>",
  "patternString" : "<string>",
  "patternUri" : "<uri>",
  "patternBoolean" : <boolean>,
  "patternCode" : "<code>",
  "patternBase64Binary" : "<base64Binary>",
  "patternCoding" : { Coding },
  "patternCodeableConcept" : { CodeableConcept },
  "patternAttachment" : { Attachment },
  "patternIdentifier" : { Identifier },
  "patternQuantity" : { Quantity },
  "patternRange" : { Range },
  "patternPeriod" : { Period },
  "patternRatio" : { Ratio },
  "patternHumanName" : { HumanName },
  "patternAddress" : { Address },
  "patternContactPoint" : { ContactPoint },
  "patternSchedule" : { Schedule },
  "patternReference" : { Reference },
  // example[x]: Example value: [as defined for type]. One of these 23:
  "exampleInteger" : <integer>,
  "exampleDecimal" : <decimal>,
  "exampleDateTime" : "<dateTime>",
  "exampleDate" : "<date>",
  "exampleInstant" : "<instant>",
  "exampleString" : "<string>",
  "exampleUri" : "<uri>",
  "exampleBoolean" : <boolean>,
  "exampleCode" : "<code>",
  "exampleBase64Binary" : "<base64Binary>",
  "exampleCoding" : { Coding },
  "exampleCodeableConcept" : { CodeableConcept },
  "exampleAttachment" : { Attachment },
  "exampleIdentifier" : { Identifier },
  "exampleQuantity" : { Quantity },
  "exampleRange" : { Range },
  "examplePeriod" : { Period },
  "exampleRatio" : { Ratio },
  "exampleHumanName" : { HumanName },
  "exampleAddress" : { Address },
  "exampleContactPoint" : { ContactPoint },
  "exampleSchedule" : { Schedule },
  "exampleReference" : { Reference },
  "maxLength" : <integer>, // Max length for strings
  "condition" : ["<id>"], // Reference to invariant about presence
  "constraint" : [{ // Condition that must evaluate to true
    "key" : "<id>", // C? R!  Target of 'condition' reference above
    "name" : "<string>", // C? Short human label
    "severity" : "<code>", // R!  error | warning
    "human" : "<string>", // R!  Human description of constraint
    "xpath" : "<string>" // R!  XPath expression of constraint
  }],
  "mustSupport" : <boolean>, // If the element must supported
  "isModifier" : <boolean>, // If this modifies the meaning of other elements
  "isSummary" : <boolean>, // Include when _summary = true?
  "binding" : { // C? ValueSet details if this is coded
    "name" : "<string>", // R!  Descriptive Name
    "strength" : "<code>", // R!  required | extensible | preferred | example
    "description" : "<string>", // C? Human explanation of the value set
    // valueSet[x]: Source of value set. One of these 2:
    "valueSetUri" : "<uri>"
    "valueSetReference" : { Reference(ValueSet) }
  },
  "mapping" : [{ // Map element to another set of definitions
    "identity" : "<id>", // R!  Reference to mapping declaration
    "language" : "<code>", // Computable language of mapping
    "map" : "<string>" // R!  Details of the mapping
  }]
}

Commentary

Constraints

Further Commentary

1.21.0.2 Interpretation of ElementDefinition in different contexts

The pseudo-data type ElementDefinition is used both in StructureDefinition and DataElement, and even within those resources, the way its elements are to be used and interpreted depend on the context where ElementDefinition used.

1.21.0.2.1 First (root) element in a Structure

1.21.0.2.2 Nested element in a structure

(i.e. not root)

1.21.0.2.3 Element in a structure acting as the slicing entry

The ElementDefinition is understood to be the set of constraints to be used for the "open" slice, i.e. when the slice is open, this definition is used as a constraint on elements in the instance that are not part of a slice and belong to the open portion of the slice. Its use follows the "normal case", except:

1.21.0.2.4 Resource and Extension definitions

1.21.0.2.5 Extension definitions

1.21.0.2.6 Nested Extensions ("Complex Extension")

1.21.0.2.7 Complex elements (elements with upper-case data type)

1.21.0.2.8 Additional constraints

1.21.0.2.9 Constraint rules

ElementDefinition is used in the following places: DataElement and StructureDefinition