HL7 v2+ Specification
0.0.0 - draft

HL7 v2+ Specification, published by HL7 International. This guide is not an authorized publication; it is the continuous build for version 0.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/v2ig/ and changes regularly. See the Directory of published versions

Resource Profile: HL7 v2 Data Type Definition

Official URL: http://hl7.org/v2/StructureDefinition/primitive-data-type-profile Version: 0.0.0
Standards status: Informative Computable Name: V2DataTypeDefinition

Rules that are true for all primitive type definitions

Usages:

You can also check for usages in the FHIR IG Statistics

Formal Views of Profile Content

Description of Profiles, Differentials, Snapshots and how the different presentations work.

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureDefinition C 0..* StructureDefinition Structural Definition
Constraints: cnl-0, sdf-1, sdf-4, sdf-5, sdf-6, sdf-11, sdf-14, sdf-15, sdf-15a, sdf-9, sdf-16, sdf-17, sdf-18, sdf-19, sdf-21, sdf-22, sdf-23, sdf-27, sdf-29
... implicitRules ?!Σ 0..1 uri A set of rules under which this content was created
... contained 0..* Resource Contained, inline Resources
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored
... name ΣC 1..1 string Name for this structure definition (computer friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
... kind ΣC 1..1 code primitive-type | complex-type | resource | logical
Binding: StructureDefinitionKind (required): Defines the type of structure that a definition is describing.
Fixed Value: primitive-type
... abstract ΣC 1..1 boolean Whether the structure is abstract
Fixed Value: false
... type ΣC 1..1 uri Type defined or constrained by this structure
Binding: FHIRTypes (extensible): Either a resource or a data type, including logical model types.
... baseDefinition ΣC 0..1 canonical(StructureDefinition) Definition that this type is constrained/specialized from
... derivation ΣC 0..1 code specialization | constraint - How relates to base definition
Binding: TypeDerivationRule (required): How a type relates to its baseDefinition.
Fixed Value: constraint
... snapshot C 0..1 BackboneElement Snapshot view of the structure
Constraints: sdf-3, sdf-8, sdf-24, sdf-25, sdf-26, sdf-8b
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... element C 1..* ElementDefinition Definition of elements in the resource (if no StructureDefinition)
Constraints: sdf-10, sdf-28

doco Documentation for this format

Terminology Bindings

PathConformanceValueSet / CodeURI
StructureDefinition.urlrequired(a valid code from HL7 v2 Primitive Data Types CodeSystem)
http://hl7.org/v2/ValueSet/primitive-data-types
From this IG
StructureDefinition.statusrequiredPublicationStatus
http://hl7.org/fhir/ValueSet/publication-status|5.0.0
From the FHIR Standard
StructureDefinition.kindrequiredFixed Value: primitive-type
http://hl7.org/fhir/ValueSet/structure-definition-kind|5.0.0
From the FHIR Standard
StructureDefinition.typeextensibleFHIRTypes
http://hl7.org/fhir/ValueSet/fhir-types
From the FHIR Standard
StructureDefinition.derivationrequiredFixed Value: constraint
http://hl7.org/fhir/ValueSet/type-derivation-rule|5.0.0
From the FHIR Standard

Constraints

IdGradePath(s)DetailsRequirements
cnl-0warningStructureDefinitionName should be usable as an identifier for the module by machine processing applications such as code generation
: name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
cnl-1warningStructureDefinition.urlURL should not contain | or # - these characters make processing canonical references problematic
: exists() implies matches('^[^|# ]+$')
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1error**ALL** extensionsMust have either extensions or value[x], not both
: extension.exists() != value.exists()
sdf-1errorStructureDefinitionElement paths must be unique unless the structure is a constraint
: derivation = 'constraint' or snapshot.element.select(path).isDistinct()
sdf-15aerrorStructureDefinitionIf the first element in a differential has no "." in the path and it's not a logical model, it has no type
: (kind!='logical' and differential.element.first().path.contains('.').not()) implies differential.element.first().type.empty()
No Type on the root element (differential)
sdf-3errorStructureDefinition.snapshotEach element definition in a snapshot must have a formal definition and cardinalities, unless model is a logical model
: %resource.kind = 'logical' or element.all(definition.exists() and min.exists() and max.exists())
sdf-4errorStructureDefinitionIf the structure is not abstract, then there SHALL be a baseDefinition
: abstract = true or baseDefinition.exists()
Ensure that the base types are abstract
sdf-5errorStructureDefinitionIf the structure defines an extension then the structure must have context information
: type != 'Extension' or derivation = 'specialization' or (context.exists())
sdf-6errorStructureDefinitionA structure must have either a differential, or a snapshot (or both)
: snapshot.exists() or differential.exists()
sdf-8errorStructureDefinition.snapshotAll snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models
: (%resource.kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))
sdf-9errorStructureDefinitionIn any snapshot or differential, no label, code or requirements on an element without a "." in the path (e.g. the first element)
: children().element.where(path.contains('.').not()).label.empty() and children().element.where(path.contains('.').not()).code.empty() and children().element.where(path.contains('.').not()).requirements.empty()
Because these 3 fields seem to be have overlapping meaning with the ones in the root of StructureDefinition
sdf-10errorStructureDefinition.snapshot.elementprovide either a binding reference or a description (or both)
: binding.empty() or binding.valueSet.exists() or binding.description.exists()
binding is required
sdf-11errorStructureDefinitionIf there's a type, its content must match the path name in the first element of a snapshot
: kind != 'logical' implies snapshot.empty() or snapshot.element.first().path = type
Ensure that the type is not inconsistent with the other information in the structure
sdf-14errorStructureDefinitionAll element definitions must have an id
: snapshot.element.all(id.exists()) and differential.element.all(id.exists())
elements have id
sdf-15errorStructureDefinitionThe first element in a snapshot has no type unless model is a logical model.
: kind!='logical' implies snapshot.element.first().type.empty()
No Type on the root element (snapshot)
sdf-16errorStructureDefinitionAll element definitions must have unique ids (snapshot)
: snapshot.element.all(id.exists()) and snapshot.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-17errorStructureDefinitionAll element definitions must have unique ids (diff)
: differential.element.all(id.exists()) and differential.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-18errorStructureDefinitionContext Invariants can only be used for extensions
: contextInvariant.exists() implies type = 'Extension'
contextInvariant
sdf-19errorStructureDefinitionFHIR Specification models only use FHIR defined types
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (differential | snapshot).element.type.code.all(matches('^[a-zA-Z0-9]+$') or matches('^http:\\/\\/hl7\\.org\\/fhirpath\\/System\\.[A-Z][A-Za-z]+$'))
custom types only in logical models
sdf-21errorStructureDefinitionDefault values can only be specified on specializations
: differential.element.defaultValue.exists() implies (derivation = 'specialization')
no default values on data types or resources
sdf-22errorStructureDefinitionFHIR Specification models never have default values
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (snapshot.element.defaultValue.empty() and differential.element.defaultValue.empty())
no default values on data types or resources
sdf-23errorStructureDefinitionNo slice name on root
: (snapshot | differential).element.all(path.contains('.').not() implies sliceName.empty())
no sliceName on root
sdf-24errorStructureDefinition.snapshotFor CodeableReference elements, target profiles must be listed on the CodeableReference, not the CodeableReference.reference
: element.where(type.where(code='Reference').exists() and path.endsWith('.reference') and type.targetProfile.exists() and (path.substring(0,$this.path.length()-10) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-25errorStructureDefinition.snapshotFor CodeableReference elements, bindings must be listed on the CodeableReference, not the CodeableReference.concept
: element.where(type.where(code='CodeableConcept').exists() and path.endsWith('.concept') and binding.exists() and (path.substring(0,$this.path.length()-8) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-26best practiceStructureDefinition.snapshotThe root element of a profile should not have mustSupport = true
: $this.where(element[0].mustSupport='true').exists().not()
sdf-27errorStructureDefinitionIf there's a base definition, there must be a derivation
: baseDefinition.exists() implies derivation.exists()
sdf-28errorStructureDefinition.snapshot.elementIf there are no discriminators, there must be a definition
: slicing.exists().not() or (slicing.discriminator.exists() or slicing.description.exists())
sdf-29warningStructureDefinitionElements in Resources must have a min cardinality or 0 or 1 and a max cardinality of 1 or *
: ((kind in 'resource' | 'complex-type') and (derivation = 'specialization')) implies differential.element.where((min != 0 and min != 1) or (max != '1' and max != '*')).empty()
sdf-8berrorStructureDefinition.snapshotAll snapshot elements must have a base definition
: element.all(base.exists())

This structure is derived from StructureDefinition

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureDefinition 0..* StructureDefinition Structural Definition
... url 1..1 uri Canonical identifier for this structure definition, represented as a URI (globally unique)
Binding: HL7 v2 Primitive Data Types ValueSet (required)
... kind 1..1 code primitive-type | complex-type | resource | logical
Fixed Value: primitive-type
... abstract 1..1 boolean Whether the structure is abstract
Fixed Value: false

doco Documentation for this format

Terminology Bindings (Differential)

PathConformanceValueSetURI
StructureDefinition.urlrequired(a valid code from HL7 v2 Primitive Data Types CodeSystem)
http://hl7.org/v2/ValueSet/primitive-data-types
From this IG
NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureDefinition C 0..* StructureDefinition Structural Definition
Constraints: cnl-0, sdf-1, sdf-4, sdf-5, sdf-6, sdf-11, sdf-14, sdf-15, sdf-15a, sdf-9, sdf-16, sdf-17, sdf-18, sdf-19, sdf-21, sdf-22, sdf-23, sdf-27, sdf-29
... id Σ 0..1 id Logical id of this artifact
... meta Σ 0..1 Meta Metadata about the resource
... implicitRules ?!Σ 0..1 uri A set of rules under which this content was created
... language 0..1 code Language of the resource content
Binding: AllLanguages (required): IETF language tag for a human language
Additional BindingsPurpose
CommonLanguages Starter
... text 0..1 Narrative Text summary of the resource, for human interpretation
This profile does not constrain the narrative in regard to content, language, or traceability to data elements
... contained 0..* Resource Contained, inline Resources
... extension 0..* Extension Additional content defined by implementations
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored
... url ΣC 1..1 uri Canonical identifier for this structure definition, represented as a URI (globally unique)
Binding: HL7 v2 Primitive Data Types ValueSet (required)
Constraints: cnl-1
... identifier Σ 0..* Identifier Additional identifier for the structure definition
... version Σ 0..1 string Business version of the structure definition
... versionAlgorithm[x] Σ 0..1 How to compare versions
Binding: VersionAlgorithm (extensible)
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 1..1 string Name for this structure definition (computer friendly)
... title Σ 0..1 string Name for this structure definition (human friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
... experimental Σ 0..1 boolean For testing purposes, not real usage
... date Σ 0..1 dateTime Date last changed
... publisher Σ 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher
... description 0..1 markdown Natural language description of the structure definition
... useContext Σ 0..* UsageContext The context that the content is intended to support
... jurisdiction Σ 0..* CodeableConcept Intended jurisdiction for structure definition (if applicable)
Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use.
... purpose 0..1 markdown Why this structure definition is defined
... copyright 0..1 markdown Use and/or publishing restrictions
... copyrightLabel 0..1 string Copyright holder and year(s)
... keyword Σ 0..* Coding Assist with indexing and finding
Binding: DefinitionUseCodes (extensible): Codes for the meaning of the defined structure (SNOMED CT and LOINC codes, as an example).
... fhirVersion Σ 0..1 code FHIR Version this StructureDefinition targets
Binding: FHIRVersion (required): All published FHIR Versions.
... mapping C 0..* BackboneElement External specification that the content is mapped to
Constraints: sdf-2
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... identity 1..1 id Internal id when this mapping is used
.... uri C 0..1 uri Identifies what this mapping refers to
.... name C 0..1 string Names what this mapping refers to
.... comment 0..1 string Versions, Issues, Scope limitations etc
... kind ΣC 1..1 code primitive-type | complex-type | resource | logical
Binding: StructureDefinitionKind (required): Defines the type of structure that a definition is describing.
Fixed Value: primitive-type
... abstract ΣC 1..1 boolean Whether the structure is abstract
Fixed Value: false
... context ΣC 0..* BackboneElement If an extension, where it can be used in instances
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... type Σ 1..1 code fhirpath | element | extension
Binding: ExtensionContextType (required): How an extension context is interpreted.
.... expression Σ 1..1 string Where the extension can be used in instances
... contextInvariant ΣC 0..* string FHIRPath invariants - when the extension can be used
... type ΣC 1..1 uri Type defined or constrained by this structure
Binding: FHIRTypes (extensible): Either a resource or a data type, including logical model types.
... baseDefinition ΣC 0..1 canonical(StructureDefinition) Definition that this type is constrained/specialized from
... derivation ΣC 0..1 code specialization | constraint - How relates to base definition
Binding: TypeDerivationRule (required): How a type relates to its baseDefinition.
Fixed Value: constraint
... snapshot C 0..1 BackboneElement Snapshot view of the structure
Constraints: sdf-3, sdf-8, sdf-24, sdf-25, sdf-26, sdf-8b
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... element C 1..* ElementDefinition Definition of elements in the resource (if no StructureDefinition)
Constraints: sdf-10, sdf-28
... differential C 0..1 BackboneElement Differential view of the structure
Constraints: sdf-20, sdf-8a
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... element C 1..* ElementDefinition Definition of elements in the resource (if no StructureDefinition)

doco Documentation for this format

Terminology Bindings

PathConformanceValueSet / CodeURI
StructureDefinition.languagerequiredAllLanguages
http://hl7.org/fhir/ValueSet/all-languages|5.0.0
From the FHIR Standard
StructureDefinition.urlrequired(a valid code from HL7 v2 Primitive Data Types CodeSystem)
http://hl7.org/v2/ValueSet/primitive-data-types
From this IG
StructureDefinition.versionAlgorithm[x]extensibleVersionAlgorithm
http://hl7.org/fhir/ValueSet/version-algorithm
From the FHIR Standard
StructureDefinition.statusrequiredPublicationStatus
http://hl7.org/fhir/ValueSet/publication-status|5.0.0
From the FHIR Standard
StructureDefinition.jurisdictionextensibleJurisdictionValueSet
http://hl7.org/fhir/ValueSet/jurisdiction
From the FHIR Standard
StructureDefinition.keywordextensibleDefinitionUseCodes
http://hl7.org/fhir/ValueSet/definition-use
From the FHIR Standard
StructureDefinition.fhirVersionrequiredFHIRVersion
http://hl7.org/fhir/ValueSet/FHIR-version|5.0.0
From the FHIR Standard
StructureDefinition.kindrequiredFixed Value: primitive-type
http://hl7.org/fhir/ValueSet/structure-definition-kind|5.0.0
From the FHIR Standard
StructureDefinition.context.typerequiredExtensionContextType
http://hl7.org/fhir/ValueSet/extension-context-type|5.0.0
From the FHIR Standard
StructureDefinition.typeextensibleFHIRTypes
http://hl7.org/fhir/ValueSet/fhir-types
From the FHIR Standard
StructureDefinition.derivationrequiredFixed Value: constraint
http://hl7.org/fhir/ValueSet/type-derivation-rule|5.0.0
From the FHIR Standard

Constraints

IdGradePath(s)DetailsRequirements
cnl-0warningStructureDefinitionName should be usable as an identifier for the module by machine processing applications such as code generation
: name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
cnl-1warningStructureDefinition.urlURL should not contain | or # - these characters make processing canonical references problematic
: exists() implies matches('^[^|# ]+$')
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1error**ALL** extensionsMust have either extensions or value[x], not both
: extension.exists() != value.exists()
sdf-1errorStructureDefinitionElement paths must be unique unless the structure is a constraint
: derivation = 'constraint' or snapshot.element.select(path).isDistinct()
sdf-15aerrorStructureDefinitionIf the first element in a differential has no "." in the path and it's not a logical model, it has no type
: (kind!='logical' and differential.element.first().path.contains('.').not()) implies differential.element.first().type.empty()
No Type on the root element (differential)
sdf-2errorStructureDefinition.mappingMust have at least a name or a uri (or both)
: name.exists() or uri.exists()
sdf-3errorStructureDefinition.snapshotEach element definition in a snapshot must have a formal definition and cardinalities, unless model is a logical model
: %resource.kind = 'logical' or element.all(definition.exists() and min.exists() and max.exists())
sdf-4errorStructureDefinitionIf the structure is not abstract, then there SHALL be a baseDefinition
: abstract = true or baseDefinition.exists()
Ensure that the base types are abstract
sdf-5errorStructureDefinitionIf the structure defines an extension then the structure must have context information
: type != 'Extension' or derivation = 'specialization' or (context.exists())
sdf-6errorStructureDefinitionA structure must have either a differential, or a snapshot (or both)
: snapshot.exists() or differential.exists()
sdf-8errorStructureDefinition.snapshotAll snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models
: (%resource.kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))
sdf-9errorStructureDefinitionIn any snapshot or differential, no label, code or requirements on an element without a "." in the path (e.g. the first element)
: children().element.where(path.contains('.').not()).label.empty() and children().element.where(path.contains('.').not()).code.empty() and children().element.where(path.contains('.').not()).requirements.empty()
Because these 3 fields seem to be have overlapping meaning with the ones in the root of StructureDefinition
sdf-10errorStructureDefinition.snapshot.elementprovide either a binding reference or a description (or both)
: binding.empty() or binding.valueSet.exists() or binding.description.exists()
binding is required
sdf-11errorStructureDefinitionIf there's a type, its content must match the path name in the first element of a snapshot
: kind != 'logical' implies snapshot.empty() or snapshot.element.first().path = type
Ensure that the type is not inconsistent with the other information in the structure
sdf-14errorStructureDefinitionAll element definitions must have an id
: snapshot.element.all(id.exists()) and differential.element.all(id.exists())
elements have id
sdf-15errorStructureDefinitionThe first element in a snapshot has no type unless model is a logical model.
: kind!='logical' implies snapshot.element.first().type.empty()
No Type on the root element (snapshot)
sdf-16errorStructureDefinitionAll element definitions must have unique ids (snapshot)
: snapshot.element.all(id.exists()) and snapshot.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-17errorStructureDefinitionAll element definitions must have unique ids (diff)
: differential.element.all(id.exists()) and differential.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-18errorStructureDefinitionContext Invariants can only be used for extensions
: contextInvariant.exists() implies type = 'Extension'
contextInvariant
sdf-19errorStructureDefinitionFHIR Specification models only use FHIR defined types
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (differential | snapshot).element.type.code.all(matches('^[a-zA-Z0-9]+$') or matches('^http:\\/\\/hl7\\.org\\/fhirpath\\/System\\.[A-Z][A-Za-z]+$'))
custom types only in logical models
sdf-20errorStructureDefinition.differentialNo slicing on the root element
: element.where(path.contains('.').not()).slicing.empty()
no slicing on root
sdf-21errorStructureDefinitionDefault values can only be specified on specializations
: differential.element.defaultValue.exists() implies (derivation = 'specialization')
no default values on data types or resources
sdf-22errorStructureDefinitionFHIR Specification models never have default values
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (snapshot.element.defaultValue.empty() and differential.element.defaultValue.empty())
no default values on data types or resources
sdf-23errorStructureDefinitionNo slice name on root
: (snapshot | differential).element.all(path.contains('.').not() implies sliceName.empty())
no sliceName on root
sdf-24errorStructureDefinition.snapshotFor CodeableReference elements, target profiles must be listed on the CodeableReference, not the CodeableReference.reference
: element.where(type.where(code='Reference').exists() and path.endsWith('.reference') and type.targetProfile.exists() and (path.substring(0,$this.path.length()-10) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-25errorStructureDefinition.snapshotFor CodeableReference elements, bindings must be listed on the CodeableReference, not the CodeableReference.concept
: element.where(type.where(code='CodeableConcept').exists() and path.endsWith('.concept') and binding.exists() and (path.substring(0,$this.path.length()-8) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-26best practiceStructureDefinition.snapshotThe root element of a profile should not have mustSupport = true
: $this.where(element[0].mustSupport='true').exists().not()
sdf-27errorStructureDefinitionIf there's a base definition, there must be a derivation
: baseDefinition.exists() implies derivation.exists()
sdf-28errorStructureDefinition.snapshot.elementIf there are no discriminators, there must be a definition
: slicing.exists().not() or (slicing.discriminator.exists() or slicing.description.exists())
sdf-29warningStructureDefinitionElements in Resources must have a min cardinality or 0 or 1 and a max cardinality of 1 or *
: ((kind in 'resource' | 'complex-type') and (derivation = 'specialization')) implies differential.element.where((min != 0 and min != 1) or (max != '1' and max != '*')).empty()
sdf-8aerrorStructureDefinition.differentialIn any differential, all the elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models
: (%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().empty() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\..*','')&'.')))
sdf-8berrorStructureDefinition.snapshotAll snapshot elements must have a base definition
: element.all(base.exists())

This structure is derived from StructureDefinition

Summary

Fixed: 3 elements

Key Elements View

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureDefinition C 0..* StructureDefinition Structural Definition
Constraints: cnl-0, sdf-1, sdf-4, sdf-5, sdf-6, sdf-11, sdf-14, sdf-15, sdf-15a, sdf-9, sdf-16, sdf-17, sdf-18, sdf-19, sdf-21, sdf-22, sdf-23, sdf-27, sdf-29
... implicitRules ?!Σ 0..1 uri A set of rules under which this content was created
... contained 0..* Resource Contained, inline Resources
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored
... name ΣC 1..1 string Name for this structure definition (computer friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
... kind ΣC 1..1 code primitive-type | complex-type | resource | logical
Binding: StructureDefinitionKind (required): Defines the type of structure that a definition is describing.
Fixed Value: primitive-type
... abstract ΣC 1..1 boolean Whether the structure is abstract
Fixed Value: false
... type ΣC 1..1 uri Type defined or constrained by this structure
Binding: FHIRTypes (extensible): Either a resource or a data type, including logical model types.
... baseDefinition ΣC 0..1 canonical(StructureDefinition) Definition that this type is constrained/specialized from
... derivation ΣC 0..1 code specialization | constraint - How relates to base definition
Binding: TypeDerivationRule (required): How a type relates to its baseDefinition.
Fixed Value: constraint
... snapshot C 0..1 BackboneElement Snapshot view of the structure
Constraints: sdf-3, sdf-8, sdf-24, sdf-25, sdf-26, sdf-8b
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... element C 1..* ElementDefinition Definition of elements in the resource (if no StructureDefinition)
Constraints: sdf-10, sdf-28

doco Documentation for this format

Terminology Bindings

PathConformanceValueSet / CodeURI
StructureDefinition.urlrequired(a valid code from HL7 v2 Primitive Data Types CodeSystem)
http://hl7.org/v2/ValueSet/primitive-data-types
From this IG
StructureDefinition.statusrequiredPublicationStatus
http://hl7.org/fhir/ValueSet/publication-status|5.0.0
From the FHIR Standard
StructureDefinition.kindrequiredFixed Value: primitive-type
http://hl7.org/fhir/ValueSet/structure-definition-kind|5.0.0
From the FHIR Standard
StructureDefinition.typeextensibleFHIRTypes
http://hl7.org/fhir/ValueSet/fhir-types
From the FHIR Standard
StructureDefinition.derivationrequiredFixed Value: constraint
http://hl7.org/fhir/ValueSet/type-derivation-rule|5.0.0
From the FHIR Standard

Constraints

IdGradePath(s)DetailsRequirements
cnl-0warningStructureDefinitionName should be usable as an identifier for the module by machine processing applications such as code generation
: name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
cnl-1warningStructureDefinition.urlURL should not contain | or # - these characters make processing canonical references problematic
: exists() implies matches('^[^|# ]+$')
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1error**ALL** extensionsMust have either extensions or value[x], not both
: extension.exists() != value.exists()
sdf-1errorStructureDefinitionElement paths must be unique unless the structure is a constraint
: derivation = 'constraint' or snapshot.element.select(path).isDistinct()
sdf-15aerrorStructureDefinitionIf the first element in a differential has no "." in the path and it's not a logical model, it has no type
: (kind!='logical' and differential.element.first().path.contains('.').not()) implies differential.element.first().type.empty()
No Type on the root element (differential)
sdf-3errorStructureDefinition.snapshotEach element definition in a snapshot must have a formal definition and cardinalities, unless model is a logical model
: %resource.kind = 'logical' or element.all(definition.exists() and min.exists() and max.exists())
sdf-4errorStructureDefinitionIf the structure is not abstract, then there SHALL be a baseDefinition
: abstract = true or baseDefinition.exists()
Ensure that the base types are abstract
sdf-5errorStructureDefinitionIf the structure defines an extension then the structure must have context information
: type != 'Extension' or derivation = 'specialization' or (context.exists())
sdf-6errorStructureDefinitionA structure must have either a differential, or a snapshot (or both)
: snapshot.exists() or differential.exists()
sdf-8errorStructureDefinition.snapshotAll snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models
: (%resource.kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))
sdf-9errorStructureDefinitionIn any snapshot or differential, no label, code or requirements on an element without a "." in the path (e.g. the first element)
: children().element.where(path.contains('.').not()).label.empty() and children().element.where(path.contains('.').not()).code.empty() and children().element.where(path.contains('.').not()).requirements.empty()
Because these 3 fields seem to be have overlapping meaning with the ones in the root of StructureDefinition
sdf-10errorStructureDefinition.snapshot.elementprovide either a binding reference or a description (or both)
: binding.empty() or binding.valueSet.exists() or binding.description.exists()
binding is required
sdf-11errorStructureDefinitionIf there's a type, its content must match the path name in the first element of a snapshot
: kind != 'logical' implies snapshot.empty() or snapshot.element.first().path = type
Ensure that the type is not inconsistent with the other information in the structure
sdf-14errorStructureDefinitionAll element definitions must have an id
: snapshot.element.all(id.exists()) and differential.element.all(id.exists())
elements have id
sdf-15errorStructureDefinitionThe first element in a snapshot has no type unless model is a logical model.
: kind!='logical' implies snapshot.element.first().type.empty()
No Type on the root element (snapshot)
sdf-16errorStructureDefinitionAll element definitions must have unique ids (snapshot)
: snapshot.element.all(id.exists()) and snapshot.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-17errorStructureDefinitionAll element definitions must have unique ids (diff)
: differential.element.all(id.exists()) and differential.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-18errorStructureDefinitionContext Invariants can only be used for extensions
: contextInvariant.exists() implies type = 'Extension'
contextInvariant
sdf-19errorStructureDefinitionFHIR Specification models only use FHIR defined types
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (differential | snapshot).element.type.code.all(matches('^[a-zA-Z0-9]+$') or matches('^http:\\/\\/hl7\\.org\\/fhirpath\\/System\\.[A-Z][A-Za-z]+$'))
custom types only in logical models
sdf-21errorStructureDefinitionDefault values can only be specified on specializations
: differential.element.defaultValue.exists() implies (derivation = 'specialization')
no default values on data types or resources
sdf-22errorStructureDefinitionFHIR Specification models never have default values
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (snapshot.element.defaultValue.empty() and differential.element.defaultValue.empty())
no default values on data types or resources
sdf-23errorStructureDefinitionNo slice name on root
: (snapshot | differential).element.all(path.contains('.').not() implies sliceName.empty())
no sliceName on root
sdf-24errorStructureDefinition.snapshotFor CodeableReference elements, target profiles must be listed on the CodeableReference, not the CodeableReference.reference
: element.where(type.where(code='Reference').exists() and path.endsWith('.reference') and type.targetProfile.exists() and (path.substring(0,$this.path.length()-10) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-25errorStructureDefinition.snapshotFor CodeableReference elements, bindings must be listed on the CodeableReference, not the CodeableReference.concept
: element.where(type.where(code='CodeableConcept').exists() and path.endsWith('.concept') and binding.exists() and (path.substring(0,$this.path.length()-8) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-26best practiceStructureDefinition.snapshotThe root element of a profile should not have mustSupport = true
: $this.where(element[0].mustSupport='true').exists().not()
sdf-27errorStructureDefinitionIf there's a base definition, there must be a derivation
: baseDefinition.exists() implies derivation.exists()
sdf-28errorStructureDefinition.snapshot.elementIf there are no discriminators, there must be a definition
: slicing.exists().not() or (slicing.discriminator.exists() or slicing.description.exists())
sdf-29warningStructureDefinitionElements in Resources must have a min cardinality or 0 or 1 and a max cardinality of 1 or *
: ((kind in 'resource' | 'complex-type') and (derivation = 'specialization')) implies differential.element.where((min != 0 and min != 1) or (max != '1' and max != '*')).empty()
sdf-8berrorStructureDefinition.snapshotAll snapshot elements must have a base definition
: element.all(base.exists())

Differential View

This structure is derived from StructureDefinition

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureDefinition 0..* StructureDefinition Structural Definition
... url 1..1 uri Canonical identifier for this structure definition, represented as a URI (globally unique)
Binding: HL7 v2 Primitive Data Types ValueSet (required)
... kind 1..1 code primitive-type | complex-type | resource | logical
Fixed Value: primitive-type
... abstract 1..1 boolean Whether the structure is abstract
Fixed Value: false

doco Documentation for this format

Terminology Bindings (Differential)

PathConformanceValueSetURI
StructureDefinition.urlrequired(a valid code from HL7 v2 Primitive Data Types CodeSystem)
http://hl7.org/v2/ValueSet/primitive-data-types
From this IG

Snapshot View

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. StructureDefinition C 0..* StructureDefinition Structural Definition
Constraints: cnl-0, sdf-1, sdf-4, sdf-5, sdf-6, sdf-11, sdf-14, sdf-15, sdf-15a, sdf-9, sdf-16, sdf-17, sdf-18, sdf-19, sdf-21, sdf-22, sdf-23, sdf-27, sdf-29
... id Σ 0..1 id Logical id of this artifact
... meta Σ 0..1 Meta Metadata about the resource
... implicitRules ?!Σ 0..1 uri A set of rules under which this content was created
... language 0..1 code Language of the resource content
Binding: AllLanguages (required): IETF language tag for a human language
Additional BindingsPurpose
CommonLanguages Starter
... text 0..1 Narrative Text summary of the resource, for human interpretation
This profile does not constrain the narrative in regard to content, language, or traceability to data elements
... contained 0..* Resource Contained, inline Resources
... extension 0..* Extension Additional content defined by implementations
... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored
... url ΣC 1..1 uri Canonical identifier for this structure definition, represented as a URI (globally unique)
Binding: HL7 v2 Primitive Data Types ValueSet (required)
Constraints: cnl-1
... identifier Σ 0..* Identifier Additional identifier for the structure definition
... version Σ 0..1 string Business version of the structure definition
... versionAlgorithm[x] Σ 0..1 How to compare versions
Binding: VersionAlgorithm (extensible)
.... versionAlgorithmString string
.... versionAlgorithmCoding Coding
... name ΣC 1..1 string Name for this structure definition (computer friendly)
... title Σ 0..1 string Name for this structure definition (human friendly)
... status ?!Σ 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
... experimental Σ 0..1 boolean For testing purposes, not real usage
... date Σ 0..1 dateTime Date last changed
... publisher Σ 0..1 string Name of the publisher/steward (organization or individual)
... contact Σ 0..* ContactDetail Contact details for the publisher
... description 0..1 markdown Natural language description of the structure definition
... useContext Σ 0..* UsageContext The context that the content is intended to support
... jurisdiction Σ 0..* CodeableConcept Intended jurisdiction for structure definition (if applicable)
Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use.
... purpose 0..1 markdown Why this structure definition is defined
... copyright 0..1 markdown Use and/or publishing restrictions
... copyrightLabel 0..1 string Copyright holder and year(s)
... keyword Σ 0..* Coding Assist with indexing and finding
Binding: DefinitionUseCodes (extensible): Codes for the meaning of the defined structure (SNOMED CT and LOINC codes, as an example).
... fhirVersion Σ 0..1 code FHIR Version this StructureDefinition targets
Binding: FHIRVersion (required): All published FHIR Versions.
... mapping C 0..* BackboneElement External specification that the content is mapped to
Constraints: sdf-2
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... identity 1..1 id Internal id when this mapping is used
.... uri C 0..1 uri Identifies what this mapping refers to
.... name C 0..1 string Names what this mapping refers to
.... comment 0..1 string Versions, Issues, Scope limitations etc
... kind ΣC 1..1 code primitive-type | complex-type | resource | logical
Binding: StructureDefinitionKind (required): Defines the type of structure that a definition is describing.
Fixed Value: primitive-type
... abstract ΣC 1..1 boolean Whether the structure is abstract
Fixed Value: false
... context ΣC 0..* BackboneElement If an extension, where it can be used in instances
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... type Σ 1..1 code fhirpath | element | extension
Binding: ExtensionContextType (required): How an extension context is interpreted.
.... expression Σ 1..1 string Where the extension can be used in instances
... contextInvariant ΣC 0..* string FHIRPath invariants - when the extension can be used
... type ΣC 1..1 uri Type defined or constrained by this structure
Binding: FHIRTypes (extensible): Either a resource or a data type, including logical model types.
... baseDefinition ΣC 0..1 canonical(StructureDefinition) Definition that this type is constrained/specialized from
... derivation ΣC 0..1 code specialization | constraint - How relates to base definition
Binding: TypeDerivationRule (required): How a type relates to its baseDefinition.
Fixed Value: constraint
... snapshot C 0..1 BackboneElement Snapshot view of the structure
Constraints: sdf-3, sdf-8, sdf-24, sdf-25, sdf-26, sdf-8b
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... element C 1..* ElementDefinition Definition of elements in the resource (if no StructureDefinition)
Constraints: sdf-10, sdf-28
... differential C 0..1 BackboneElement Differential view of the structure
Constraints: sdf-20, sdf-8a
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... element C 1..* ElementDefinition Definition of elements in the resource (if no StructureDefinition)

doco Documentation for this format

Terminology Bindings

PathConformanceValueSet / CodeURI
StructureDefinition.languagerequiredAllLanguages
http://hl7.org/fhir/ValueSet/all-languages|5.0.0
From the FHIR Standard
StructureDefinition.urlrequired(a valid code from HL7 v2 Primitive Data Types CodeSystem)
http://hl7.org/v2/ValueSet/primitive-data-types
From this IG
StructureDefinition.versionAlgorithm[x]extensibleVersionAlgorithm
http://hl7.org/fhir/ValueSet/version-algorithm
From the FHIR Standard
StructureDefinition.statusrequiredPublicationStatus
http://hl7.org/fhir/ValueSet/publication-status|5.0.0
From the FHIR Standard
StructureDefinition.jurisdictionextensibleJurisdictionValueSet
http://hl7.org/fhir/ValueSet/jurisdiction
From the FHIR Standard
StructureDefinition.keywordextensibleDefinitionUseCodes
http://hl7.org/fhir/ValueSet/definition-use
From the FHIR Standard
StructureDefinition.fhirVersionrequiredFHIRVersion
http://hl7.org/fhir/ValueSet/FHIR-version|5.0.0
From the FHIR Standard
StructureDefinition.kindrequiredFixed Value: primitive-type
http://hl7.org/fhir/ValueSet/structure-definition-kind|5.0.0
From the FHIR Standard
StructureDefinition.context.typerequiredExtensionContextType
http://hl7.org/fhir/ValueSet/extension-context-type|5.0.0
From the FHIR Standard
StructureDefinition.typeextensibleFHIRTypes
http://hl7.org/fhir/ValueSet/fhir-types
From the FHIR Standard
StructureDefinition.derivationrequiredFixed Value: constraint
http://hl7.org/fhir/ValueSet/type-derivation-rule|5.0.0
From the FHIR Standard

Constraints

IdGradePath(s)DetailsRequirements
cnl-0warningStructureDefinitionName should be usable as an identifier for the module by machine processing applications such as code generation
: name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
cnl-1warningStructureDefinition.urlURL should not contain | or # - these characters make processing canonical references problematic
: exists() implies matches('^[^|# ]+$')
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1error**ALL** extensionsMust have either extensions or value[x], not both
: extension.exists() != value.exists()
sdf-1errorStructureDefinitionElement paths must be unique unless the structure is a constraint
: derivation = 'constraint' or snapshot.element.select(path).isDistinct()
sdf-15aerrorStructureDefinitionIf the first element in a differential has no "." in the path and it's not a logical model, it has no type
: (kind!='logical' and differential.element.first().path.contains('.').not()) implies differential.element.first().type.empty()
No Type on the root element (differential)
sdf-2errorStructureDefinition.mappingMust have at least a name or a uri (or both)
: name.exists() or uri.exists()
sdf-3errorStructureDefinition.snapshotEach element definition in a snapshot must have a formal definition and cardinalities, unless model is a logical model
: %resource.kind = 'logical' or element.all(definition.exists() and min.exists() and max.exists())
sdf-4errorStructureDefinitionIf the structure is not abstract, then there SHALL be a baseDefinition
: abstract = true or baseDefinition.exists()
Ensure that the base types are abstract
sdf-5errorStructureDefinitionIf the structure defines an extension then the structure must have context information
: type != 'Extension' or derivation = 'specialization' or (context.exists())
sdf-6errorStructureDefinitionA structure must have either a differential, or a snapshot (or both)
: snapshot.exists() or differential.exists()
sdf-8errorStructureDefinition.snapshotAll snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models
: (%resource.kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))
sdf-9errorStructureDefinitionIn any snapshot or differential, no label, code or requirements on an element without a "." in the path (e.g. the first element)
: children().element.where(path.contains('.').not()).label.empty() and children().element.where(path.contains('.').not()).code.empty() and children().element.where(path.contains('.').not()).requirements.empty()
Because these 3 fields seem to be have overlapping meaning with the ones in the root of StructureDefinition
sdf-10errorStructureDefinition.snapshot.elementprovide either a binding reference or a description (or both)
: binding.empty() or binding.valueSet.exists() or binding.description.exists()
binding is required
sdf-11errorStructureDefinitionIf there's a type, its content must match the path name in the first element of a snapshot
: kind != 'logical' implies snapshot.empty() or snapshot.element.first().path = type
Ensure that the type is not inconsistent with the other information in the structure
sdf-14errorStructureDefinitionAll element definitions must have an id
: snapshot.element.all(id.exists()) and differential.element.all(id.exists())
elements have id
sdf-15errorStructureDefinitionThe first element in a snapshot has no type unless model is a logical model.
: kind!='logical' implies snapshot.element.first().type.empty()
No Type on the root element (snapshot)
sdf-16errorStructureDefinitionAll element definitions must have unique ids (snapshot)
: snapshot.element.all(id.exists()) and snapshot.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-17errorStructureDefinitionAll element definitions must have unique ids (diff)
: differential.element.all(id.exists()) and differential.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-18errorStructureDefinitionContext Invariants can only be used for extensions
: contextInvariant.exists() implies type = 'Extension'
contextInvariant
sdf-19errorStructureDefinitionFHIR Specification models only use FHIR defined types
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (differential | snapshot).element.type.code.all(matches('^[a-zA-Z0-9]+$') or matches('^http:\\/\\/hl7\\.org\\/fhirpath\\/System\\.[A-Z][A-Za-z]+$'))
custom types only in logical models
sdf-20errorStructureDefinition.differentialNo slicing on the root element
: element.where(path.contains('.').not()).slicing.empty()
no slicing on root
sdf-21errorStructureDefinitionDefault values can only be specified on specializations
: differential.element.defaultValue.exists() implies (derivation = 'specialization')
no default values on data types or resources
sdf-22errorStructureDefinitionFHIR Specification models never have default values
: url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (snapshot.element.defaultValue.empty() and differential.element.defaultValue.empty())
no default values on data types or resources
sdf-23errorStructureDefinitionNo slice name on root
: (snapshot | differential).element.all(path.contains('.').not() implies sliceName.empty())
no sliceName on root
sdf-24errorStructureDefinition.snapshotFor CodeableReference elements, target profiles must be listed on the CodeableReference, not the CodeableReference.reference
: element.where(type.where(code='Reference').exists() and path.endsWith('.reference') and type.targetProfile.exists() and (path.substring(0,$this.path.length()-10) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-25errorStructureDefinition.snapshotFor CodeableReference elements, bindings must be listed on the CodeableReference, not the CodeableReference.concept
: element.where(type.where(code='CodeableConcept').exists() and path.endsWith('.concept') and binding.exists() and (path.substring(0,$this.path.length()-8) in %context.element.where(type.where(code='CodeableReference').exists()).path)).exists().not()
sdf-26best practiceStructureDefinition.snapshotThe root element of a profile should not have mustSupport = true
: $this.where(element[0].mustSupport='true').exists().not()
sdf-27errorStructureDefinitionIf there's a base definition, there must be a derivation
: baseDefinition.exists() implies derivation.exists()
sdf-28errorStructureDefinition.snapshot.elementIf there are no discriminators, there must be a definition
: slicing.exists().not() or (slicing.discriminator.exists() or slicing.description.exists())
sdf-29warningStructureDefinitionElements in Resources must have a min cardinality or 0 or 1 and a max cardinality of 1 or *
: ((kind in 'resource' | 'complex-type') and (derivation = 'specialization')) implies differential.element.where((min != 0 and min != 1) or (max != '1' and max != '*')).empty()
sdf-8aerrorStructureDefinition.differentialIn any differential, all the elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models
: (%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().empty() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\..*','')&'.')))
sdf-8berrorStructureDefinition.snapshotAll snapshot elements must have a base definition
: element.all(base.exists())

This structure is derived from StructureDefinition

Summary

Fixed: 3 elements

 

Other representations of profile: CSV, Excel, Schematron