FHIR Chat · unsupported rule · shorthand

Stream: shorthand

Topic: unsupported rule


view this post on Zulip David Hay (Dec 13 2019 at 01:26):

Getting this error (note lack of spaces)

warn: Unsupported rule: *identifiercontainsHPI0..1MS

from this file

Profile:        HPIPractitioner
Parent:         Practitioner
Id:             hpi-practitioner
Title:          "HPI Practitioner"
Description:    "The practitioner exposed by the HPI."
* identifier contains HPI 0..1 MS
* identifier 1..*
* identifier[HPI].system = "https://standards.digital.health.nz/id/hpi-person"
* name 1..*
* name.family 1..1

view this post on Zulip David Hay (Dec 13 2019 at 01:46):

updated sushi and the errors are slightly different...

error: Cannot create HPI slice. No slicing found for Practitioner.identifier.
  File: /Users/davidhay/clinfhir/sushi/samples/HPIPractitioner.fsh
  Line: 7
error: No element found at path identifier[HPI] for HPIPractitioner, skipping rule
  File: /Users/davidhay/clinfhir/sushi/samples/HPIPractitioner.fsh
  Line: 7
error: No element found at path identifier[HPI] for HPIPractitioner, skipping rule
  File: /Users/davidhay/clinfhir/sushi/samples/HPIPractitioner.fsh
  Line: 7
error: No element found at path identifier[HPI].system for HPIPractitioner, skipping rule
  File: /Users/davidhay/clinfhir/sushi/samples/HPIPractitioner.fsh
  Line: 10

view this post on Zulip Chris Moesel (Dec 13 2019 at 13:34):

In the current version of SUSHI, we have not implemented "Ginzu" slicing yet. This means that we cannot infer slicing discriminators. You need to set them yourself. If you try to add a slice to an element that doesn't have a discriminator defined, you'll get that first error. The next three errors are because creating that slice failed (due to no discriminator) -- so attempting to reference it will fail as well.

view this post on Zulip Chris Moesel (Dec 13 2019 at 13:39):

You should be able to setup the discriminator in your above example using a syntax like this:

* identifier ^slicing.discriminator[0].type = #value
* identifier ^slicing.discriminator[0].path = "system"
* identifier ^slicing.ordered = false
* identifier ^slicing.rules = #open

... and you should do it before you use the contains rule to add the HPI slice.

view this post on Zulip David Hay (Dec 14 2019 at 04:32):

Thanks! Figured that the first one was the root cause - but I copied the file from the docs and didn't realize that it wasn't supported yet...

view this post on Zulip Mark Kramer (Dec 16 2019 at 12:43):

@David Hay I think two things are going on, related to the early phase of development of SUSHI...
(1) Auto-slicing is not yet implemented. Therefore, you need to specify the slicing using the caret (escape) syntax:

* extension ^slicing.discriminator.type = #value
* extension ^slicing.discriminator.path = "url"

(This is an example for slicing an extension, which will no longer be necessary after 0.4 release, I'm told).

(2) The error "No element found at path" is something @Nick Freiter is looking into now. We think it should be working, and it is just a bug.

view this post on Zulip Chris Moesel (Dec 16 2019 at 14:12):

@Nick Freiter - The "No element found at path" is expected since the rule that introduced the slice failed (therefore there the reference to the failed slice won't find anything).

view this post on Zulip Nick Freiter (Dec 16 2019 at 14:19):

I think you are correct Chris. Mark has also found a bug with slicing that I am looking at now which can cause "No element found at path", but I don't believe that bug should be an issue in this case.

view this post on Zulip Mika Tuomainen (Aug 23 2020 at 18:59):

Chris Moesel said:

You should be able to setup the discriminator in your above example using a syntax like this:

* identifier ^slicing.discriminator[0].type = #value
* identifier ^slicing.discriminator[0].path = "system"
* identifier ^slicing.ordered = false
* identifier ^slicing.rules = #open

... and you should do it before you use the contains rule to add the HPI slice.

Hi,

I have done some testing how to do slicing with Shorthand. I got the same error as the first writer (David) of this thread. I have done testing with examples found here (http://build.fhir.org/ig/HL7/fhir-shorthand/index.html) and also in Shorthand tutorial slides. I found the reason for this error when Grahame pointed this #shorthand stream and found the Chris's answer. I think it could be useful to instruct slicing order here: http://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#contains-rules-for-slicing. Now there it reads: "In FSH, slicing is addressed in three steps: (1) identifying the slices, (2) defining each slice’s contents, and (3) specifying the slicing logic.". Maybe the firs step should be "specifying the slicing logic". And also in tutorial slides the order of the steps could be the right one :smile:

view this post on Zulip Nick Freiter (Aug 24 2020 at 12:12):

@Mika Tuomainen You make a very good point, the order of that documentation is confusing for someone first using FSH. I'm not sure how much freedom we have to make changes to the documentation at this point thought. @Mark Kramer would know better than me.

Another thing to consider is that this documentation defines the FSH specification, and one could think of this requirement that the ^ rules come first as a weakness of the SUSHI reference implementation, and not something that is necessarily baked into FSH. If that is the case, then we should just fix this requirement in SUSHI and leave the documentation as-is.

view this post on Zulip Mark Kramer (Aug 24 2020 at 13:35):

Good point. I added some documentation to make is clear that the three slicing steps are presented in logical order, but the rules from step (3) must physically occur BEFORE the rules in steps (1) and (2).

view this post on Zulip Mark Kramer (Aug 24 2020 at 13:47):

Actually, strike that previous comment. I ended up re-ordering the three steps.

view this post on Zulip Elliot Silver (Aug 24 2020 at 15:25):

Oh good. The incorrect order tripped me up too.

view this post on Zulip Jean Duteau (Aug 24 2020 at 15:31):

I would agree with this - either fix the SUSHI implementation so that it does not matter what order it comes or make the change to the documentation as a technical correction. And I should have read the rest of the replies in the thread. :)

view this post on Zulip Mark Kramer (Aug 26 2020 at 21:35):

It's fixed now: http://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#contains-rules-for-slicing

view this post on Zulip Mark Kramer (Aug 26 2020 at 21:36):

one could think of this requirement that the ^ rules come first as a weakness of the SUSHI reference implementation, and not something that is necessarily baked into FSH.

@Nick Freiter Yes , I agree. We can relax this rule later.


Last updated: Apr 12 2022 at 19:14 UTC