CHOP-CGTInformatics / REDCapTidieR

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

Add Data Access Group Support #153

Closed rsh52 closed 1 year ago

rsh52 commented 1 year ago

Description

This PR provides support for Data Access Groups (DAGs) primarily by introducing a new argument to read_redcap() in the form of export_data_access_groups which plugs directly into our REDCapR::redcap_read_oneshot() call (and is identical to the argument used there).

Unlike in redcap_read_oneshot(), I opted to make the default TRUE to both follow suit with export_survey_fields and because there's nothing to really lose if no DAGs are found. Instead, DAGs will be auto-added if they are detected and the same behavior exists in REDCapR (although the default there is FALSE).

To supplement this, two new REDCapTidieR test databases were made using DAGs for a non-longitudinal and a longitudinal database. Mocks were also updated, so you may want to add these environ vars to your files once you generate your own API keys (see /inst/misc/fake_credentials for names).

Proposed Changes

List changes below in bullet format:

Issue Addressed

Closes #57

PR Checklist

Before submitting this PR, please check and verify below that the submission meets the below criteria:

Code Review

This section to be used by the reviewer and developers during Code Review after PR submission

Code Review Checklist