FHIR Chat · Slicing by type with and without resolve() · IG creation

Stream: IG creation

Topic: Slicing by type with and without resolve()


view this post on Zulip Richard Townley-O'Neill (Jun 22 2020 at 03:24):

I'm puzzled by different documentation on slicing by type.
In FHIR R4 5.1.0.11 Discriminator it suggests that to slice List.entry by type the path would be item.resolve().
In Profiling Academy on slicing it suggests that to slice MedicationStatement.subject by type the path would be $this.
One uses resolve() and one doesn't. Why?

view this post on Zulip Lloyd McKenzie (Jun 22 2020 at 03:46):

The only type of Medication.subject is Reference. I think the profiling academy is wrong...

view this post on Zulip Richard Townley-O'Neill (Jun 22 2020 at 03:49):

Should the path be resolve() or $this.resolve() or reference.resolve()?

view this post on Zulip Richard Townley-O'Neill (Jun 22 2020 at 03:49):

Or something else?

view this post on Zulip Lloyd McKenzie (Jun 22 2020 at 03:52):

resolve()

view this post on Zulip Lloyd McKenzie (Jun 22 2020 at 03:52):

$this.resolve() would also work, though the $this is unnecessary

view this post on Zulip Lloyd McKenzie (Jun 22 2020 at 03:52):

$this is only really required when the thing you want to slice on is the element declaring the slicing

view this post on Zulip Richard Townley-O'Neill (Jun 22 2020 at 03:57):

@Ward Weistra FYI

view this post on Zulip Ardon Toonstra (Jun 22 2020 at 09:11):

@Richard Townley-O'Neill , the discriminator in the Profiling Academy was indeed wrong. We fixed it and provided a bit more info on the discriminator.path.
Thanks for the heads up!

view this post on Zulip Patrick Werner (Aug 10 2020 at 17:38):

Lloyd McKenzie said:

$this is only really required when the thing you want to slice on is the element declaring the slicing

so if i want to slice Composition.section.entry, on the entry itself this would need: '$this.resolve()' because i want to slice a thing (entry) on the element (entry)?

view this post on Zulip Rob Hausam (Aug 10 2020 at 19:34):

@Patrick Werner That's my interpretation. I believe that the $this isn't actually required (or it may not be - but I tend to like using it for clarity)? I'm curious if others are understanding it the same way.

view this post on Zulip Patrick Werner (Aug 11 2020 at 12:42):

Thanks @Rob Hausam i'm always adding it as well, just to be sure. The guidance on when and whether $thisis needed should be clarified in the spec.


Last updated: Apr 12 2022 at 19:14 UTC