2nd DSTU Draft For Comment

This page is part of the FHIR Specification (v0.4.0: DSTU 2 Draft). 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

6.18 Resource StructureDefinition - Content

This resource maintained by the FHIR Management Group Work Group

A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.

6.18.1 Scope and Usage

The StructureDefinition resource describes a structure - a set of data element definitions, and their associated rules of usage. These structure definitions are used to describe both the content defined in the FHIR specification itself - Resources, data types, the underlying infrastructural types, and also are used to describe how these structures are used in implementations. This allows the definitions of the structures to be shared and published through repositories of structure definitions, compared with each other, and used as the basis for code, report and UI generation.

Note that as part of the specification itself, a full set of structure definitions for all resources and data types is published.

6.18.2 Boundaries and Relationships

  • StructureDefinitions are used by Conformance instances for specifying how resources are used
  • StructureDefinitions use Value Sets to specify the content of coded elements

6.18.3 Background and Context

Implementers should be familiar with with the background and concepts described in Profiling FHIR before working with this resource.

6.18.3.1 Metadata

The StructureDefinition resource has a set of metadata that is mostly shared with the Value Set, Conformance and other infrastructure resources. The metadata describes the structure, and helps find the structure when registered in profile repositories.

urlThe identifier that is used to identify this structure when it is referenced in a specification, model, design or an instance. This URL is where the structure can be accessed
identifierOther identifiers that are used to identify this structure
version

The identifier that is used to identify this version of the structure when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure author manually and the value should be a timestamp.

Note that there may be multiple resource versions of the structure that have this same identifier. The resource will have updates that create new versions for technical reasons, whereas the stated version number needs to be under the author's control

nameA free text natural language name identifying the structure
publisherDetails of the individual or organization who accepts responsibility for publishing the structure. This helps establish the "authority/credibility" of the structure.
telecomContact details to assist a user in finding and communicating with the publisher
descriptionA free text natural language description of the structure and its use
requirementsThe Scope and Usage that this structure was created to meet
codeA set of terms from external terminologies that may be used to assist with indexing and searching of profiles
statusThe status of the structure allows filtering of profiles that are appropriate for use vs. not. See the Status Codes
experimentalThis structure was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
dateThe date that this version of the structure was published
fhirVersionThe version of the FHIR specification on which this structure is based. It is not necessary to specify the version, as most profiles are valid across multiple versions, and the validity of a structure against a particular version of FHIR can easily be checked by tooling.
typetodo
contextTypetodo
contexttodo

Notes:

  • The name of the structure is not required to be globally unique, but the name should have some scoping information (i.e. Acme Inc. (USA), Allergy List)
  • Multiple codes may be assigned to the structure. These may either describe the structure, the focus of the structure or both. They are solely to help find the structure by searching for structured concepts
  • The 3 status codes (draft, active, and retired) are the codes that are relevant to structure consumers. Authors may wish to use the authoring-status extension to track the life cycle of a structure as it is prepared

6.18.4 Resource Content

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. StructureDefinition IDomainResourceResource Profile
If the type is 'extension' then the structure must have context information
A structure must have a base unless it’s type is 'abstract'
A structure must have either a differential, or a snapshot (or both)
... url 1..1uriLiteral URL used to reference this profile
... identifier Σ0..*IdentifierOther identifiers for the profile
... version Σ0..1stringLogical id for this version of the profile
... name Σ1..1stringInformal name for this profile
... display 0..1stringUse this name when displaying the value
... publisher Σ0..1stringName of the publisher (Organization or individual)
... contact Σ0..*ElementContact details of the publisher
.... name Σ0..1stringName of a individual to contact
.... telecom Σ0..*ContactPointContact details for individual or publisher
... description Σ0..1stringNatural language description of the profile
... requirements 0..1stringScope and Usage this structure definition is for
... copyright 0..1stringUse and/or Publishing restrictions
... code Σ0..*CodingAssist with indexing and finding
... status M Σ1..1codedraft | active | retired
StructureDefinitionStatus (Required)
... experimental Σ0..1booleanIf for testing purposes, not real usage
... date Σ0..1dateTimeDate for this version of the profile
... fhirVersion Σ0..1idFHIR Version this profile targets
... mapping I0..*ElementExternal specification that the content is mapped to
Must have at a name or a uri (or both)
.... identity 1..1idInternal id when this mapping is used
.... uri I0..1uriIdentifies what this mapping refers to
.... name I0..1stringNames what this mapping refers to
.... comments 0..1stringVersions, Issues, Scope limitations etc
... type 1..1codeabstract | type | resource | constraint | extension
StructureDefinitionType (Required)
... contextType I0..1coderesource | datatype | mapping | extension
ExtensionContext (Required)
... context I0..*stringWhere the extension can be used in instances
... base I0..1uriStructure that this set of constraints applies to
... snapshot I0..1ElementSnapshot view of the structure
Element paths must be unique - or not (LM)
If a structure is a snapshot, then each element definition must have a formal definition, and cardinalities
.... element I1..*ElementDefinitionDefinition of elements in the resource (if no profile)
... differential I0..1ElementDifferential view of the structure
.... element 1..*ElementDefinitionDefinition of elements in the resource (if no profile)

UML Diagram

StructureDefinition (DomainResource)The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systemsurl : uri 1..1Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)identifier : Identifier 0..*The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manuallyversion : string 0..1A free text natural language name identifying the Profilename : string 1..1Defined so that applications can use this name when displaying the value of the extension to the userdisplay : string 0..1The name of the individual or organization that published the structure definitionpublisher : string 0..1A free text natural language description of the profile and its usedescription : string 0..1Explains why this structure definition is needed and why it's been constrained as it hasrequirements : string 0..1A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappingscopyright : string 0..1A set of terms from external terminologies that may be used to assist with indexing and searching of templatescode : Coding 0..*The status of the profile (this element modifies the meaning of other elements)status : code 1..1 « The lifecycle status of a StructureDefinitionStructureDefinitionStatus »This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usageexperimental : boolean 0..1The date that this version of the profile was publisheddate : dateTime 0..1The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.4.0 for this versionfhirVersion : id 0..1Defines the type of structure that this definition is describingtype : code 1..1 « Defines the type of structure that a definition is describingStructureDefinitionType »Identifies the type of context to which the extension appliescontextType : code 0..1 « How an extension context is interpretedExtensionContext »Identifies the types of resource or data type elements to which the extension can be appliedcontext : string 0..*The structure that is the base on which this set of constraints is derived frombase : uri 0..1ContactThe name of an individual to contact regarding the structure definitionname : string 0..1Contact details for individual (if a name was provided) or the publishertelecom : ContactPoint 0..*MappingAn Internal id that is used to identify this mapping set when specific mappings are madeidentity : id 1..1A URI that identifies the specification that this mapping is expressed touri : uri 0..1A name for the specification that is being mapped toname : string 0..1Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usagecomments : string 0..1SnapshotCaptures constraints on each element within the resourceelement : ElementDefinition 1..*DifferentialCaptures constraints on each element within the resourceelement : ElementDefinition 1..*Contacts to assist a user in finding and communicating with the publishercontact0..*An external specification that the content is mapped tomapping0..*A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profilesnapshot0..1A differential view is expressed relative to the base profile - a statement of differences that it appliesdifferential0..1

XML Template

