Stream: implementers
Topic: Forge: How to specify an element id
Brian Reinhold (Jun 04 2017 at 10:31):
In order to have a clear discriminator for an identifier element, the only way I could think of do to it is to require that the element have an id. In this case the identifier is sliced, one identifier is conditionally required, the other is open to the application. So to distinguish between the two I would like to add a requirement that the conditionally required element, when present, has an id of a specific value. But I see no way in the Forge tool to indicate what that id is. Anyone know how to do that? Thanks
Grahame Grieve (Jun 04 2017 at 11:09):
sounds to me like a case where you don't have a discriminator
Brian Reinhold (Jun 04 2017 at 11:11):
I DO have a discriminator and set it to the element id so Forge looks happy. However, what I want to specify in the profile is that the id should be a specific value. I want to set it to "PCHA" for example. However, I do not see a means of doing that.
Brian Reinhold (Jun 04 2017 at 11:17):
Bummer, I have bigger problems. I created the resource in the new STU3 version of Forge but Simplifier identifies it only as a DSTU2 resource and then Simplifier cannot render it. The Forge tool gives me no errors. I wanted to see what the element id looks like in Simplifier (given I have set the discriminator to the identifier.id value.
Brian Reinhold (Jun 04 2017 at 12:46):
I think I may have figured it out. It is the element ID edit box. What confused me is that this box was being auto-filled by Forge with the slice Name most of the times and I didn't notice it. Thought it was for Forge use. Then I noticed when I create a new slice it is empty. So maybe Forge auto-fills its if I put nothing in.
Since I am unable to view my profile on Simplifier, I cannot validate that.
Lloyd McKenzie (Jun 04 2017 at 13:42):
@Brian Reinhold Element.id has no meaning. Its sole purpose is to allow elements to be referenced from elsewhere in an instance. So it really doesn't make sense to use as a discriminator. For Identifier, your discriminator would ususally be Identifier.use, Identifier.type or Identifier.system (or less commonly the existence of Identifier.period.end). Can you provide the business description of what you're trying to do?
Eric Haas (Jun 04 2017 at 22:46):
you could discriminate on type or system too...
Brian Reinhold (Jun 04 2017 at 23:06):
Lloyd,
In this case the identifier is a string (may end up a hash) of several observation fields including referenced device and patient identifier fields. The identifier.value is used and nothing else is specified. Its sole purpose is for conditional creates in order to avoid data duplication. Some PHDs upload a great deal of already uploaded data; this helps prevent the creation of duplicates resources on the FHIR server.
In Forge, the Element.Id appears to be set to the slice name. It would seem that would make a good discriminator because the identifiers I 'slice' each have their own 'slice' name.
Lloyd McKenzie (Jun 04 2017 at 23:27):
Hi Brian,
The element.id is used inside the StructureDefinition. It has nothing to do with what appears in the instance. The only reason to slice identifier is if you expect there to be multiple identifiers present. Why not define a system for your funky concatenated value and slice based on that?
Grahame Grieve (Jun 04 2017 at 23:29):
There's confusion with Forge, whether the fixed value for the element.id is for the StructureDefinition, or for the instance it's describing. I don't know the answer
Michel Rutten (Jun 05 2017 at 14:19):
Please note that the support for ElementIDs in the initial Forge STU3 release is not fully conformant to the FHIR spec. We are aware of the issue(s) and are working on a minor update that will fix this.
Last updated: Apr 12 2022 at 19:14 UTC