Handle a dropdownRange Input Field from an iDAI.field Resource
Source: R/simplify_utilities.R
handle_dropdownrange_input.RdFlattens a single dropdownRange-type field value from an iDAI.field
resource into a named list with two elements: <name>.start and
<name>.end. If only the start value exists, both <name>.start and
<name>.end are set to the start value.
Arguments
- dropdownRangeInput
The value of a single
dropdownRange-type field from a resource, i.e.periodfrom the default Configuration. Expects a list with at minimum avalueelement and optionally anendValue.- name
Character. The name of the field being processed (e.g.
"period"). Used to name the output elements as<name>.startand<name>.end.
Value
A named list with two elements:
.start The start value as a character string.
.end The end value as a character string, or the start value if no endValue was found.
Unexpected input formats return NA for both values.
See also
simplify_idaifield()which dispatches to this function.
Examples
if (FALSE) { # \dontrun{
handle_dropdownrange_input(list(value = "Classical"), "period")
# Current format, date range with time
handle_date_input(
list(value = "Classical", endValue = "Hellenistic"),
"period"
)
} # }