FHIR Chat · Element.id Uniqueness Constraint within a Resource · implementers

Stream: implementers

Topic: Element.id Uniqueness Constraint within a Resource


view this post on Zulip Alexander Kiel (Jun 23 2019 at 10:43):

The documentation of Element.id says: Unique id for the element within a resource (for internal references).

In most StructureDefinitions, ElementDefinitions, which inherit Element.id, are repeated in snapshot and differential but have the same id. Is this a violation of the uniqueness constraint of Element.id?

view this post on Zulip Lloyd McKenzie (Jun 23 2019 at 10:48):

It's not because snapshot and differential are two views of the same thing. However, it would be good if we made that clearer. Can you submit a change request?

view this post on Zulip Grahame Grieve (Jun 23 2019 at 12:32):

Well, actually, it is. And that’s a problem

view this post on Zulip Lloyd McKenzie (Jun 23 2019 at 16:51):

Is that something that can even be changed at this point?. We already have scoping rules around id in Bundle. Can't we just officially do the same here? Is there a usecase for the snapshot and differential ids being distinct?

view this post on Zulip Alexander Kiel (Jun 24 2019 at 07:47):

@Lloyd McKenzie Good point. In a Bundle, Element ids would also not unique. Can you please point me to the scoping rules? I can't find them.

view this post on Zulip Lloyd McKenzie (Jun 24 2019 at 10:46):

http://build.fhir.org/element.html#id

view this post on Zulip Lloyd McKenzie (Jun 24 2019 at 10:46):

(Though I had to do some digging to find that :>)

view this post on Zulip Alexander Kiel (Jun 24 2019 at 10:53):

Ok but then we have still the problem in StructureDefinition snapshot/differential. I think someone with more experience in FHIR has to decide whether we should fix this problem by using different ids in snapshot and differential or simply add this case to the scoping rules.

view this post on Zulip Grahame Grieve (Jun 24 2019 at 10:54):

hah 2 normative rules that disagree with each other....

view this post on Zulip Lloyd McKenzie (Jun 24 2019 at 10:59):

@Grahame Grieve, can you think of any situations where we'd need a differential and snapshot element that corresponded to the same thing to have distinct ids?

view this post on Zulip Grahame Grieve (Jun 24 2019 at 11:12):

only because of this rule

view this post on Zulip Lloyd McKenzie (Jun 24 2019 at 23:03):

If we have conflicting rules, obviously we'll need to fix one of them. If there's no need for distinct ids between snapshot and differential, the simplest is to add this as one of the official exceptions to unique ids - on the grounds that none of the current tools are expecting unique ids here - if they were, they'd have been blowing up all over. (Ideally, we could reflect this as a technical correction in R4 too.) Do you want me to capture a change request?

view this post on Zulip Michel Rutten (Jul 16 2019 at 11:27):

Note: StructureDefinition invariants sdf-16 and sdf-17 constrain element id's to be unique within the differential component and within the snapshot component (separately):
http://build.fhir.org/structuredefinition.html#invs


Last updated: Apr 12 2022 at 19:14 UTC