Stream: questionnaire
Topic: enableWhen with multi-language
Milton Mitjans (Feb 17 2022 at 01:34):
We have a FHIR Questionnaire resource where currently only supports one language. But we would like to support other languages. The system calls a CAAS (content as a service) to provide the question text / answer text.
When it becomes difficult is in the enableWhen behavior where it points to a valueString of an answer. Which would the best approach to handle multi-language on a valueString where it can support various languages? Could enableWhen reference a code on valueCoding?
For example:
{
"linkId": "workHours",
"text": "How many hours do you work?",
"type": "choice",
"answerOption": [
{
"valueString": "more than 8"
},
{
"valueString": "less than 8"
}
],
"enableWhen": [
{
"question": "doYouWork",
"operator": "=",
"answerString": "yes"
}
]
}
Lloyd McKenzie (Feb 17 2022 at 01:49):
In general, you should never have 'enableWhen' that's driven by valueString - valueString could be anything under the sun, written in any way and spelled (or misspelled) in any manner. If you want to drive something by enableWhen, the triggering answer(s) should be codes, integers, dates or something computable and guaranteed to be entered in a consistent manner. So, in your example of "doYouWork?" the answer should be of type 'choice' with values of 'yes' or 'no' or even an answerBoolean. valueString is for things like "What's your first name?" - something you presumably would never trigger logic off, except perhaps based on whether the value is populated or not.
Milton Mitjans (Feb 17 2022 at 01:55):
ok. If the doYouWork question is a choice type as shown below. But the valueString could change per language. Should we change the answerOption as valueCoding?
"answerOption": [
{
"valueString": "yes"
},
{
"valueString": "no"
]
}
Lloyd McKenzie (Feb 17 2022 at 04:02):
If you use valueCoding, you can keep the code consistent (which is what drives the enableWhen), while changing the display (which is what the user sees when they make their choice).
Brian Postlethwaite (Feb 17 2022 at 06:29):
We use value Coding for this all the time.
Last updated: Apr 12 2022 at 19:14 UTC