FHIR Chat · Error in the FHIRPath spec? · IG creation

Stream: IG creation

Topic: Error in the FHIRPath spec?


view this post on Zulip Lloyd McKenzie (Oct 16 2021 at 21:47):

Looking at Section 2.9.4 of the FHIRPath spec, it defines the 'simple' FHIRPath syntax we use for things like defining slicing discriminators. The wording says:
All statements SHALL start with the name of the context element (e.g. on a Patient resource, Patient.contact.name.), or SHALL be simply "$this" to refer to the element that has focus
However, I know for a fact that none of the tools allow this. If you're starting at Patient and want to specify a discriminator of patient contact name, then the discriminator path is "contact.name", not "Patient.contact.name". I.e. you never include the name of the 'current' element as part of the path - that's one of the reasons we need $this.

Am I correct that this wording is in error? (@Grahame Grieve)

(The fact it's a SHALL statement is going to make it more fun to fix...)

view this post on Zulip Grahame Grieve (Oct 16 2021 at 21:49):

I don't think that the statement is wrong. where don't the tools support it?

view this post on Zulip Lloyd McKenzie (Oct 16 2021 at 21:53):

Simple example:

    <element id="Task.input">
      <path value="Task.input"/>
      <slicing>
        <discriminator>
          <type value="pattern"/>
          <path value="type"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <mustSupport value="true"/>
    </element>

view this post on Zulip Lloyd McKenzie (Oct 16 2021 at 21:53):

According to the text in the spec, my discriminator ought to be "Task.input.pattern" (or maybe "input.pattern"?)

view this post on Zulip Grahame Grieve (Oct 16 2021 at 21:56):

it won't work there - you'll need $this.

view this post on Zulip Lloyd McKenzie (Oct 16 2021 at 22:16):

I don't need $this - a discriminator of "pattern" works just fine...

view this post on Zulip Lloyd McKenzie (Oct 16 2021 at 22:17):

I only need $this if the discriminator is the same as the element being sliced.

view this post on Zulip Grahame Grieve (Oct 16 2021 at 22:23):

you'll need $this to be compliant with the rule

view this post on Zulip Lloyd McKenzie (Oct 16 2021 at 22:31):

Right - but if tools don't enforce the rule, and there's no need for the rule, why do we have the rule?


Last updated: Apr 12 2022 at 19:14 UTC