Re-usable Extensions

Trifolia supports re-usable extensions for FHIR DSTU2 implementation guides and profiles.

Creating a Re-usable Extension

  1. Create a new profile in a FHIR DSTU2 implementation guide.
  2. Select FHIR DSTU2: Extension for the "type" of profile.
    1. Note that the Applies To button is disabled for Extension profiles.
    2. After selecting Extension as the type of profile, a constraint is automatically created by Trifolia for the "@url" attribute and matches the identifier specified for the extension. Any time the identifier is updated, the constraint will automatically be updated as well.
  3. Define a constraint for the type of value your extension will require (such as "valueCodeableConcept").
  4. Save the profile.


Trifolia treats all profiles that are of type FHIR DSTU2: Extension as re-usable extensions. The behavior of Trifolia's template/profile editor adjusts slightly (such as disabling the Applies To selection button, and automatically adding a @url constraint) to account for requirements in the core FHIR DSTU2 standard when editing extension profiles.

Using a Pre-defined Extension

  1. Open any FHIR DSTU2 profile.
  2. In the constraint editor, select an "extension" element that does NOT already have a constraint defined for it.
  3. A drop-down list shows in the constraint editor panel that provides a list of all extensions for which you have permissions.
  4. Select the extension you want to add to the profile and select the "+" (add) button.
  5. The "extension" element is turned into a constraint, and automatically creates constraints for each of the constraints defined in the extension.
  6. The "extension" element itself should be marked as a slice and the @url constraint within the extension should be marked as a descriminator. The conformance and cardinality is set to "SHALL 1..1" for the new extension constraint, as well as the @url descriminator.

Profile Extensions

The profile may define extensions in addition to the constraints. These are extensions that add information to the profile as a whole, but are not required to be implemented where the profile is used/asserted.

Both FHIR DSTU1 and FHIR DSTU2 profiles support extensions on the profile.

Adding Extensions to a Profile

  1. Edit any FHIR profile.
  2. The bottom entry in the Extensions panel of the Template/Profile tab always represents a "new" extension.
  3. Fill in the identifier, type, and value of the extension (all three fields are required).
  4. Select the Add button to the right of the fields.
  5. The extension is now added to the profile, and the profile can be saved. The extension added may be edited, but the type of the extension may not be changed; only the identifier and the value may be changed after extension is added.


Note: A future version of Trifolia will incorporate re-usable extensions in the profile extensions.