FHIR Chat · Questionnaire use valuesets for answers to questions · implementers

Stream: implementers

Topic: Questionnaire use valuesets for answers to questions


view this post on Zulip Marla Albitz (Mar 30 2022 at 15:51):

I am building a questionnaire, in building the items(questions) is my thinking correct for how to use a valueset to serve as possible answers. For example, if I want to offer yes/no/unknown as three possible responses, do I set the "item/answer/value[x]" to the element property "Reference(Resource) and associate it to a valuset resource which contains that list or includes that list? Or is there a more direct/better way? I want to be able to dynamically populate the UI with the answer options without hardcoding it somewhere outside of the resource. That is the idea, correct?

view this post on Zulip Bas van den Heuvel (Mar 30 2022 at 16:03):

Set the field Questionnaire.item.answerValueSet to the canonical of the ValueSet from which the answers should come.

view this post on Zulip Marla Albitz (Mar 30 2022 at 16:19):

Thank you, yes, so I found an example of that on the Questionaire resource page. What confuses me about that is that link takes me to a page that appears to not be computer parsable, only human readable. Am I missing something? "item": [
{
"linkId": "1.1",
"code": [
{
"system": "http://example.org/system/code/questions",
"code": "COMORB"
}
],
"prefix": "1",
"type": "coding",
"answerValueSet": "http://hl7.org/fhir/ValueSet/yesnodontknow",

view this post on Zulip Lloyd McKenzie (Mar 30 2022 at 16:57):

answerValueSet is of type 'canonical'. That means you point to the URL (possibly with version) of the ValueSet of interest. There is no requirement that the URL resolve at all (it's technically a uri), though we strongly prefer that it at least resolves to something human-readable. Most ideally, it will resolve to an appropriate FHIR resource representation if you pass the appropriate 'Accept' header. (That will happen for HL7 value sets.) However, resolving the canonical is only done as a last resort. The first thing you typically do is perform a local search and a check against your preferred registries for the resource. You only try to resolve the URL if you can't find it elsewhere. This approach is true for all canonicals - including QuestionnaireResponse.questionnaire, Resource.meta.profile, and lots of other places.

view this post on Zulip Marla Albitz (Mar 30 2022 at 17:56):

Thank you Lloyd, where is a FHIR-speak to English translator when you need one. You have given me a lot to unpack

view this post on Zulip Lloyd McKenzie (Mar 30 2022 at 20:09):

Sorry :)

TLDR version: value set references don't have to resolve, though it's nice if they do. (And to get them to resolve computably, you need to populate the Accept header)

view this post on Zulip Marla Albitz (Apr 01 2022 at 17:46):

(deleted)

view this post on Zulip Shamil Nizamov (Apr 06 2022 at 15:08):

How to validate answers against such external ValueSet? Is that possible at all?

view this post on Zulip Lloyd McKenzie (Apr 06 2022 at 16:38):

Retrieve the value set as you would typically retrieve any canonical resource (look for it locally, then in any preferred registries or terminology services (also check terminology services mentioned in the Questionnaire itself - if you trust them) and, as a last resort, try resolving the canonical URL (again, if your security policy allows). Provided that you've successfully retrieved the value set, then expand it or get a terminology service to do that for you. (Note that you might delegate the retrieval of the value set to a terminology service too.)


Last updated: Apr 12 2022 at 19:14 UTC