FHIR Chat · referencing a standard exttension · shorthand

Stream: shorthand

Topic: referencing a standard exttension


view this post on Zulip Catherine Hosage Norman (Feb 09 2022 at 22:45):

What is the syntax for referencing a standard extension? Example https://build.fhir.org/extension-medication-manufacturingbatch.html.

view this post on Zulip Chris Moesel (Feb 10 2022 at 00:06):

It depends on if you want to reference it in a profile or an instance. For the examples below, we'll assume the following alias is defined (referencing the canonical of the extension you linked above):

Alias: $MFGBatch = http://hl7.org/fhir/StructureDefinition/medication-manufacturingBatch

If you want to specify this extension in a profile, you would do something like this:

Profile: MyMedicationProfile
Parent: Medication
* batch.extension contains $MFGBatch named batch 0..1

If you want to use this extension in an instance, you would do something like this:

Instance: MyMedicationInstance
InstanceOf: Medication
* batch.extension[$MFGBatch].extension[manufacturingDate].valueDateTime = "2022-02-09"
* batch.extension[$MFGBatch].extension[additionalInformation].valueString = "This was a great batch."

or if you prefer the indented rule syntax introduced in FSH STU2:

Instance: MyMedicationInstance
InstanceOf: Medication
* batch.extension[$MFGBatch]
  * extension[manufacturingDate]
    * valueDateTime = "2022-02-09"
  * extension[additionalInformation]
    * valueString = "This was a great batch."

Of course all of these assume you've set fhirVersion to 5.0.0-snapshot1 (or some other version in which this extension is actually defined).

view this post on Zulip Chris Moesel (Feb 10 2022 at 00:08):

The bit about specifying extensions in profiles is described in the spec here: http://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#contains-rules-for-extensions

view this post on Zulip Chris Moesel (Feb 10 2022 at 00:11):

The bit about using extensions in instances is described in the spec here (although it does not use aliases): http://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#extension-paths

view this post on Zulip Catherine Hosage Norman (Feb 13 2022 at 23:59):

I was wanting the syntax for profiling a standard extension. I was fishing around on fsh-finder and found Primary Care Practice-to-Practice had an example in medication-resources.fsh.


Last updated: Apr 12 2022 at 19:14 UTC