SUSHI doesn't handle @default slice correctly
- Dominant language
- TypeScript
- Stars
- 188
- Forks
- 64
- Avg merge
- 8d 11h
- Merged PRs (30d)
- 3
Description
In FHIR, you can name a slice `@default` to catch all entries that don't fit into any other defined slice. FHIR defines [special rules for the @default slice](http://hl7.org/fhir/R4/profiling.html#default-slice), including:
* Default slices are only allowed when the slicing rule = closed
* Default slices must not fix the value of the discriminator elements
SUSHI does not treat `@default` slices any different than other slices. ~As a result, SUSHI will log an error when the discriminator type is `#value` or `#pattern` but the `@default` slice doesn't fix a value at the discriminator path. Since `@default` isn't _allowed_ to fix a value there, SUSHI should not log an error when it's not fixed. (In fact, I guess it should log an error when it _is_ fixed!)~ _EDIT: Re-reading the reported issue, it sounds like SUSHI actually doesn't log the error; it's the IG Publisher. So perhaps there is nothing to do here, but we probably should still investigate. We could potentially issue an error when the `@default` slice is used in an `#open` slicing and/or when an author fixes a value on the discriminator path in the `@default` slice._
It appears that the IG Publisher actually doesn't properly support `@default` slices either.
See: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/.40default.20slice/near/281210691
Contributor guide
Research direction
Start by reproducing the reported @default slicing cases described in the issue, including closed and open slicing and discriminator paths using #value or #pattern. Compare SUSHI's diagnostics and generated output with the IG Publisher behavior. Done means the supported FHIR rules are clearly handled or the investigation documents that the issue belongs elsewhere.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100