REDCapTidieR icon indicating copy to clipboard operation
REDCapTidieR copied to clipboard

[FEATURE] Implement a function to return project-wide metadata

Open rsh52 opened this issue 2 years ago • 3 comments

Feature Request Description

REDCapTidieR should have a function to return project-wide metadata, arranged in a tidy tibble.

Proposed Solution

Similar to read_redcap_tidy() output, we could look into making a read_redcap_metadata_tidy() function that returns a tibble. This tibble will probably have one row and include the following columns:

  • project_type: longitudinal or classic
  • arms: a tibble of arms and arm names, generated by REDCapR::redcap_arms. Skip if project doesn't have arms
  • events: a tibble of event/instrument mappings, generated by REDCapR::redcap_event_instruments
  • users: a tibble of users and project-wide permissions, generated by REDCapR::redcap_users_export (from $data object)
  • user_form_permissions: a tibble of users and instrument-specific permissions, generated by REDCapR::redcap_users_export (from $data_user_form object)
  • dags: a tibble of DAGs, generated by REDCapR::redcap_dag_read
  • version: the version of the REDCap instance, generated by REDCapR::redcap_version

Note: dag, users and user_form_permissions may contain sensitive information. I would suggest adding a toggle pull_user_info as a function argument, setting the default to FALSE.

More to be added as determined.

Alternatives considered

Metadata could be returned by the read_redcap_tidy function. However, this may be awkward for metadata that is not instrument specific.

Checklist

  • [x] The issue is atomic
  • [x] The issue description is documented
  • [x] The issue title describes the problem succinctly
  • [x] Developers are assigned to the issue
  • [x] Labels are assigned to the issue

rsh52 avatar Aug 12 '22 19:08 rsh52