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
This resource maintained by the FHIR Management Group Work Group
Defines an extension that can be used in resources.
The Extension Definition resource provides a formal definition of an extension used in a FHIR resource, that can used as the basis for validation, and code, report and UI generation.
Whenever resources containing extensions are exchanged, the definitions of the extensions SHALL be available to all the parties that share the resources. Each extension contains a URI that references the source of the definitions as a Resource Profile. The source SHOULD be a literal reference, such as an http: url that refers to an end-point that responds with the contents of the definitions - preferably a FHIR RESTful server supporting the Resources Profile, or a logical reference (e.g. using a urn:) - for instance, to a national published standard.
Extensions may be defined by any project or jurisdiction, up to and including international standards organizations such as HL7 itself. Extensions are always defined against some particular context - the type of element that they may be used to extend. The following are possible contexts for an extension:
Context type | Context format | Examples |
---|---|---|
A particular element (including the root) in a single resource | The element path for that element Note: If the context is an element that can have multiple types, then use (e.g.) value[x] if the extension works on all choice types, or otherwise an enumeration of explicitly named elements if not | Profile.resource.element; Person |
A particular element (including the root) in a particular data type | The data type name for primitive types or the element path for complex data types | Address.part.value; string |
A particular context in one of the mapped reference models | The name of the reference model followed by the mapping path | RIM: Act[moodCode="EVN"] |
Another extension | The profile uri of the extension followed by the extension code | http://myextensions.org#someExtension |
A set of some combination of the above | As above, separated by ';' | Address; Contact |
In addition, an extension definition might apply additional constraints with regards to particular element values of the target that make its use appropriate. Extensions SHALL only be used on a target for which they are defined.
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
ExtensionDefinition | I | DomainResource | Extension Definition All element names must start with the extension name | |
url | 1..1 | uri | Literal URL used to reference this extension | |
identifier | Σ | 0..* | Identifier | Other identifiers for the extension |
version | Σ | 0..1 | string | Logical id for this version of the extension |
name | Σ | 1..1 | string | Descriptional name for this profile |
display | 0..1 | string | Use this name when displaying the value | |
publisher | Σ | 0..1 | string | Name of the publisher (Organization or individual) |
contact | Σ | 0..* | Element | Contact details of the publisher |
name | Σ | 0..1 | string | Name of a individual to contact |
telecom | Σ | 0..* | ContactPoint | Contact details for individual or publisher |
description | Σ | 0..1 | string | Natural language description of the extension |
code | Σ | 0..* | Coding | Assist with indexing and finding |
status | M Σ | 1..1 | code | draft | active | retired ResourceProfileStatus (Required) |
experimental | Σ | 0..1 | boolean | If for testing purposes, not real usage |
date | Σ | 0..1 | dateTime | Date for this version of the extension |
requirements | 0..1 | string | Scope and Usage this extesion is for | |
mapping | I | 0..* | Element | External specification that the content is mapped to Must have at a name or a uri (or both) |
identity | 1..1 | id | Internal id when this mapping is used | |
uri | I | 0..1 | uri | Identifies what this mapping refers to |
name | I | 0..1 | string | Names what this mapping refers to |
comments | 0..1 | string | Versions, Issues, Scope limitations etc | |
contextType | 1..1 | code | resource | datatype | mapping | extension ExtensionContext (Required) | |
context | 1..* | string | Where the extension can be used in instances | |
element | I | 1..* | ElementDefinition | Definition of the elements in the extension Path names cannot contain .value |
UML Diagram
XML Template
<ExtensionDefinition xmlns="http://hl7.org/fhir"> <!-- 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 extension --> <identifier><!-- 0..* Identifier Other identifiers for the extension --></identifier> <version value="[string]"/><!-- 0..1 Logical id for this version of the extension --> <name value="[string]"/><!-- 1..1 Descriptional 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 extension --> <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 extension --> <requirements value="[string]"/><!-- 0..1 Scope and Usage this extesion is for --> <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> <contextType value="[code]"/><!-- 1..1 resource | datatype | mapping | extension --> <context value="[string]"/><!-- 1..* Where the extension can be used in instances --> <element><!-- 1..* ElementDefinition Definition of the elements in the extension --></element> </ExtensionDefinition>
JSON Template
{ "resourceType" : "ExtensionDefinition", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "url" : "<uri>", // R! Literal URL used to reference this extension "identifier" : [{ Identifier }], // Other identifiers for the extension "version" : "<string>", // Logical id for this version of the extension "name" : "<string>", // R! Descriptional 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 extension "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 extension "requirements" : "<string>", // Scope and Usage this extesion is for "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 }], "contextType" : "<code>", // R! resource | datatype | mapping | extension "context" : ["<string>"], // R! Where the extension can be used in instances "element" : [{ ElementDefinition }] // C? R! Definition of the elements in the extension }
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
ExtensionDefinition | I | DomainResource | Extension Definition All element names must start with the extension name | |
url | 1..1 | uri | Literal URL used to reference this extension | |
identifier | Σ | 0..* | Identifier | Other identifiers for the extension |
version | Σ | 0..1 | string | Logical id for this version of the extension |
name | Σ | 1..1 | string | Descriptional name for this profile |
display | 0..1 | string | Use this name when displaying the value | |
publisher | Σ | 0..1 | string | Name of the publisher (Organization or individual) |
contact | Σ | 0..* | Element | Contact details of the publisher |
name | Σ | 0..1 | string | Name of a individual to contact |
telecom | Σ | 0..* | ContactPoint | Contact details for individual or publisher |
description | Σ | 0..1 | string | Natural language description of the extension |
code | Σ | 0..* | Coding | Assist with indexing and finding |
status | M Σ | 1..1 | code | draft | active | retired ResourceProfileStatus (Required) |
experimental | Σ | 0..1 | boolean | If for testing purposes, not real usage |
date | Σ | 0..1 | dateTime | Date for this version of the extension |
requirements | 0..1 | string | Scope and Usage this extesion is for | |
mapping | I | 0..* | Element | External specification that the content is mapped to Must have at a name or a uri (or both) |
identity | 1..1 | id | Internal id when this mapping is used | |
uri | I | 0..1 | uri | Identifies what this mapping refers to |
name | I | 0..1 | string | Names what this mapping refers to |
comments | 0..1 | string | Versions, Issues, Scope limitations etc | |
contextType | 1..1 | code | resource | datatype | mapping | extension ExtensionContext (Required) | |
context | 1..* | string | Where the extension can be used in instances | |
element | I | 1..* | ElementDefinition | Definition of the elements in the extension Path names cannot contain .value |
XML Template
<ExtensionDefinition xmlns="http://hl7.org/fhir"> <!-- 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 extension --> <identifier><!-- 0..* Identifier Other identifiers for the extension --></identifier> <version value="[string]"/><!-- 0..1 Logical id for this version of the extension --> <name value="[string]"/><!-- 1..1 Descriptional 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 extension --> <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 extension --> <requirements value="[string]"/><!-- 0..1 Scope and Usage this extesion is for --> <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> <contextType value="[code]"/><!-- 1..1 resource | datatype | mapping | extension --> <context value="[string]"/><!-- 1..* Where the extension can be used in instances --> <element><!-- 1..* ElementDefinition Definition of the elements in the extension --></element> </ExtensionDefinition>
JSON Template
{ "resourceType" : "ExtensionDefinition", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "url" : "<uri>", // R! Literal URL used to reference this extension "identifier" : [{ Identifier }], // Other identifiers for the extension "version" : "<string>", // Logical id for this version of the extension "name" : "<string>", // R! Descriptional 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 extension "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 extension "requirements" : "<string>", // Scope and Usage this extesion is for "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 }], "contextType" : "<code>", // R! resource | datatype | mapping | extension "context" : ["<string>"], // R! Where the extension can be used in instances "element" : [{ ElementDefinition }] // C? R! Definition of the elements in the extension }
Alternate definitions: Schema/Schematron, Resource Profile (XML, JSON), Questionnaire
Path | Definition | Type | Reference |
---|---|---|---|
ExtensionDefinition.status | The lifecycle status of a Resource Profile | Fixed | http://hl7.org/fhir/resource-profile-status |
ExtensionDefinition.contextType | How an extension context is interpreted | Fixed | http://hl7.org/fhir/extension-context |
As well as defining the base element structure for resources, HL7 also publishes extensions. HL7 publishes such data definitions as extensions rather than as part of the base resource structure in order to keep the base resource structure simple and concise, and to allow implementers not to engage with an entire world's worth of functionality up front. Note that HL7 does not define "modifier" extensions - if HL7 publishes an element that modifies the meaning of other elements, it will be part of the resource content itself, since everyone has to understand the extension anyway.
Before extensions can be used in instances, their definition SHALL be published. HL7 maintains two extension registries:
Users are encouraged to register their extensions in the second registry, though this is not required. All that is required is that the extension is published in a context that is available for users of the extension. So, for example, if a particular extension is used within a single institution, the definition of the extension can be placed on the institution's intranet. However since, by their nature, resources tend to travel well, it's always better to use the HL7 or other publicly accessible extension registries.
HL7 extension definition registries.
Registry | Search | Submit |
---|---|---|
HL7 Approved | [TBD] | [TBD] |
Community | [TBD] | [TBD] |
Interim | http://fhir-dev.healthintersections.com.au/open/ExtensionDefinition/_search | http://fhir.healthintersections.com.au/open/ExtensionDefinition/upload |
HL7 extension definitions may be balloted alongside resource content as part of the FHIR specification or may be published as part of separate specifications. When HL7 publishes extension definitions as part of the FHIR specification, these extensions SHALL be used for this data whenever the data is represented in instances. Applications SHOULD use other HL7-defined extensions published to represent equivalent data in the interest of maximum interoperability.
To minimize complexity for implementers, HL7 will not elevate content defined in an HL7-approved extension to be content defined in a core resource in future versions of the resource once that resource is normative.
In some cases, an HL7 work group or other body may publish a profile whose sole purpose is to define extensions expected to be needed by implementers in a particular context. E.g. extensions needed to map a particular set of v2 segments or a v3 model.
Implementations are encouraged to share their extensions with HL7 and register them with the HL7 extension registry. The domain committees will work to elevate the extensions into HL7 published extensions or, if adopted by a broad enough portion of the implementer community, the into the base resource structure itself.
To avoid interoperability issues, extensions SHALL NOT change their definition once published. (Small clarifications to descriptions that do not affect interoperability are permitted.) Rather than modifying an existing extension, a new extension should be introduced. Revisions to an extension may extend the set of contexts in which the extension apply but may not remove or constrain any context previously listed
Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.
Name | Type | Description | Paths |
code | token | Assist with indexing and finding | ExtensionDefinition.code |
date | date | Date for this version of the extension | ExtensionDefinition.date |
description | string | Natural language description of the extension | ExtensionDefinition.description |
identifier | token | Other identifiers for the extension | ExtensionDefinition.identifier |
name | string | Descriptional name for this profile | ExtensionDefinition.name |
publisher | string | Name of the publisher (Organization or individual) | ExtensionDefinition.publisher |
status | token | draft | active | retired | ExtensionDefinition.status |
url | token | Literal URL used to reference this extension | ExtensionDefinition.url |
valueset | reference | Source of value set | ExtensionDefinition.element.binding.reference[x] (ValueSet) |