FHIR Chat · question about extension syntax · shorthand

Stream: shorthand

Topic: question about extension syntax


view this post on Zulip Eric Haas (Apr 23 2020 at 20:14):

I reread the IG and looked at my example but can not extend this to the followiing example:

Profile:        TestSupplyRequest
Parent:         SupplyRequest
Id:             test
Title:          "Test Supply Request"
Description:    "A profile to test implementation of R5 elements"
* item.extension contains DevDef named devdef 0..1

Extension:  DevDef
Id: devdef
Title: "DeviceDefinition Reference Extension"
Description: "A reference to the [DeviceDefinition](http://build.fhir.org/devicedefinition.html) resource"
* value[x] only Reference(DeviceDefinition)

I get the following errors:

 File: /Users/ehaas/Documents/FHIR/FSH-Tut/fsh-tutorial-master/FishExample/FishPatient.fsh
  Line: 15
error No element found at path item.extension for TestSupplyRequest, skipping rule
  File: /Users/ehaas/Documents/FHIR/FSH-Tut/fsh-tutorial-master/FishExample/SRTest.fsh
  Line: 7
error No element found at path item.extension[devdef] for TestSupplyRequest, skipping rule
  File: /Users/ehaas/Documents/FHIR/FSH-Tut/fsh-tutorial-master/FishExample/SRTest.fsh
  Line: 7

The Extension created looks valid. so I don't understand the extension syntax.
Obviousy, I don't understand the syntax for extensions

view this post on Zulip Eric Haas (Apr 23 2020 at 20:25):

Running SUSHI v0.12.2

view this post on Zulip Chris Moesel (Apr 23 2020 at 21:20):

I think the first issue is that you're trying to use R5 definitions, but SUSHI currently only supports R4. In R4, SupplyRequest has item[x], not item. In theory, you could fix your FSH to use this rule instead:

* item[x].extension contains DevDef named devdef 0..1

I say "in theory" because someone else just discovered a bug that SUSHI isn't handling child paths of choice ([x]) elements correctly. (See thread). So while in theory referencing item[x].extension should work, in practice it does not.

view this post on Zulip Chris Moesel (Apr 23 2020 at 21:22):

To get around that right now, you'd actually have to apply the extension explicitly to each possible choice element (or to at least the choices you want to support the extension). E.g.,

* itemCodeableConcept.extension contains DevDef named devdef 0..1
* itemReference.extension contains DevDef named devdef 0..1

Last updated: Apr 12 2022 at 19:14 UTC