Stream: questionnaire
Topic: Answer responses
Anubhav Gulati (Sep 30 2021 at 14:57):
Do we have some way to assign id for each question response. As an example, if there is a multi select check box question with multiple answer options .
Question - Which countries you have travelled ?
Answer Option -
a) US
b) India
c) Australia
d) New Zealand
Can I assign ID to these different answer responses for same question.
Lloyd McKenzie (Sep 30 2021 at 17:07):
Do you mean a code for each answer, or do you mean a unique id such that 'U.S.' when filled out in one QuestionnaireResponse would have a different identifier than 'U.S.' when filled out in a distinct QuestionnaireResponse, even when both responses are to the same Questionnaire?
Anubhav Gulati (Sep 30 2021 at 18:12):
Lloyd McKenzie said:
Do you mean a code for each answer, or do you mean a unique id such that 'U.S.' when filled out in one QuestionnaireResponse would have a different identifier than 'U.S.' when filled out in a distinct QuestionnaireResponse, even when both responses are to the same Questionnaire?
Thanks Lloyd for your reply.
Unique id to each answer options, even if the same answer option is present in multiple questions within same Questionnaire.
In the questionnaire, id should remain the same even if the question answer option gets updated.
For example
Question - How are you feeling ?
Answer option -
a) I am feeling good. (Is there a way to assign it a unique id ?)
b) I am not feeling good. (Is there a way to assign it a unique id ?)
In future, if I want to change the answer option from a) I am feeling good TO a) I am good,
my answer option id or unique id should not get changed on changing the description.
Thank You.
Lloyd McKenzie (Sep 30 2021 at 19:03):
It sounds like you just want a code and a display name. You can revise the display name provided that doing so doesn't shift the meaning too much. However, if you have exactly the same options for multiple questions, you'd typically want to use the same codes. E.g. if the options for questions 1-5 were "Agree" and "Disagree", you'd generally use the same codes for each question. You could, however, define distinct codes if you wanted to marry the semantic of the question and the answer. For example, you could have a code 123 with a definition of "Agree that chocolate is better than vanilla" and a display of just "Agree" in the context of your form.
Anubhav Gulati (Sep 30 2021 at 19:50):
I want a different code for answer options 'Agree' and 'Agree that chocolate is better than vanilla' because answer option will determine what next business rule should get executed.
Can we just have code as any incremental sequence number ? Or is there some better way to generate these codes ?
Also Is below the right implementation to assign a unique code to each answer option of a single question ?
answerOption":[
{
"valueCoding":{
"code":"1",
"display":"Awesome"
}
},
{
"valueCoding":{
"code":"2",
"display":"Good"
}
},
{
"valueCoding":{
"code":"3",
"display":"Bad"
}
}
]
Thanks.
Lloyd McKenzie (Sep 30 2021 at 19:59):
Answer option should be evaluated in the context of a specific question. I.e. you never look only at an answer, you always look at an answer in the context of a specific link id.
And yes, you could assign codes that way, though best practice is to define a code system for each code as well.
Anubhav Gulati (Oct 01 2021 at 10:48):
Thanks Lloyd. I agree for standard quesionnaire/questions we can define code system/codes. To follow best practice, How can we implement codes when we have an answer options which are not part of any standard questionnaire or questions. We don't know what codes need to be assigned to such questions or answer options., as these are not LOINC codes That's why I was thinking to just assign numeric number to each answer option.
Lloyd McKenzie (Oct 01 2021 at 17:03):
You're free to define your own CodeSystem(s) - possibly even contained within the Questionnaire. At least then the infrastructure for doing mappings would exist.
Anubhav Gulati (Oct 01 2021 at 19:09):
Thanks Lloyd foryour help.
Last updated: Apr 12 2022 at 19:14 UTC