<StructureDefinition xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 1..1 Literal URL used to reference this profile -->
 <identifier><!-- 0..* Identifier Other identifiers for the profile --></identifier>
 <version value="[string]"/><!-- 0..1 Logical id for this version of the profile -->
 <name value="[string]"/><!-- 1..1 Informal name for this profile -->
 <display value="[string]"/><!-- 0..1 Use this name when displaying the value -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (Organization or individual) -->
 <contact>  <!-- 0..* Contact details of the publisher -->
  <name value="[string]"/><!-- 0..1 Name of a individual to contact -->
  <telecom><!-- 0..* ContactPoint Contact details for individual or publisher --></telecom>
 </contact>
 <description value="[string]"/><!-- 0..1 Natural language description of the profile -->
 <requirements value="[string]"/><!-- 0..1 Scope and Usage this structure definition is for -->
 <copyright value="[string]"/><!-- 0..1 Use and/or Publishing restrictions -->
 <code><!-- 0..* Coding Assist with indexing and finding --></code>
 <status value="[code]"/><!-- 1..1 draft | active | retired -->
 <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage -->
 <date value="[dateTime]"/><!-- 0..1 Date for this version of the profile -->
 <fhirVersion value="[id]"/><!-- 0..1 FHIR Version this profile targets -->
 <mapping>  <!-- 0..* External specification that the content is mapped to -->
  <identity value="[id]"/><!-- 1..1 Internal id when this mapping is used -->
  <uri value="[uri]"/><!-- ?? 0..1 Identifies what this mapping refers to -->
  <name value="[string]"/><!-- ?? 0..1 Names what this mapping refers to -->
  <comments value="[string]"/><!-- 0..1 Versions, Issues, Scope limitations etc -->
 </mapping>
 <type value="[code]"/><!-- 1..1 abstract | type | resource | constraint | extension -->
 <contextType value="[code]"/><!-- ?? 0..1 resource | datatype | mapping | extension -->
 <context value="[string]"/><!-- ?? 0..* Where the extension can be used in instances -->
 <base value="[uri]"/><!-- ?? 0..1 Structure that this set of constraints applies to -->
 <snapshot>  <!-- ?? 0..1 Snapshot view of the structure -->
  <element><!-- ?? 1..* ElementDefinition 
      Definition of elements in the resource (if no profile) --></element>
 </snapshot>
 <differential>  <!-- ?? 0..1 Differential view of the structure -->
  <element><!-- 1..* ElementDefinition 
      Definition of elements in the resource (if no profile) --></element>
 </differential>
</StructureDefinition>

JSON Template

