Stream: IG creation
Topic: Lost id property in element
Todd Stevenson (Sep 24 2019 at 15:29):
I noticed that the 'id' property of an element in the differential section of the StructureDefintion is discarded when the profile gets published in the IG. Is that a bug? Or is the 'id' not really a useful property anyway? Perhaps I shouldn't even bother setting 'id' properties?
Lloyd McKenzie (Sep 24 2019 at 15:32):
Published using the IGPublisher?
Todd Stevenson (Sep 24 2019 at 16:29):
Yes.
Todd Stevenson (Sep 24 2019 at 16:35):
Here is an example: AssociatedPreconditionExt.xml StructureDefinition-AssociatedPreconditionExt.xml
Todd Stevenson (Sep 24 2019 at 16:41):
I get the same behavior with HAPI Fhir. I don't know how much of this is shared code.
Todd Stevenson (Sep 24 2019 at 17:48):
How important is the 'id' property?
Lloyd McKenzie (Sep 24 2019 at 17:56):
I don't see it being discarded, I see it being fixed. The id of an element is algorithmicly determined based on the path and the slice names in the model.
Todd Stevenson (Sep 24 2019 at 18:26):
Thank you. I misspoke. I saw that it was being changed from what I put in the profile document. What is 'id' used for? Can you show me where this is documented? When I write profiles, should I just ignore the 'id'?
Lloyd McKenzie (Sep 24 2019 at 18:36):
The id is used to link the snapshot and differential elements. It also determines anchor names in the publication. I don't recall if the IGPublisher will complain if the id is absent. If not, best to omit it.
Grahame Grieve (Sep 24 2019 at 19:07):
It doesn’t need to be present.
Grahame Grieve (Sep 24 2019 at 20:05):
http://hl7.org/fhir/elementdefinition.html#id
Michel Rutten (Sep 25 2019 at 10:06):
From 2.30.0.3 ElementDefinition.id:
every ElementDefinition SHALL have a populated id
This suggests that the element id is mandatory. Maybe we can improve the description?
Grahame Grieve (Sep 25 2019 at 11:15):
that's right - it is mandatory
Michel Rutten (Sep 25 2019 at 13:36):
It doesn’t need to be present.
that's right - it is mandatory
Confusing?
Todd Stevenson (Sep 25 2019 at 15:58):
The IG publisher doesn't seem to require it. In fact it ignores it. I noticed we had built profiles with unique 'id' properties and the publisher replaced them with the path as the 'id' in the generated structure definition.
Grahame Grieve (Sep 25 2019 at 19:29):
for a valid resource, ElementDefinition.id is mandatory, and must be correct. But the IG Publisher doesn't require it be populated, and it sets the value to the correct value when processing it. So the IG publisher does not require a valid resource in this regard
Lloyd McKenzie (Sep 25 2019 at 20:32):
@Todd Stevenson if the IG Publisher replaced what you had, then what you had was incorrect.
Lloyd McKenzie (Sep 26 2019 at 20:02):
@Todd Stevenson if the IG Publisher replaced what you had, then what you had was incorrect.
Last updated: Apr 12 2022 at 19:14 UTC