-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
answerOption.valueString
crashes SDC library
#1360
Comments
answerOption.valueString
crashes libraryanswerOption.valueString
crashes SDC library
An example where a valueInterger would be useful. While strings are dubious, because Codings are better instead, supporting integers is quite necessary: {
"linkId": "EORTC-QLQ-Q29-Q30",
"type": "group",
"text": "For the following questions please select the number between 1 and 7 that best applies to you, with 1 = Very poor and 7 = Excellent.",
"item": [
{
"linkId": "EORTCQLQC30_Q29",
"type": "choice",
"text": "How would you rate your overall health during the past week?",
"required": true,
"answerOption": [
{
"valueInteger": 1
},
{
"valueInteger": 2
},
{
"valueInteger": 3
},
{
"valueInteger": 4
},
{
"valueInteger": 5
},
{
"valueInteger": 6
},
{
"valueInteger": 7
}
]
}, |
thanks very much for raising this @vadi2 - @santosh-pingle is working on this |
this is related (but different) to #1098. @santosh-pingle please also see the fhir chat discussion: https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Answer.20value.20set.20and.20answers.20as.20string |
@jingtang10 e.g
|
so the answer type in the questionnaire response item needs to agree with the type of the questionnaire item. that's the only requirement as far as i can see. additionally, the type of the answer option needs to agree with the type of the questionnaire item. |
I think one consequence of this issue is that if we have a string/integer/date/time/whatever questionnaire item with answer options, we should render it using a "choice" widget such as dropdown. at the moment we pick the widget using the questionnaire type (e.g. if it's a string, we have text input, if it's date, we have a date picker) but it seems we need to have some logic to override that and say if any questionnaire item has answer options, we probably should use dropdown. @vadi2 is this what other form fillers do? |
Describe the bug
Loading a questionnaire with
answerOption.valueString
instead ofanswerOption.valueCoding
as the library expects causes a crash. valueStrings and other types are perfectly legitimate options per the spec, however.Component
SDC library & reference app.
To Reproduce
Additional context
Sample questionnaire:
The text was updated successfully, but these errors were encountered: