Stream: implementers
Topic: References to Canonical
James Agnew (Nov 18 2019 at 20:02):
So, a HAPI FHIR user recently submitted a ticket that highlighted a change that I actually hadn't noticed in R4: https://github.com/jamesagnew/hapi-fhir/issues/1583
Essentially, QuestionnaireResponse.questionnaire has now changed from being a reference
to being a canonical
. Due to HAPI FHIR's current interpretation of canonical, this means that anyone who has a QuestionnaireResponse containing a relative link to a local Questionnaire can no longer search for QR's using a query such as QuestionnaireResponse?questionnaire=Questionnaire/123
.
So I'm wondering several things here:
- Is the intent for canonicals that they should allow local references in addition to full URIs? My read of the spec is that they should not.
- Does it make sense for a
reference
search parameter to point to acanonical
type at all? I would have expected a parameter of typeuri
. The FHIR search page does discuss using reference SPs that point to canonical here ( http://hl7.org/fhir/search.html#versions ) but it doesn't explain how this is different from an SP of type URI.. If anything it seems like it duplicates it, and puts the onus on the server to understand whether a reference SP is expected to point to a canonical or a real reference - If references are allows to point to canonical types, is it reasonable for a server to interpret a local reference for what it is and try to a search such as the one above?
Grahame Grieve (Nov 18 2019 at 20:06):
- they should not
- I'm not sure. I thought we discussed this somewhere..?
- reasonable, yes
Lloyd McKenzie (Nov 18 2019 at 21:50):
@James Agnew Can you submit a change request for us to clarify this in the spec? (And figure out what to clarify to :>)
Abbie Watson (Nov 21 2019 at 17:56):
A similar issue is present in Measure/MeasureReport, which has a similar usage pattern as Questionnaire/QuestionnaireResponse. Honestly, I think it's the first time I ran across a 'canonical' data type during an implementation; or at least the first time it mattered to the project I'm working on. And I'm here wondering why it's not a typical Reference.
So... chiming in to request that the spec clarification be broad enough to address usage patterns in some of the other resources, not just Questionnaire/QuestionnaireResponse.
Lloyd McKenzie (Nov 21 2019 at 20:26):
Canonicals are used when there are expected to be identical copies of the resource on numerous servers (possibly including a local one), so you don't want to point to a reference on some remote server far away. You want to specify a canonical identifier that can be searched on the local system and near-by registries and only resolved by hitting the canonical URL as a last resort. This is typically used for 'definitional' and infrastructure resources.
Eric Haas (Nov 21 2019 at 20:46):
they are "fixed" resources instances vs "dynamic" resource instances...
Lloyd McKenzie (Nov 21 2019 at 20:53):
Sort of. Definitional resources can be changed - but they're generally only distributed into the wild when solid - at least for a given release version.
Alexander Kiel (Dec 20 2019 at 17:01):
In case of Measure/MeasureReport, does that mean that it should not be possible to $evaluate-measure a Measure which has no Measure.url, because MeasureReport.measure is required?
Eric Haas (Dec 21 2019 at 00:30):
That is my understanding but let me confirm with @Bryn Rhodes ?
Bryn Rhodes (Dec 21 2019 at 01:26):
Yes, that's correct, and the cqfm-measure profile in the Quality Measure IG requires url
for this reason.
Last updated: Apr 12 2022 at 19:14 UTC