Stream: questionnaire
Topic: How to reference contained value set
Yunwei Wang (Mar 27 2020 at 22:16):
I have a Questionnaire with contained value set. The value set has "id": "valueset-1"
and "url": "http://example.com/valueset-1"
. What should I use in item.answerValueSet (which is type canonical)? "#id"
or "http://example.com/valueset-1"
Lloyd McKenzie (Mar 27 2020 at 22:37):
I think #id
. However, I'm not sure that using the canonical URL is wrong. @Grahame Grieve, opinions?
Grahame Grieve (Mar 29 2020 at 10:19):
no you use the local - this is here: http://hl7.org/fhir/references.html#canonical-fragments
Paul Lynch (Mar 30 2020 at 18:48):
On that page, there is this example:
<valueSet value="http://fhir.acme.com/Questionnaire/example|1.0#vs1"/>
with the explanation: "This is a reference to the value set with id "vs1" in version 1.0 of the identified questionnaire. "
Is that talking about one resource referencing a contained valueset inside a different resource (the Questionnaire)? Or is it another way for the Questionnaire to refer to its contained ValueSet?
I am confused by this example because I see this restriction on the same page: "References to contained resources are never resolved outside the container resource."
Grahame Grieve (Mar 30 2020 at 19:11):
inside a different resource
Paul Lynch (Mar 30 2020 at 20:42):
How can that be, if there is this restriction: "References to contained resources are never resolved outside the container resource." ?
Grahame Grieve (Mar 30 2020 at 20:47):
if you see a reference that starts with # like #a, then the resolution of that reference will never be outside the containing resource
Paul Lynch (Mar 30 2020 at 20:49):
Well, okay, but I was quoting from http://hl7.org/fhir/references.html#contained, which does not qualify that statement with respect to the format of the URI.
Grahame Grieve (Mar 30 2020 at 20:50):
well, you could create a task to clarify
Paul Lynch (Mar 30 2020 at 20:53):
Another needed clarification is needed on this statement on "Canonical URLs": "References to canonical URLs use the canonical type to refer to the url element". There no mention in this section that a canonical URL might be something else. Should I make two tasks or one?
Grahame Grieve (Mar 30 2020 at 21:34):
two tasks.
Paul Lynch (Mar 30 2020 at 22:18):
Brian Postlethwaite (Jun 30 2021 at 11:19):
Is there a way to reference the valueset directly, and not via the canonical? (like we used to do in DSTU2/STU3)
Brian Postlethwaite (Jun 30 2021 at 11:31):
Also, coming back to how the http://fhir.acme.com/Questionnaire/example|1.0#vs1
If that was a structureDefinition, doesn't that then refer to the element with id vs1?
http://hl7.org/fhir/r4/questionnaire-definitions.html#Questionnaire.item.definition
says that this value http://hl7.org/fhir/StructureDefinition/Observation#Observation.value[x]
doesn't refer to the contained resource, it's the element definition.
@Rick Geimer @Paul Lynch
Brian Postlethwaite (Jun 30 2021 at 11:36):
There is a display
extension to add in the explicit display to show (like you would on a regular reference) but no excplicit reference link
Brian Postlethwaite (Jun 30 2021 at 11:39):
The only option here is to include the http://hl7.org/fhir/StructureDefinition/terminology-server
and the url for the valueset (can't just reference it)
Lloyd McKenzie (Jun 30 2021 at 14:45):
Questionnaire only supports referencing by canonical, not by Reference. We do have an extension that allows you to indicate preferred terminology server which presumably would allow you to indicate where to look for it. Agree that's your only option right now.
#vs1 says "the element in this resource with id 'vs1'". Any element in a resource might have an id. contained resources and snapshot and differential elements are required to have ids. If you have a StructureDefinition with contained resources, so long as the id is unique, referencing it should work, though it's possible some software doesn't account for that. (And it may be that we need to make the documentation clearer.)
Brian Postlethwaite (Jun 30 2021 at 22:14):
Contained resources don't have to have element ids, but a resource Id (different thing) and that's my point.
Eric Haas (Jun 30 2021 at 22:59):
see this: http://hl7.org/fhir/references.html#canonical-fragments
Brian Postlethwaite (Jun 30 2021 at 23:41):
Yes, it's the inconsistency where that refers to the contained resource ID, and the element Definition usage of the same format in the same type going to an elementID somewhere in the resource.
Lloyd McKenzie (Jul 01 2021 at 02:58):
I don't think there's inconsistency. A hash-reference to a StructureDefinition could be a contained resource or an element or in theory even something like StructureDefinition.title if it happened to have an id on it.
Last updated: Apr 12 2022 at 19:14 UTC