FHIR Chat · sdf-1: Element paths must be unique unless the structure is · IG creation

Stream: IG creation

Topic: sdf-1: Element paths must be unique unless the structure is


view this post on Zulip Chris Moesel (Mar 26 2018 at 20:29):

I just ran into this invariant when publishing logical models:

sdf-1: Element paths must be unique unless the structure is a constraint

The implication here seems to be that logical models (defined as specializations) cannot use slicing (or that they are at least very limited in how they use slicing). Am I reading that right?

view this post on Zulip Chris Moesel (Mar 26 2018 at 20:43):

If so, does that mean it's not possible in a logical model to describe something as a list and then put requirements on individual items in that list? For example, indicating that in a list of codes, the first one must be from a specific code system?

view this post on Zulip Grahame Grieve (Mar 26 2018 at 20:59):

yes. there was a long thread about this about a month back. we decided not to act for now

view this post on Zulip Chris Moesel (Mar 26 2018 at 21:24):

OK. Thank you for the confirmation. I'll see if I can find that thread.

view this post on Zulip Chris Moesel (Mar 26 2018 at 21:28):

FYI for anyone else following... Found it: https://chat.fhir.org/#narrow/stream/implementers/topic/Logical.20Model.20and.20slicing.20for.20terminology

view this post on Zulip Chris Moesel (Mar 27 2018 at 19:34):

In my case, there is an array (0..*) of Coding and I want to fix the first one to a code. Since I can't do that with slicing, I was thinking of using a fhirpath constraint (i.e. invariant). Does that seem a reasonable approach?

view this post on Zulip Grahame Grieve (Mar 27 2018 at 19:37):

yes. though why not simply define what you have in the logical model?

view this post on Zulip Chris Moesel (Mar 27 2018 at 19:49):

I'm not sure how I go about defining what I have in the logical model without duplicate paths (slicing). For example, if I have:

category    0..*    Coding

How do I say the first coding should be SNOMED#12345 _without_ creating a slice and duplicate path? I'd need to make up a new path to contain the fixed Coding (e.g. categoryFixed1) -- but then it's not in the list of categories anymore, so the semantics of category get spread over multiple elements. Or am I missing something?

view this post on Zulip Chris Moesel (Mar 27 2018 at 19:50):

This is why a constraint seems the best approach given the limitations. It allows me to keep a single list of categories while still specifying that the first one must be SNOMED#12345.

view this post on Zulip Grahame Grieve (Mar 27 2018 at 19:50):

no you're not missing anything. that's your present set of choices.

view this post on Zulip Chris Moesel (Mar 27 2018 at 19:51):

OK. Thanks for the confirmation and talking it through with me.


Last updated: Apr 12 2022 at 19:14 UTC