Skip to content
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

Add support for open-choice answerFormats in Questionnaire #689

Closed
Tracked by #523
fredhersch opened this issue Aug 8, 2021 · 2 comments · Fixed by #801
Closed
Tracked by #523

Add support for open-choice answerFormats in Questionnaire #689

fredhersch opened this issue Aug 8, 2021 · 2 comments · Fixed by #801
Assignees
Labels
P1 High priority issue type:enhancement New feature or request

Comments

@fredhersch
Copy link
Collaborator

fredhersch commented Aug 8, 2021

Is your feature request related to a problem? Please describe.
Current SDC library does not support open-choice option

Describe the solution you'd like
Able to provide open-choice as an item type. Specifying this will then implement the behaviour as per the specification

Additional context
Here is a sample Questionnaire that uses open-choice options - https://openhie.github.io/case-reporting-hiv-vn/Questionnaire-hiv-case-report-questionnaire.json.html

There are two scenarios to support:

1. No list to select from:
There are no choices to select from and open-choice just provides a text box and the answer is stored as a String

{ 
"linkId" : "confirming_lab",
 "text" : "Confirming lab", 
"type" : "open-choice", 
"repeats" : false 
},
  1. When there is an answerValueSet (or answerOptions) specified
    open-choice renders a selection list (e.g. a drop-down) with an 'other' option which is selected then shows a text box to be populated
    e.g here: there would be a list of occupations and an other option
{ "linkId" : "occupation", 
"text" : "Occupation", 
"type" : "open-choice", 
"repeats" : false, 
"answerValueSet" : "http://openhie.org/fhir/openhie.vn.case-reporting.hiv/ValueSet/vs-hiv-occupation"
 }

Ux designs

For option 1, this should just display a text field

For option 2, this should be a single choice set of options (drop down list or if repeats is true a set of checkboxes with an 'other' option.

  • Only 1 option can be selected
  • If 'other' is selected, it should enable a text box for completion. Only 1

Here are two designs:

  1. The first shows a drop-down list with Other as the option

Drop down list for open-choice

  1. The second is a set of check-boxes with other option

checkboxes with other for open-choice

@fredhersch fredhersch added type:enhancement New feature or request data-capture labels Aug 8, 2021
@fredhersch fredhersch added this to To do in Data capture library via automation Aug 8, 2021
@fredhersch
Copy link
Collaborator Author

@jingtang10 @Tarun-Bhardwaj for triaging

@fredhersch
Copy link
Collaborator Author

fredhersch commented Aug 24, 2021

Decision to implement as per the current spec:

"Answer is a Coding drawn from a list of possible answers (as with the choice type) or a free-text entry in a string (valueCoding or valueString)."

  1. Use autoComplete widget that can allow for free-text entry (if not selected from the list)
  2. If option is selected, use valueCoding, if free-text then valueString

Will explore adding a default valueCoding system to the extension and then treating free-text options as valueCoding. @costateixeira to propose to SDC group

cc: @jingtang10, costateixeira

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority issue type:enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants