FHIR Chat · Sushi not defaulting to open slicing rules · shorthand

Stream: shorthand

Topic: Sushi not defaulting to open slicing rules


view this post on Zulip Yannick Börner (Jul 05 2021 at 05:43):

Good morning everyone! While using SUSHI v2.0.0-beta.1 and converting the snippet below, I had to explicitly set the section's slicing rules as Sushi did not default them to 'open':

Profile: CompositionFehlernachricht
Parent: Composition
Id: CompositionFehlernachricht
* meta 1.. MS
* meta.profile 1..1 MS
* meta.profile = "profile"
* extension contains Emp named Emp 1..1 MS
* extension contains Abs named Abs 1..1 MS
* extension contains Ver named Ver 1..1 MS
* extension[Ver]
  * extension[Verc].valueCoding = Vercs#FEHL
* identifier 1.. MS
* identifier ^short = "Verid"
* identifier.system = "verid"
* status = #final (exactly)
* status MS
* type MS
* type.coding 1.. MS
* type.coding = Nac#FEHL "Feh"
* subject 1.. MS
* subject only Reference(Vers)
* date MS
* date ^short = "Erstellungsdatum"
* author 1..1 MS
  * display 1..1 MS
* title = "Vers title" (exactly)
* title MS
* title ^short = "Dok (=Versp)"
* section ^slicing.discriminator.type = #pattern
* section ^slicing.discriminator.path = "$this"
* section ^slicing.rules = #open
* section contains
    Fehl 1..1 MS
* section[Fehl]
  * title 1..1 MS
  * title = "Fehl"
  * entry 1..1 MS
  * entry only Reference(Fehl)

I was under the assumption that if nothing is specified with regards to the slicing rule element, Sushi would simply default it to 'open' (as it does in other projects) but this does not seem to be the case here. Another Composition in the input was affected as well. Is this a feature or a bug?

view this post on Zulip Nick Freiter (Jul 06 2021 at 13:12):

Is it possible that the other cases where SUSHI defaults to open were slicing on extension elements? Generally SUSHI should require the slicing.rules to be specified. However, in the case of extension, SUSHI does default the slicing.rules to open. Is it also possile that in these other examples the element being sliced was inheriting from a parent element that already had slicing.rules specified?

view this post on Zulip Yannick Börner (Jul 13 2021 at 06:23):

Nick Freiter said:

Is it possible that the other cases where SUSHI defaults to open were slicing on extension elements? Generally SUSHI should require the slicing.rules to be specified. However, in the case of extension, SUSHI does default the slicing.rules to open. Is it also possile that in these other examples the element being sliced was inheriting from a parent element that already had slicing.rules specified?

Hi Nick, sorry for getting back to you so late. They were actually slicing on the telecom element and not extension elements. The latter required me to specifically define the rules. Unfortunately I can not confirm the second question, those were standalone elements without any inheritance. I'll keep this in mind for my next FSH session and try to find some patterns in this behavior so that I can get back to you with something more tangible. Thank you so much for your input!

view this post on Zulip Simone Heckmann (Jul 16 2021 at 10:26):

I think the part that's confusing here is that a missing slicing rule doesn't show up as an error in SUSHI. It isn't until you run validation, that the issue becomes apparent.

view this post on Zulip Simone Heckmann (Jul 16 2021 at 10:27):

IMO, in case of a missing rule SUSHI should either default or report an error.

view this post on Zulip Chris Moesel (Jul 20 2021 at 16:52):

That's a fair request @Simone Heckmann. I've filed SUSHI#885 for it. Thanks!


Last updated: Apr 12 2022 at 19:14 UTC