{doco
  "resourceType" : "StructureDefinition",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // R! Literal URL used to reference this profile
  "identifier" : [{ Identifier }], // Other identifiers for the profile
  "version" : "<string>", // Logical id for this version of the profile
  "name" : "<string>", // R! Informal name for this profile
  "display" : "<string>", // Use this name when displaying the value
  "publisher" : "<string>", // Name of the publisher (Organization or individual)
  "contact" : [{ // Contact details of the publisher
    "name" : "<string>", // Name of a individual to contact
    "telecom" : [{ ContactPoint }] // Contact details for individual or publisher
  }],
  "description" : "<string>", // Natural language description of the profile
  "requirements" : "<string>", // Scope and Usage this structure definition is for
  "copyright" : "<string>", // Use and/or Publishing restrictions
  "code" : [{ Coding }], // Assist with indexing and finding
  "status" : "<code>", // R! draft | active | retired
  "experimental" : <boolean>, // If for testing purposes, not real usage
  "date" : "<dateTime>", // Date for this version of the profile
  "fhirVersion" : "<id>", // FHIR Version this profile targets
  "mapping" : [{ // External specification that the content is mapped to
    "identity" : "<id>", // R! Internal id when this mapping is used
    "uri" : "<uri>", // C? Identifies what this mapping refers to
    "name" : "<string>", // C? Names what this mapping refers to
    "comments" : "<string>" // Versions, Issues, Scope limitations etc
  }],
  "type" : "<code>", // R! abstract | type | resource | constraint | extension
  "contextType" : "<code>", // C? resource | datatype | mapping | extension
  "context" : ["<string>"], // C? Where the extension can be used in instances
  "base" : "<uri>", // C? Structure that this set of constraints applies to
  "snapshot" : { // C? Snapshot view of the structure
    "element" : [{ ElementDefinition }] // C? R! 
      Definition of elements in the resource (if no profile)
  },
  "differential" : { // C? Differential view of the structure
    "element" : [{ ElementDefinition }] // R! 
      Definition of elements in the resource (if no profile)
  }
}

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. StructureDefinition IDomainResourceResource Profile
If the type is 'extension' then the structure must have context information
A structure must have a base unless it’s type is 'abstract'
A structure must have either a differential, or a snapshot (or both)
... url 1..1uriLiteral URL used to reference this profile
... identifier Σ0..*IdentifierOther identifiers for the profile
... version Σ0..1stringLogical id for this version of the profile
... name Σ1..1stringInformal name for this profile
... display 0..1stringUse this name when displaying the value
... publisher Σ0..1stringName of the publisher (Organization or individual)
... contact Σ0..*ElementContact details of the publisher
.... name Σ0..1stringName of a individual to contact
.... telecom Σ0..*ContactPointContact details for individual or publisher
... description Σ0..1stringNatural language description of the profile
... requirements 0..1stringScope and Usage this structure definition is for
... copyright 0..1stringUse and/or Publishing restrictions
... code Σ0..*CodingAssist with indexing and finding
... status M Σ1..1codedraft | active | retired
StructureDefinitionStatus (Required)
... experimental Σ0..1booleanIf for testing purposes, not real usage
... date Σ0..1dateTimeDate for this version of the profile
... fhirVersion Σ0..1idFHIR Version this profile targets
... mapping I0..*ElementExternal specification that the content is mapped to
Must have at a name or a uri (or both)
.... identity 1..1idInternal id when this mapping is used
.... uri I0..1uriIdentifies what this mapping refers to
.... name I0..1stringNames what this mapping refers to
.... comments 0..1stringVersions, Issues, Scope limitations etc
... type 1..1codeabstract | type | resource | constraint | extension
StructureDefinitionType (Required)
... contextType I0..1coderesource | datatype | mapping | extension
ExtensionContext (Required)
... context I0..*stringWhere the extension can be used in instances
... base I0..1uriStructure that this set of constraints applies to
... snapshot I0..1ElementSnapshot view of the structure
Element paths must be unique - or not (LM)
If a structure is a snapshot, then each element definition must have a formal definition, and cardinalities
.... element I1..*ElementDefinitionDefinition of elements in the resource (if no profile)
... differential I0..1ElementDifferential view of the structure
.... element 1..*ElementDefinitionDefinition of elements in the resource (if no profile)

UML Diagram

StructureDefinition (DomainResource)The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systemsurl : uri 1..1Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)identifier : Identifier 0..*The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manuallyversion : string 0..1A free text natural language name identifying the Profilename : string 1..1Defined so that applications can use this name when displaying the value of the extension to the userdisplay : string 0..1The name of the individual or organization that published the structure definitionpublisher : string 0..1A free text natural language description of the profile and its usedescription : string 0..1Explains why this structure definition is needed and why it's been constrained as it hasrequirements : string 0..1A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappingscopyright : string 0..1A set of terms from external terminologies that may be used to assist with indexing and searching of templatescode : Coding 0..*The status of the profile (this element modifies the meaning of other elements)status : code 1..1 « The lifecycle status of a StructureDefinitionStructureDefinitionStatus »This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usageexperimental : boolean 0..1The date that this version of the profile was publisheddate : dateTime 0..1The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.4.0 for this versionfhirVersion : id 0..1Defines the type of structure that this definition is describingtype : code 1..1 « Defines the type of structure that a definition is describingStructureDefinitionType »Identifies the type of context to which the extension appliescontextType : code 0..1 « How an extension context is interpretedExtensionContext »Identifies the types of resource or data type elements to which the extension can be appliedcontext : string 0..*The structure that is the base on which this set of constraints is derived frombase : uri 0..1ContactThe name of an individual to contact regarding the structure definitionname : string 0..1Contact details for individual (if a name was provided) or the publishertelecom : ContactPoint 0..*MappingAn Internal id that is used to identify this mapping set when specific mappings are madeidentity : id 1..1A URI that identifies the specification that this mapping is expressed touri : uri 0..1A name for the specification that is being mapped toname : string 0..1Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usagecomments : string 0..1SnapshotCaptures constraints on each element within the resourceelement : ElementDefinition 1..*DifferentialCaptures constraints on each element within the resourceelement : ElementDefinition 1..*Contacts to assist a user in finding and communicating with the publishercontact0..*An external specification that the content is mapped tomapping0..*A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profilesnapshot0..1A differential view is expressed relative to the base profile - a statement of differences that it appliesdifferential0..1

