Stream: implementers
Topic: Valid canonical
Yunwei Wang (Jun 08 2020 at 15:59):
What is a valid value for canonical? Does the value has to be looked like a "http://xxxx"? According to data type page http://hl7.org/fhir/R4/datatypes.html, a canonical is a url, a url is a uri. uri has regex \S*
while canonical and url don't have their own regex. It looks like "url": "ValueSet/123"
is a valid canonical. Do I miss something here?
Lloyd McKenzie (Jun 08 2020 at 16:14):
A canonical has to be a full URI - it can't be relative
Yunwei Wang (Jun 08 2020 at 16:25):
Is there a sentence in FHIR spec stating that?
Lloyd McKenzie (Jun 08 2020 at 16:29):
Not sure. If you can't find one, submit a change request
Gino Canessa (Jun 08 2020 at 16:30):
If you go from DataType Canonical to Canonical Reference to Canonical Resource Identity, you get to
The canonical URL serves as a stable logical identifier for the resource, and is the preferred way to reference a conformance or knowledge resource. The canonical URL SHOULD also resolve to the location where the master copy of the artifact is found, though it is not always possible to arrange this. The canonical URL SHALL NOT refer to some other resource (though it may resolve to a different version of the same resource).
Which is the closest I found.
Though TIL that canonical can also be a fragment to a contained resource, so not always a full URL.
Michael O'Keefe (Jun 08 2020 at 16:43):
The FHIR Extensibility page (https://www.hl7.org/fhir/extensibility.html) also states: The url SHALL be a URL, not a URN (e.g. not an OID or a UUID), and it SHALL be the canonical URL of a StructureDefinition that defines the extension. Except for child extensions defined within complex extensions, the URL SHALL be an absolute URL.
Michael O'Keefe (Jun 08 2020 at 16:43):
Which implies that for child extensions of complex extensions, the Canonical URL can be relative
Stephen MacVicar (Jun 08 2020 at 16:55):
Though TIL that canonical can also be a fragment to a contained resource, so not always a full URL.
It's not a full url, but it can always be resolved without ambiguity.
Grahame Grieve (Jun 08 2020 at 18:53):
It's certainly an oversight - a surprising one to me - that we do not explicitly say that canonical URLs have to be absolute URLs if they are not fragment identifiers
Grahame Grieve (Jun 08 2020 at 18:53):
@Yunwei Wang please make a task to fix this
Yunwei Wang (Jun 08 2020 at 19:16):
https://jira.hl7.org/projects/FHIR/issues/FHIR-27789
Paul Lynch (Jan 12 2021 at 18:02):
Yunwei Wang said:
@Yunwei Wang Why was this issue retracted?
Lloyd McKenzie (Jan 12 2021 at 18:32):
It wasn't retracted...
Yunwei Wang (Jan 12 2021 at 18:44):
It is retracted. I cannot remember why I retracted it. @Paul Lynch If you think there is still value for this ticket, I can re-create one.
Paul Lynch (Jan 12 2021 at 18:48):
@Yunwei Wang , yes I think it would be helpful. We've been using relative URLs in QuestionnaireResponse.questionnaire (with which HAPI FHIR has no issues) and I am just learning they should have been absolute.
Lloyd McKenzie (Jan 12 2021 at 20:02):
Weird. Clicking on the link doesn't take me to the right place...
Lloyd McKenzie (Jan 12 2021 at 20:03):
How did you get that hyperlink?
Yunwei Wang (Jan 14 2021 at 20:01):
https://jira.hl7.org/browse/FHIR-27789. @Paul Lynch Issue reopened
Last updated: Apr 12 2022 at 19:14 UTC