Stream: implementers
Topic: Profiles and First Element Slice
Chris Moesel (Jan 25 2017 at 16:34):
I've noticed something in FHIR's published profiles that I cannot find referenced in the documentation. It is that the first element in the snapshot (and differential) defines some kind of slice, by appending a name to the id and setting a "sliceName" attribute. For example, here is an excerpt from the BMI profile's first (base) element:
"id": "Observation:bmi", "path": "Observation", "sliceName": "BMI",
What's the intention here? Is setting up a name and sliceName (which apparently don't have to match) in the base element a requirement for all profiles?
Eric Haas (Jan 25 2017 at 19:00):
May also be used for code generation purposes. And these profiles are generated from profile spreadsheets.
Lloyd McKenzie (Jan 26 2017 at 01:31):
@Chris Moesel I'm not seeing "name" in your example. It is required to have a sliceName for each slice and it is required that the element have a name that is generated by an algorithm that takes the sliceName into acccount. The id must be globally unique within the snapshot (and the id on the differential must match the snapshot id). I believe the slice name only needs to be unique in the context of the sliced element.
Chris Moesel (Jan 26 2017 at 01:54):
@Lloyd McKenzie Thanks for the additional clarification. By _name_, I meant the latter part of the id after the colon (e.g., "bmi" in "Observation:bmi"). I wasn't sure what to call it. Is that also the part that you say must be generated by an algorithm that takes the sliceName into account? If so, I understand why it's there now.
That said, I still don't understand why the snapshot's base element has a sliceName at all (for profiles on resources). If it needs to have one "just because", then fine -- but I haven't located anything in the documentation that says that's the case. Yet in all of the FHIR-produced profiles I've looked at, it seems to be that way. I'm just trying to understand if it's required, and secondarily, what it means.
Lloyd McKenzie (Jan 26 2017 at 04:23):
Ah. I missed that you were talking about the base element. It shouldn't have a slice name. If you want to raise a tracker item to have the IG tool yell about seeing slice names when it's not actually dealing with a slice, that'd probably be a good idea.
Eric Haas (Jan 28 2017 at 17:18):
@Lloyd McKenzie the spec states what I mentioned above and I think that is why its there - the profiles are generated from code and this is artifact from the code generated profiles.
Lloyd McKenzie (Jan 28 2017 at 19:31):
@Eric Haas It's appropriate for a StructureDefinition to have a "name" element, but not for it to have a sliceName.
Last updated: Apr 12 2022 at 19:14 UTC