Stream: questionnaire
Topic: End labels on Question Answers
Grey Faulkenberry (Aug 14 2021 at 20:49):
If this has already been addressed, please feel free to point me in the direction of that stream. I'm trying to figure out how to define a rendering with a label at the beginning and end of the answers. I'm trying to figure out how to do this for both a slider and for multiple choice. For instance, if I have the question
Slider:
How many days did you drink in the last month?
0 ----------O--------------------30
Multiple Choice:
Answer the following from 1-5, 1 meaning Not at all True, 5 meaning Completely True:
1 2 3 4 5
Not at All True O O O O O Completely True
Obviously the ascii rendering doesn't wok real well, but you get the idea. I've looked through the SDC extensions, and I can get part of these described, but I'm still running into problems. Any suggestions?
Diane (Aug 14 2021 at 23:08):
Hi,
If you look at the example at https://build.fhir.org/ig/HL7/sdc/examples.html#using-sliderstepvalue, it looks like the endpoints are defined by the properties http://hl7.org/fhir/StructureDefinition/minValue and http://hl7.org/fhir/StructureDefinition/maxValue like this:
{
"url": "http://hl7.org/fhir/StructureDefinition/minValue",
"valueInteger": 0
},
{
"url": "http://hl7.org/fhir/StructureDefinition/maxValue",
"valueInteger": 30
}
I don't know about the multiple choice.
Morten Ernebjerg (Aug 15 2021 at 09:10):
AFAIK there are no standard extensions for text labels for the min and max ends of a scale, only for the values. However, I don't know whether there are common IGs like SDC that define such extension. We used custom extensions for this case.
Tilo Christ (Aug 15 2021 at 09:49):
I thought the lower and upper item control was meant for that? http://hl7.org/fhir/R4/codesystem-questionnaire-item-control.html#questionnaire-item-control-lower
Morten Ernebjerg (Aug 15 2021 at 10:06):
@Tilo Christ Ah, interesting! I know this extension but thought it could only change the rendering of the element it was attached to. But if I read it right, if you have a scale-question, you can add a sub-item of type "display", add the min (max) label as the text, and add an itemControl extension with a code to indicate that this is the min (max) text label of the parent question. Is that right?
Tilo Christ (Aug 15 2021 at 12:01):
That would be my interpretation. I haven't seen it used in any examples yet. I am hoping for confirmation from someone more authoritative.
John Manning (Aug 15 2021 at 12:05):
^^ Agreed. This would be very helpful for those types of questions
Lloyd McKenzie (Aug 15 2021 at 14:56):
'lower' and 'upper' are absolutely the item controls to set the label for the lower and upper bounds. The question is whether you can have them work on a group of type "Vertical Answer Table". It seems reasonable, but we should add clarification into the specification. Can someone submit a change request?
Grey Faulkenberry (Aug 15 2021 at 17:59):
I can submit one.
Grey Faulkenberry (Aug 17 2021 at 03:22):
Also my follow-up question to this, can I put labels in a ValueSet? If instead of having answerOptions, and then sub-items for the labels, is it possible to specify the following as an answerValueSet?
{
"resourceType": "ValueSet",
"id": "never_true_often_true",
"compose": {
"include": [
{
"concept": [
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/questionnaire-item-control",
"code": "lower",
"display": "Lower-Bound"
}
],
"text": "Never True"
}
},
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"code": "1",
"display": "1"
},
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"code": "2",
"display": "2"
},
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"code": "3",
"display": "3"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/questionnaire-item-control",
"code": "upper",
"display": "Upper-Bound"
}
],
"text": "Often True"
}
}
]
}
]
}
}
Lloyd McKenzie (Aug 17 2021 at 03:45):
ValueSets can't contain CodeableConcepts. However, they can contain codes with display values. But Questionnaire option codings can too. Certainly ValueSets can't contain item controls
Grey Faulkenberry (Aug 17 2021 at 14:24):
Alright, I think I understand. In order to have a question that renders something like this:
1 2 3
Never True O O O Always True
I would use this Questionnaire:
{
"resourceType": "Questionnaire",
"item": [
{
"linkId": "1",
"text": "I have lived with a parent/caregiver who went to jail/prison.",
"type": "choice",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation",
"valueCode": "horizontal"
}
],
"answerValueSet": "https://ValueSet/never_true_often_true",
"item": [
{
"linkId": "1.a",
"type": "display",
"text": "Never True",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/questionnaire-item-control",
"code": "lower",
"display": "Lower-Bound"
}
]
}
}
]
},
{
"linkId": "1.b",
"type": "display",
"text": "Always True",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/questionnaire-item-control",
"code": "upper",
"display": "Upper-Bound"
}
]
}
}
]
}
]
}
]
}
Along with this ValueSet
{
"resourceType": "ValueSet",
"id": "never_true_often_true",
"compose": {
"include": [
{
"concept": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"code": "1",
"display": "1"
},
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"code": "2",
"display": "2"
},
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"code": "3",
"display": "3"
}
]
}
]
}
}
Josh Mandel (Aug 17 2021 at 14:41):
What is the meaning of describing the lower and upper bound display text as items? With their own link ids? This is kind of breaking my mental model of what an item is -- but my mental model might not be very good :-)
Grey Faulkenberry (Aug 17 2021 at 15:00):
@Josh Mandel I'm probably not explaining it very well. I'm essentially trying to think of the best way to display a likert scale. So if it's like, how bad is your pain, 0-10, 0 being no pain at all, 10 being the worst pain you can possibly imagine...
No pain at all 0 1 2 3 4 5 6 7 8 9 10 Worst pain you can possibly imagine
Grey Faulkenberry (Aug 17 2021 at 15:01):
So in this case, the values that are allowed and being captured as answers are Integers (or Decimals), 0-10
Grey Faulkenberry (Aug 17 2021 at 15:02):
But I want to display labels at the beginning and end of the number choices
Lloyd McKenzie (Aug 17 2021 at 15:27):
@Josh Mandel Labels are managed as display items. Pretty much any text you see on a form is either question text, group text (i.e. a title), answer text or a display item.
Lloyd McKenzie (Aug 17 2021 at 15:28):
@Grey Faulkenberry That looks right to me.
Grey Faulkenberry (Aug 17 2021 at 15:28):
Thanks @Lloyd McKenzie! Sorry for all the questions.
Lloyd McKenzie (Aug 17 2021 at 15:34):
Don't be sorry - that's what this forum is for :) If you can think of things that would make the spec clearer, feel free to submit a change request
Grey Faulkenberry (Aug 17 2021 at 15:40):
I'm sure I'll come up with some as I begin to understand it more, so I definitely will!
Last updated: Apr 12 2022 at 19:14 UTC