CHOP-CGTInformatics / REDCapTidieR

Makes it easy to read REDCap Projects into R
https://chop-cgtinformatics.github.io/REDCapTidieR/
Other
33 stars 8 forks source link

[FEATURE] Include `select_choices_and_calculations` in metadata tibbles #108

Closed ezraporter closed 1 year ago

ezraporter commented 1 year ago

Feature Request Description

The elements of supertibble$redcap_metadata currently drop the select_choices_and_calculations column. We should include all fields returned in the metadata by the REDCap API.

Proposed Solution

Don't drop select_choices_and_calculations in add_metadata(). Note that this means that the content of select_choices_and_calculations would be duplicated across rows for checkbox fields like this:

field_name field_type select_choices_or_calculations
my_field__1 checkbox 1, 1 | 2, 2 | -99, Unknown
my_field__2 checkbox 1, 1 | 2, 2 | -99, Unknown
my_field__-99 checkbox 1, 1 | 2, 2 | -99, Unknown

Additional Context

This is where the change needs to be made + our (my?) original thinking: https://github.com/CHOP-CGTInformatics/REDCapTidieR/blob/51ced1e68d20652da0f8854cafeecef88ad2db73/R/read_redcap.R#L325-L328

Checklist