First-Class Extensions using Zen
First-class extension as Zen profile
Since the 2405 release, using Aidbox in FHIRSchema mode is recommended, which is incompatible with zen or Entity/Attribute options.
While FHIR uses two different ways to define core elements and extensions, zen profiles provide a unified framework to describe both. Zen FHIR format offers user-defined elements or "first-class extensions". In zen profiles, you can define new attributes (elements) for existing (FHIR) resources. The example below shows how to define extensions in zen profiles.
Note that extension elements have :confirms
to a FHIR primitive or complex type specified. Previously these were specified in the base profile schema. These :confirms
and the :fhir/extensionUri
are needed to allow zen FHIR <-> FHIR format transformation.
Steps to define first-class extension as zen profile:
Initialize zen project and add additional IGs if necessary.
Define your custom first-class extension. For syntax and more examples refer to this page.
Fix
:zen.fhir/version
errors if neededTo fix this error, provide IG bundle with the matching zen FHIR version.
Error message example:
Define
:fhir/extensionUri
property value.:fhir/extensionUri
"http://tenant-id-extension-url" is an equivalent of theextensionUrl
field of the Attribute resource and is used to form FHIR extension.Replace plain zen type with FHIR type in your extensions. I.e. use
:confirms #{hl7-fhir-r4-core.string/schema}
instead of:type zen/string
.
Last updated