XML Template

<StructureDefinition xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 1..1 Literal URL used to reference this profile -->
 <identifier><!-- 0..* Identifier Other identifiers for the profile --></identifier>
 <version value="[string]"/><!-- 0..1 Logical id for this version of the profile -->
 <name value="[string]"/><!-- 1..1 Informal name for this profile -->
 <display value="[string]"/><!-- 0..1 Use this name when displaying the value -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (Organization or individual) -->
 <contact>  <!-- 0..* Contact details of the publisher -->
  <name value="[string]"/><!-- 0..1 Name of a individual to contact -->
  <telecom><!-- 0..* ContactPoint Contact details for individual or publisher --></telecom>
 </contact>
 <description value="[string]"/><!-- 0..1 Natural language description of the profile -->
 <requirements value="[string]"/><!-- 0..1 Scope and Usage this structure definition is for -->
 <copyright value="[string]"/><!-- 0..1 Use and/or Publishing restrictions -->
 <code><!-- 0..* Coding Assist with indexing and finding --></code>
 <status value="[code]"/><!-- 1..1 draft | active | retired -->
 <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage -->
 <date value="[dateTime]"/><!-- 0..1 Date for this version of the profile -->
 <fhirVersion value="[id]"/><!-- 0..1 FHIR Version this profile targets -->
 <mapping>  <!-- 0..* External specification that the content is mapped to -->
  <identity value="[id]"/><!-- 1..1 Internal id when this mapping is used -->
  <uri value="[uri]"/><!-- ?? 0..1 Identifies what this mapping refers to -->
  <name value="[string]"/><!-- ?? 0..1 Names what this mapping refers to -->
  <comments value="[string]"/><!-- 0..1 Versions, Issues, Scope limitations etc -->
 </mapping>
 <type value="[code]"/><!-- 1..1 abstract | type | resource | constraint | extension -->
 <contextType value="[code]"/><!-- ?? 0..1 resource | datatype | mapping | extension -->
 <context value="[string]"/><!-- ?? 0..* Where the extension can be used in instances -->
 <base value="[uri]"/><!-- ?? 0..1 Structure that this set of constraints applies to -->
 <snapshot>  <!-- ?? 0..1 Snapshot view of the structure -->
  <element><!-- ?? 1..* ElementDefinition 
      Definition of elements in the resource (if no profile) --></element>
 </snapshot>
 <differential>  <!-- ?? 0..1 Differential view of the structure -->
  <element><!-- 1..* ElementDefinition 
      Definition of elements in the resource (if no profile) --></element>
 </differential>
</StructureDefinition>

JSON Template

