Stream: IG creation
Topic: DSTU2 invalid ids
Chris Moesel (Oct 30 2018 at 02:02):
I'm experimenting w/ creating DSTU2 profiles. When I run the IG publisher, the QA reports an error about an invalid id for every element in every structure definition. For example:
id value 'Extension:myTestExt' is not valid id value 'Extension:myTestExt.id' is not valid ...
I tried removing the name (e.g., myTestExt) from the root and that eliminated many of the errors, but whenever I have slices with a slicename in the id, I still get the error. For example:
id value 'Condition.extension:someExt' is not valid
Furthermore, ids with [x] are also marked as invalid. For example:
id value 'Condition.onset[x]' is not valid
Does DSTU2 have different rules for ids (like only alphanumeric characters)? If so, is there a recommended approach for slice ids and choice ids?
Chris Moesel (Oct 30 2018 at 21:02):
Looking into this further, the Argonaut Data Query profiles use ids very similar to this, for example:
"id" : "Condition:argoprofile",
"id" : "Condition:argoprofile.id",
"id" : "Condition:argoprofile.onset[x]",
I think this means that one of the following must be the case:
- it's valid and there is a bug in the publisher that incorrectly flags it as an error
- it's invalid in DSTU2, but Argonaut got away with it
Any insight on this, @Grahame Grieve ?
Eric Haas (Oct 30 2018 at 22:25):
its an error in the IG. Argonaut got away with it because is predated to changes in the validator
Eric Haas (Oct 30 2018 at 22:26):
can you create an issue on GitHub?
Eric Haas (Oct 30 2018 at 22:26):
For Argonaut DQ guide
Chris Moesel (Oct 31 2018 at 11:56):
@Eric Haas -- OK. Do you know what the guidance is regarding how it should be done (since the STU3 way of doing choices and slices in ids is apparently illegal)? I couldn't find anything in the DSTU2 spec, but it's possible I missed it. The base resource StructureDefinitions don't use id
at all, so they're not much help.
Eric Haas (Oct 31 2018 at 15:49):
Here is some guidelines it the spec: http://build.fhir.org/elementdefinition.html#id
Chris Moesel (Oct 31 2018 at 16:15):
@Eric Haas -- I'm aware of that guidance, but it is R4. If you follow that guidance in DSTU2, the IG publisher will spit out errors for any id
s that specify slices with a :
or that contain [x]
for choice elements. DSTU2 seems to have a much stricter set of rules, although I couldn't find anything in the DSTU2 spec that actually called them out.
Chris Moesel (Oct 31 2018 at 16:20):
Hmmm... this is interesting. According to the DSTU2 spec, id
should actually be _id
in the JSON representation: http://hl7.org/fhir/DSTU2/element.html#json
In STU3, the _
was removed. In my DSTU2 JSON StructureDefinitions, I'm using id
instead of _id
. I wonder if that has anything to do with it...
Eric Haas (Oct 31 2018 at 16:57):
No I am not aware. I based all of my work on the tooling.
Chris Moesel (Nov 02 2018 at 17:22):
So the DSTU2 limitations on id
were under my nose the whole time. I just had to go to the definition of the id
primitive, which apparently changed.
Chris Moesel (Nov 02 2018 at 17:26):
Any combination of upper or lower case ASCII letters ('A'..'Z', and 'a'..'z', numerals ('0'..'9'), '-' and '.', with a length limit of 64 characters.
http://hl7.org/fhir/DSTU2/datatypes.html#id
Grahame Grieve (Nov 09 2018 at 06:35):
I'm not sure about this. It's going to be hard for to resolve, that's for sure. do you have a worked example I can experiment with?
Chris Moesel (Nov 13 2018 at 18:30):
Well... the limitation on allowed characters is built right into the spec (as I discovered in my last comment on this thread), so I don't think that's something that can change. I was just wondering if there was any guidance around how slice names and specific choices should be reflected in the id since :
, [
and ]
are all disallowed. If there is no guidance/convention, I suppose I can make something up.
I noticed that the FHIR core definitions don't even include id
s in the snapshot/differential elements -- so maybe they're not even important for DSTU2 profiles?
Grahame Grieve (Nov 14 2018 at 02:47):
it's an issue in the r2/r4 conversions. I might be able to do something... maybe.
Grahame Grieve (Nov 14 2018 at 02:47):
have you seen the test IGs? do you want to extend those with some breaking things?
Chris Moesel (Nov 14 2018 at 14:37):
I haven't seen the test IGs. I'll see if I can find them. If not, I'll ask for a pointer.
Grahame Grieve (Nov 14 2018 at 15:40):
/test/ig in the build
Last updated: Apr 12 2022 at 19:14 UTC