FHIR Chat · slicing on meta.profile · IG creation

Stream: IG creation

Topic: slicing on meta.profile


view this post on Zulip Brian Reinhold (Feb 23 2019 at 09:17):

I was once told that I did not have to do slicing on a meta.profile but that may have been a misunderstanding. I want to require that implementations following a phd profile enter at least one URL in the meta.profile element which is a fixed value. However, other meta.profile URLs are also allowed if the resource is also compliant to those profiles. But I am not sure how to do that. When I don't slice I get something that looks like I have 1..* profile elements of a fixed value. At least one could interpret it that way.

So I tried this
<element id="Device.meta.profile"> <path value="Device.meta.profile" /> <slicing> <discriminator> <type value="value" /> <path value="$this" /> </discriminator> <rules value="open" /> </slicing> <min value="1" /> </element> <element id="Device.meta.profile:phdProfile"> <path value="Device.meta.profile" /> <sliceName value="phdProfile" /> <min value="1" /> <max value="1" /> <fixedUri value="http://hl7.org/fhir/uv/phd/StructureDefinition/PhdDevice" /> </element>

But when doing that Lloyd's framework build gives me an error saying it can't resolve the discriminator. The Example is exactly as it should be

"meta": { "profile": [ "http://hl7.org/fhir/uv/phd/StructureDefinition/PhdDevice" ] },

and the built structure definition looks exactly as I want it to look; the generic profile is a sum, and the sliced profile is one fixed value. It makes more sense than the previous no-slice (but no error) but having 1..* on the fixed value.

view this post on Zulip Lloyd McKenzie (Feb 23 2019 at 15:33):

If you want to set expectations on one repetition while allowing arbitrary other repetitions, the only way to accomplish that is with slicing.

view this post on Zulip Brian Reinhold (Feb 23 2019 at 15:35):

If you want to set expectations on one repetition while allowing arbitrary other repetitions, the only way to accomplish that is with slicing.

@Lloyd McKenzie
okay, that's what I did above but the validator gives a cant resolve discriminator error. Any idea why?
Is it the path?

view this post on Zulip Lloyd McKenzie (Feb 23 2019 at 15:41):

Try path = value

view this post on Zulip Brian Reinhold (Feb 23 2019 at 15:43):

@Lloyd McKenzie
shorthand for <path value="value" />?

view this post on Zulip Lloyd McKenzie (Feb 23 2019 at 15:51):

y

view this post on Zulip Brian Reinhold (Feb 23 2019 at 17:39):

(deleted)

view this post on Zulip Rob Hausam (Feb 25 2019 at 06:50):

So that is actually valid syntax for the path? If so, I've missed it in the ElementDefinition and restricted FHIRPath documentation. As far as I know, the only place to use 'value' is in discriminator.type, not discriminator.path.

view this post on Zulip Brian Reinhold (Feb 25 2019 at 10:44):

So that is actually valid syntax for the path? If so, I've missed it in the ElementDefinition and restricted FHIRPath documentation. As far as I know, the only place to use 'value' is in discriminator.type, not discriminator.path.

Rob,
I am also looking for the documentation on that. I know that I was stuck on that slicing for a long time; so simple: I have a list of URLs but I have to define slicing 'outside' of the list. There was no element in meta.profile to make a path to. I am still trying to find something in the slicing documentation or the FHIRPath material it references that indicates that I should have used <path value="value" /> and what that means.

In general I think the slicing docs need to be increased. Would like to see examples of each case. 'pattern' and those functions, for example. I still don't really understand how they work and what they can do.

view this post on Zulip Rob Hausam (Feb 25 2019 at 17:18):

So have you been able to try <path value="value" /> and have found that it works (not just doesn't generate errors)? If so, that would definitely be good to know.

view this post on Zulip Brian Reinhold (Feb 25 2019 at 17:20):

So have you been able to try <path value="value" /> and have found that it works (not just doesn't generate errors)? If so, that would definitely be good to know.

Works like a charm!!

I think that needs to be documented. I really could not find out how to slice on a simple list of primitives

view this post on Zulip Lloyd McKenzie (Feb 25 2019 at 17:20):

Submit a change request

view this post on Zulip Rob Hausam (Feb 25 2019 at 17:33):

Yes, we need to document that. Broadening the question again, I assume that we still can't effectively slice on type = "profile" (which is what we originally wanted to do)? Our use case was slicing on Composition.section.entry(), as described in the documentation for the discriminator type 'profile'.


Last updated: Apr 12 2022 at 19:14 UTC