Stream: IG creation
Topic: Profile name length
Jean Duteau (Jan 28 2021 at 18:19):
Is there guidance on how long a Profile name should be? I vaguely remember guidance about the use of names in code so that it shouldn't be really long, but I couldn't find anything.
Eric Haas (Jan 28 2021 at 18:24):
I typically use Pascal case of id - but they can get pretty long especially if prepend project to them.
Jean Duteau (Jan 28 2021 at 18:26):
yeah, I do the same - my names and ids are basically the same. I've been trying to be semi-descriptive in my names and that is causing some of my Bundle profiles to be pretty long
Chris Moesel (Jan 28 2021 at 18:26):
The StructureDefinition.name field says they SHOULD be at most 255 characters, starting with a capital letter, and only containing alphanumeric characters plus underscore.
Jean Duteau (Jan 28 2021 at 18:26):
well, that is semi-reasonable. I've love to see someone name them with 250 characters :)
Chris Moesel (Jan 28 2021 at 18:27):
The currently released SUSHI is actually overly zealous about this recommendation and emits an error if you violate that rule. But the next version of SUSHI demotes it to a warning since it is only a SHOULD.
Chris Moesel (Jan 28 2021 at 18:30):
And in SUSHI, if you don't specify an Id
, it will use the name but modify it slightly to fit the requirements for id
(namely, replace _
with -
). Technically, id
is supposed to top out at 64 characters though. I don't remember if SUSHI enforces that or not.
Eric Haas (Jan 28 2021 at 18:31):
WellThatIsSemiReasonableIVeLoveToSeeSomeoneNameThemWith_250Characters ... yeah its hard to get 255
David Pyke (Jan 28 2021 at 18:31):
Sushi doesn't enforce the 64 char limit (but it should)
David Pyke (Jan 28 2021 at 18:32):
There are profiles based on the names of lab tests that had to be truncated
Chris Moesel (Jan 28 2021 at 18:37):
@David Pyke - if SUSHI doesn't enforce it, it's probably because it's not clear how SUSHI should handle it. Blind truncation seems problematic, especially if there are multiple long names for which the first 64 characters are the same; we don't want to create duplicate ids. And we also don't want to create ids that misrepresent the idea (imagine a name for which the tail end is "Negation"; truncating that off could produce an id with the exact opposite meaning of what is intended!).
Chris Moesel (Jan 28 2021 at 18:38):
But SUSHI should probably at least emit a warning if an id is > 64 chars.
David Pyke (Jan 28 2021 at 18:40):
IT's going to error out in the IG, you should probably just error out and let the dev fix it
Chris Moesel (Jan 28 2021 at 18:43):
Actually, it looks like SUSHI _does_ truncate it, but also produces a warning about the truncation:
Profile: ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName
Parent: Observation
* code MS
warn The string "ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName" represents a valid FHIR name but not a valid FHIR id. FHIR ids cannot contain "_" and can be at most 64 characters. The id will be exported as "ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyRea". Avoid this warning by specifying a valid id directly using the "Id" keyword.
https://fshschool.org/FSHOnline/#/share/3or4GhH
David Pyke (Jan 28 2021 at 18:44):
One of these days, I really do have to start using the latest version of sushi
Jose Costa Teixeira (Jan 28 2021 at 19:29):
You normally don't want sushi unless it's fresh sushi.
Last updated: Apr 12 2022 at 19:14 UTC