OpenClinica / enketo-oc

OpenClinica's fork of the Enketo web forms monorepo
Apache License 2.0
0 stars 1 forks source link

Improved support for selection items with a value that is not currently in the choice list #101

Open pbowen-oc opened 3 years ago

pbowen-oc commented 3 years ago

Is your feature request related to a problem? Please describe. Sometimes data for a selection item may have been entered as a particular value. If the form definition is later changed such that the choice list no longer includes that value, when the form is reopened the item displays as if it is null. This is confusing to the user since the item does have a value (which Enketo recognizes), it's just that the value cannot be displayed as a specific label.

Describe the solution you'd like While Enketo can't know what choice label may have been intended for this value, it could let the user know the item has a value that isn't currently mapped to a label for the item. Potentially, this could include displaying the value the item currently has.

A general solution could be to display this as a message right below the item similar to a constraint message (although this condition would not by itself be an error condition).

Describe alternatives you've considered I thought about appearance-specific views, but this seems like a lot more work for little added value.

Additional context Many of our forms change over time, so this scenario is possible in many cases. Beyond the basic display option discussed above, it would be nice to have a way to have an unknown value for selection item treated as an error that would lead to auto-query generation. Essentially, have a condition that when the value is not in choice list, display an error message.