Stream: questionnaire
Topic: Coding a scale 0-10
Marco Wedekind (Dec 17 2019 at 13:24):
I want to code the visual analogue scale (VAS) for pain intensity. It is a value between 0 "no pain" to 10 "worst imaginable pain". Its LOINC code, for example, would be 38214-3, see https://loinc.org/38214-3/.
I wonder how to code that value. I was looking at an example for QuestionnnaireResponse (http://hl7.org/fhir/STU3/questionnaireresponse-example-gcs.json) that encodes the Glasgow Coma Score. The example suggests to use the valueCoding element of an answer element to provide e.g. the LOINC code for VAS and then extend the valueCoding element to also hold the decimal / integer value for the VAS.
- Is that how it should be done?
- How would I encode the fact that only values between 0 and 10 are allowed for an answer element in the QuestionnaireResponse?
Marco Wedekind (Dec 17 2019 at 14:00):
w.r.t. 2) Structured Data Capture, http://hl7.org/fhir/uv/sdc/2019May/, defines extensions for minValue and maxValue of data elements. I guess this is the way to go then?
Paul Lynch (Dec 17 2019 at 18:48):
Are there images that go along with the choices?
You could use answerOption with valueInteger and enumerate the options.
Lloyd McKenzie (Dec 17 2019 at 22:54):
There's an ability to capture images (or a mix of images and text) using the HTML extension extension on the options
Paul Lynch (Dec 17 2019 at 23:43):
https://www.hl7.org/fhir/extension-rendering-xhtml.html
Paul Lynch (Dec 17 2019 at 23:47):
@Lloyd McKenzie This page: http://build.fhir.org/ig/HL7/sdc/rendering.html#text-appearance does not mention answerOption as a place rendering-xhtml can be.
Lloyd McKenzie (Dec 18 2019 at 02:47):
It can appear anywhere there's a string. I've submitted a change request to add it to choice.
Julian Sass (Dec 18 2019 at 09:33):
w.r.t. 2) Structured Data Capture, http://hl7.org/fhir/uv/sdc/2019May/, defines extensions for minValue and maxValue of data elements. I guess this is the way to go then?
I think the SDC extensions are the way to go. The Questionaire could look like this:
{ "status": "draft", "resourceType": "Questionnaire", "meta": { "profile": [ "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire|2.7" ] }, "item": [ { "type": "decimal", "code": [ { "code": "38214-3", "display": "Pain severity Score VAS", "system": "http://loinc.org" } ], "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/minValue", "valueDecimal": 0 }, { "url": "http://hl7.org/fhir/StructureDefinition/maxValue", "valueDecimal": 10 }, { "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit", "valueCoding": { "display": "{score}" } } ], "required": false, "linkId": "/38214-3", "text": "Pain severity Score VAS" } ] }
and the QuestionnaireResponse like this:
{ "resourceType": "QuestionnaireResponse", "meta": { "profile": [ "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse|2.7" ] }, "status": "completed", "authored": "2019-12-18T08:51:00.439Z", "item": [ { "linkId": "/38214-3", "text": "Pain severity Score VAS", "answer": [ { "valueDecimal": 3 } ] } ] }
Paul Lynch (Dec 18 2019 at 15:24):
@Julian Sass Note that the "decimal" type would allow for a response of "3.25". (Perhaps that is okay?)
Paul Lynch (Dec 18 2019 at 15:25):
It can appear anywhere there's a string. I've submitted a change request to add it to choice.
@Lloyd McKenzie What is the change request number? Although rendering-xhtml itself says it can apply to any string, there is nothing in the SDC specification to cause one to expect support for rendering-xhtml except in the enumerated cases.
Lloyd McKenzie (Dec 18 2019 at 16:33):
Julian Sass (Dec 18 2019 at 17:22):
Julian Sass Note that the "decimal" type would allow for a response of "3.25". (Perhaps that is okay?)
You're right @Paul Lynch. This should be an integer type to only allow 0-10 for a response.
Patrick Werner (Sep 04 2020 at 10:31):
How do we mark a VAS question that it should be rendered as VAS?
Grahame Grieve (Sep 04 2020 at 11:59):
VAS?
Morten Ernebjerg (Sep 04 2020 at 13:10):
Visual Analog Scale, a "psychometric response scale which can be used in questionnaires" (from link)
Morten Ernebjerg (Sep 04 2020 at 13:23):
@Patrick Werner We also also discussing exactly this at the moment. We are looking at reported pain values and encode the question using LOINC 72514-3 (Pain severity - 0-10 verbal numeric rating [Score] - Reported). That code has the associated answer set LOINC LL2335-9 (Numeric rating scale from 0-10 / Score of 0-10), which is the ValueSet with canonical http://loinc.org/vs/LL2335-9. I suppose one could take the use of this value set as the set of answers to a question as a hint to renders it as a 0-10 scale. However, as discussed in this recent thread in #terminology , the ValueSet does not carry the ordinal-value extension to indicate the numerical equivalent of each code, so the UI would have to know the (numeric) meaning of each code.
We are currently leaning toward the rather crude solution of using the item-control extension on the question, with a custom code to indicate that this is exactly such a scale result (and assume that the UI is clever enough to understand what that means, including the meaning of each LOINC code for 0-10). But I would also be happy to in hear about alternatives.
Lloyd McKenzie (Sep 04 2020 at 13:32):
Structured Data Capture provides guidance on the use of an extension to allow you to send parallel XHTML for the question. The XHTML can include an image reference. See the example here: http://build.fhir.org/ig/HL7/sdc/examples.html#using-answeroption-and-rendering-xhtml
Patrick Werner (Sep 04 2020 at 13:41):
0-10 numeric is different from a analog scale. (Pain VAS is often captured as a Integere from 0-100, as this represents the mm Value of the marked position.)
Patrick Werner (Sep 04 2020 at 13:42):
Lloyd McKenzie said:
Structured Data Capture provides guidance on the use of an extension to allow you to send parallel XHTML for the question. The XHTML can include an image reference. See the example here: http://build.fhir.org/ig/HL7/sdc/examples.html#using-answeroption-and-rendering-xhtml
Thanks, this is great for numeric scales, but doesn't cover analog scales.
Patrick Werner (Sep 04 2020 at 13:43):
As i didn't find a proper extension, we are currently thinking about a custom extension, containing a CC to express the desired "render-style"
Lloyd McKenzie (Sep 04 2020 at 15:53):
Sorry for not fully reading the answer properly. So the issue is you want to use a 'scale' control, even though the answers will technically be codes. If the associated codes have ordinal values, that could probably work - though we'd want to add some clarifying language in the item-control extension specifically highlighting that that was an allowed use.
Patrick Werner (Sep 04 2020 at 17:02):
Yes i want to express that the questionnaire should be rendered as a VAS. Answer would be Integer with min and max values.
Patrick Werner (Sep 04 2020 at 17:02):
example: image.png
Patrick Werner (Sep 04 2020 at 17:03):
the image above would be optional.
Brian Postlethwaite (Sep 04 2020 at 21:02):
Is that a linear slider control with no tics, or one that stops at exactly the 0,1,2..9,10 values from a coding?
Grahame Grieve (Sep 05 2020 at 03:38):
I think it would be good to have support for a VAS without having to do an image
Grahame Grieve (Sep 05 2020 at 03:38):
except that there's no way that's going to happen for the pain scale above. they're kind of special thouh
Patrick Werner (Sep 05 2020 at 09:09):
Brian Postlethwaite said:
Is that a linear slider control with no tics, or one that stops at exactly the 0,1,2..9,10 values from a coding?
no tics.
Patrick Werner (Sep 05 2020 at 09:11):
Grahame Grieve said:
except that there's no way that's going to happen for the pain scale above. they're kind of special thouh
It is. For the pain scale the "render this as VAS" and the image would have to be combined. Our primary use-case is just having a way to express VAS items in the Questionnaire, without any images.
Lloyd McKenzie (Sep 05 2020 at 13:59):
Is my understanding correct that you want to use a numeric scale control for data display/capture, but the data themselves are codes?
Patrick Werner (Oct 14 2020 at 09:10):
Normally a VAS reports its values as integer 0-100 or float: 0,0-10,0, so it is not coded data
Last updated: Apr 12 2022 at 19:14 UTC