Stream: shorthand
Topic: Canonical with version
Nick Freiter (Jul 22 2020 at 15:05):
Hey there everybody, we'd like to get some user input on a syntax decision. We are adding a Canonical
keyword to SUSHI which allows the user to get the canonical URL of a FHIR resource, but FHIR allows canonical URLs to include a version by appending |<version>
to the URL. For example, if we have a resource Foo with URL http://example.org/ValueSet/Foo
and version 1.2.3
, the URL as a canonical could be http://example.org/ValueSet/Foo|1.2.3
. We are unsure how to best handle versions. There seem to be two paths forward:
- Version included by default :
Canonical(Foo)
is used to indicate that SUSHI should use theversion
it finds on theFoo
resource, returnshttp://example.org/ValueSet/Foo|1.2.3
Canonical(Foo|4.5.6)
is used when you want to manually specify a version different from the one that SUSHI finds onFoo
, returnshttp://example.org/ValueSet/Foo|4.5.6
Canonical(Foo|)
is used when you do not want the version, returnshttp://example.org/ValueSet/Foo
- Version not included by default:
Canonical(Foo|.)
is used to indicate that SUSHI should use theversion
it finds on theFoo
resource, returnshttp://example.org/ValueSet/Foo|1.2.3
.Canonical(Foo|4.5.6)
is used when you want to manually specify a version different from the one that SUSHI finds onFoo
, returnshttp://example.org/ValueSet/Foo|4.5.6
Canonical(Foo)
is used when you do not want the version, returnshttp://example.org/ValueSet/Foo
Chris Moesel (Jul 22 2020 at 15:11):
I think there are advantages to each, but in a FHIR canonical, no |
means no specified version -- so I have concerns about making no |
mean insert the current version in FSH.
David Pyke (Jul 22 2020 at 15:48):
I think Canonical(Foo) should return http://example.org/ValueSet/Foo
Canonical(Foo | x.y.z ) should return http://example.org/ValueSet/Foo|x.y.z
Anything else is a syntax error. That keeps it simple to use
Chris Moesel (Jul 22 2020 at 16:32):
So @David Pyke -- I want to be sure I understand what you're suggesting. You're suggesting that we should not support a way to say "insert the version in scope" -- but rather, if you want to specify the same version as is in your IG (or in a dependency) you have to explicitly put in whatever that version number is... Right?
David Pyke (Jul 22 2020 at 16:34):
Right. I'm a fan of brute force
Chris Moesel (Jul 22 2020 at 17:53):
I'm inclined toward your suggestion, @David Pyke. It keeps things simple and eliminates magic -- and it's often the magic that confuses people. If authors find that it's too burdensome and they really want a magic way of saying "the version in scope", then we can add it in STU2. And if it turns out nobody else needs/wants it, then we've kept FSH simpler!
But... we'll give this thread time to sit overnight in case anyone else wants to comment before we implement it.
David Hay (Jul 22 2020 at 18:35):
Right. I'm a fan of brute force
Is that a 'David' thing?
David Pyke (Jul 22 2020 at 18:42):
Polite brute force.
John Moehrke (Jul 22 2020 at 18:45):
excessively polite brute force
Keith Boone (Jul 23 2020 at 19:18):
Canadian form of brute force.
Last updated: Apr 12 2022 at 19:14 UTC