FHIR Extensions
This tutorial describes how to create and use an extension in FHIR.
- Create a new template/profile for the extension
- Select the “Extension” for the “Applies To” field
- Create a constraint for the “@url” attribute with a single-value binding of the same URL as the template/profile’s “Long ID” (ex: “http://hl7.org/fhir/us/ccda/StructureDefinition/CCDA-on-FHIR-Authorization”)
- Create a constraint for the “value[x]” choice. On this constraint, I suggest selecting “SHALL” and “1..1” for the conformance and cardinality, because an optional value[x] would not provide much value in an extension, and may not even be valid according to FHIR
- Create a constraint for *one* of the “value[x]” choice options (ex: “valueString”)
- In the template/profile where you want to use the extension:
- Create a constraint for the “extension” element
- Select the extension template/profile created in step 1 (above) as a contained template
- Select that the “extension” constraint is a branch/slice “root” if this template/profile might have multiple extensions. Otherwise, this will be the only extension that can be used in the template/profile.