Stream: implementers
Topic: urn in canonical reference
Michael Christensen (Jun 14 2019 at 10:46):
In QuestionnaireResponse resources we try to use an urn as the canonical "questionnaire" reference, like this:
{ "resourceType": "QuestionnaireResponse", "questionnaire": "urn:uuid:f14997cf-e16e-4e4b-8b3a-1f419386f597|1.0.0", ... }
Is this legal FHIR? (The documentation in relation to canonical reference is not the clearest English I have read :-))
Lloyd McKenzie (Jun 14 2019 at 14:39):
That would be a legal reference, but only if the QuestionnaireResponse was inside a Bundle where the guid resolved to a questionnaire (and there was a version match too). I don't think it's a legal reference for stand-alone. (@Grahame Grieve @Brian Postlethwaite can you confirm?)
Grahame Grieve (Jun 14 2019 at 21:30):
yes only in a bundle
Michael Christensen (Jun 18 2019 at 19:18):
Just trying to get my head around why this wouldn't be legal: The documentation of "canonical" data type says "A URI that refers to a resource by its canonical URL (resources with a url property).". Questionnaire.url has data type "uri" and this is described as "A Uniform Resource Identifier Reference (RFC 3986 )". So since a URN is a URI I concluded that it was legal to use a URN as the canonical reference in a QuestionnaireResponse. Where is the restriction that this is only legal in a Bundle stated? And why have this restriction?
My specific challenge relates to building an infrastructure where resources should only ever use logical reference, no literal references. This works fine until I get to canonical references, if there is a hard requirement that canonical references should always contain a URL.
Grahame Grieve (Jun 18 2019 at 20:11):
you are right - it is legal for it to be a urn
Lloyd McKenzie (Jun 19 2019 at 01:14):
Sorry. I was thinking of it as a Reference, not a canonical. It's good practice for canonicals to be URLs, but they're not required to be.
Last updated: Apr 12 2022 at 19:14 UTC