{doco
  "resourceType" : "StructureDefinition",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // R! Literal URL used to reference this profile
  "identifier" : [{ Identifier }], // Other identifiers for the profile
  "version" : "<string>", // Logical id for this version of the profile
  "name" : "<string>", // R! Informal name for this profile
  "display" : "<string>", // Use this name when displaying the value
  "publisher" : "<string>", // Name of the publisher (Organization or individual)
  "contact" : [{ // Contact details of the publisher
    "name" : "<string>", // Name of a individual to contact
    "telecom" : [{ ContactPoint }] // Contact details for individual or publisher
  }],
  "description" : "<string>", // Natural language description of the profile
  "requirements" : "<string>", // Scope and Usage this structure definition is for
  "copyright" : "<string>", // Use and/or Publishing restrictions
  "code" : [{ Coding }], // Assist with indexing and finding
  "status" : "<code>", // R! draft | active | retired
  "experimental" : <boolean>, // If for testing purposes, not real usage
  "date" : "<dateTime>", // Date for this version of the profile
  "fhirVersion" : "<id>", // FHIR Version this profile targets
  "mapping" : [{ // External specification that the content is mapped to
    "identity" : "<id>", // R! Internal id when this mapping is used
    "uri" : "<uri>", // C? Identifies what this mapping refers to
    "name" : "<string>", // C? Names what this mapping refers to
    "comments" : "<string>" // Versions, Issues, Scope limitations etc
  }],
  "type" : "<code>", // R! abstract | type | resource | constraint | extension
  "contextType" : "<code>", // C? resource | datatype | mapping | extension
  "context" : ["<string>"], // C? Where the extension can be used in instances
  "base" : "<uri>", // C? Structure that this set of constraints applies to
  "snapshot" : { // C? Snapshot view of the structure
    "element" : [{ ElementDefinition }] // C? R! 
      Definition of elements in the resource (if no profile)
  },
  "differential" : { // C? Differential view of the structure
    "element" : [{ ElementDefinition }] // R! 
      Definition of elements in the resource (if no profile)
  }
}

 

Alternate definitions: Schema/Schematron, Resource Profile (XML, JSON), Questionnaire

6.18.4.1 Terminology Bindings

PathDefinitionTypeReference
StructureDefinition.status The lifecycle status of a StructureDefinitionFixedhttp://hl7.org/fhir/structure-definition-status
StructureDefinition.type Defines the type of structure that a definition is describingFixedhttp://hl7.org/fhir/structure-definition-type
StructureDefinition.contextType How an extension context is interpretedFixedhttp://hl7.org/fhir/extension-context

6.18.4.2 Constraints

  • sdf-1: On StructureDefinition.snapshot: Element paths must be unique - or not (LM) (xpath on f:StructureDefinition/f:snapshot: count(f:element) >= count(distinct-values(f:element/f:path/@value)))
  • sdf-2: On StructureDefinition.mapping: Must have at a name or a uri (or both) (xpath on f:StructureDefinition/f:mapping: exists(f:uri) or exists(f:name))
  • sdf-3: On StructureDefinition.snapshot: If a structure is a snapshot, then each element definition must have a formal definition, and cardinalities (xpath on f:StructureDefinition/f:snapshot: exists(f:base) or (count(f:element) = count(f:element[exists(f:formal) and exists(f:min) and exists(f:max)])))
  • sdf-4: A structure must have a base unless it’s type is 'abstract' (xpath: (f:type/@value = 'abstract') or f:base)
  • sdf-5: If the type is 'extension' then the structure must have context information (xpath: not(f:type/@value = 'extension') or (f:context and f:contextType))
  • sdf-6: A structure must have either a differential, or a snapshot (or both) (xpath: f:snapshot or f:differential)

