Stream: IG creation
Topic: Slicing by type with and without resolve()
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?
Lloyd McKenzie (Jun 22 2020 at 03:46):
The only type of Medication.subject is Reference. I think the profiling academy is wrong...
Richard Townley-O'Neill (Jun 22 2020 at 03:49):
Should the path be resolve() or $this.resolve() or reference.resolve()?
Richard Townley-O'Neill (Jun 22 2020 at 03:49):
Or something else?
Lloyd McKenzie (Jun 22 2020 at 03:52):
resolve()
Lloyd McKenzie (Jun 22 2020 at 03:52):
$this.resolve() would also work, though the $this is unnecessary
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
Richard Townley-O'Neill (Jun 22 2020 at 03:57):
@Ward Weistra FYI
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!
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)?
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.
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 $this
is needed should be clarified in the spec.
Last updated: Apr 12 2022 at 19:14 UTC