6.18.5 Interpretation Notes:

  • A structure is represented as a flat list of elements. The element.path provides the overall structure.
  • element.short, element.formal, element.comments and element.mapping provide the specific definition for the field in a specific context.
  • element.type is used to specify which types may be used for this element. If there is more than one type, the element offers a choice of types and must have a name that terminates in "[x]". Names of elements that are choices retain the "[x]" in the name, even if a constraint on such an element limits the number of allowed types down to one.
  • When using xpath to make constraints about the relationship between the contents of the narrative and the contents of the data elements, the element against which the rule is expressed is the one against which the error or warning will be reported by a validator.
  • When xpath constraints refer to elements that offer a choice of types, the statement must use the fully expanded name (including the actual type), not the name ending in "[x]".
  • For xpath constraints, the prefix "f" should be used for "http://hl7.org/fhir", and "h" for "http://www.w3.org/1999/xhtml". XPath constraints are written against the XML representation, but the rules they describe SHALL be true in any other representation as well
  • The condition element is used to assert that a constraint defined on another element affects the allowed cardinality of this element.

6.18.5.1 Different types of Structure

StructureDefinition.type indicates what kind of structure is being defined. There are 5 kinds of structures:

  1. abstract: "Abstract type" - one of the underlying base types defined as part of the specification (e.g. Resource)
  2. type: "Data Type" - a primitive or complex structure that defines a set of data elements, most of which are defined in the Data Types section
  3. resource: "Resource" - A resource defined by the FHIR specification (see the resource list)
  4. constraint: "Constrained Type" - A set of constraints on a resource or data type that describe how it is used for a particular use
  5. extension: "Extension Definition" - A definition of an extension that can be used in a FHIR resource (or a set of constraints on an exsting extension)

The first 3 types can only be defined by the FHIR specification. Types 4 and 5 are used in profiles and implementation guides, and may be published by any implementer of the specification.

6.18.5.2 Rules for Constrained Types

When the type of a structure definition is either a "constraint" or an "extension", then the following rules apply:

  • The structure must nominate a base resource from which it is derived
  • The structure definition cannot introduce any new elements or value domains that are not valid in the structure - e.g. the structure must be a true constraint, and anything that meets the description of this structure must also be valid following the description of the base structure
  • In practice, this means that:
    • no new paths may be introduced that are not found in the base structure
    • the list of types for an element must be the same or a subset of the list of types for the same element in the base structure
    • The definition can be changed in the derived structure, but it must still be logically consistent with the definition in the base. e.g. the base element may be defined as "Result value" and this structure could define it as "Plasma Cholesterol Test Value", but not "Result status".
    • The cardinality must be a subset of the allowable cardinality in the base structure i.e. the minumum must be >= the base minimum, and the maximum must be <= the base maximum
  • Note that because of slicing, there can be more than element for the same path. For details, see Profiling resources

6.18.5.3 Common Mapping Targets

Structures are able to map elements to concepts in other definition systems. Generally these are used to map the elements to local implementation models, data paths, and concepts. However they are also used to map to other standards and published terminologies. These are the standard URIs used for common targets of the mapping:

http://loinc.orgLOINC code for the element
http://snomed.infoSNOMED CT code for the element
http://hl7.org/v3RIM mapping
http://hl7.org/v2v2 mapping
http://nema.org/dicomDICOM tag mapping
http://w3.org/vcardvCard equivalent field
http://ihe.net/xdsXDS metadata equivalent

6.18.6 Search Parameters

Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

NameTypeDescriptionPaths
codetokenA code for the profileStructureDefinition.code
datedateThe profile publication dateStructureDefinition.date
descriptionstringText search in the description of the profileStructureDefinition.description
identifiertokenThe identifier of the profileStructureDefinition.identifier
namestringName of the profileStructureDefinition.name
pathtokenA path that is constrained in the profileStructureDefinition.snapshot.element.path, StructureDefinition.differential.element.path
publisherstringName of the publisher of the profileStructureDefinition.publisher
statustokenThe current status of the profileStructureDefinition.status
typetokenabstract | type | resource | constraint | extensionStructureDefinition.type
urltokenLiteral URL used to reference this profileStructureDefinition.url
valuesetreferenceA vocabulary binding codeStructureDefinition.snapshot.element.binding.reference[x]
(ValueSet)
versiontokenThe version identifier of the profileStructureDefinition.version