Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks done
rsh52 opened this issue Aug 12, 2022 · 3 comments
Open
5 tasks done

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

rsh52 opened this issue Aug 12, 2022 · 3 comments
Assignees
Labels
backlog not to be worked on now enhancement New feature or request

Comments

@rsh52
Copy link
Collaborator

rsh52 commented Aug 12, 2022

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

  • The issue is atomic
  • The issue description is documented
  • The issue title describes the problem succinctly
  • Developers are assigned to the issue
  • Labels are assigned to the issue
@rsh52 rsh52 added the enhancement New feature or request label Aug 12, 2022
@rsh52 rsh52 self-assigned this Aug 12, 2022
@skadauke skadauke changed the title [FEATURE] Tidy Metadata Intermediary Function [FEATURE] Implement a function to return project-wide metadata Aug 14, 2022
@skadauke
Copy link
Collaborator

It would be nice to also have the project title and project PID in this table. This will require a call to the "Export Project Information" method, for which there currently isn't a wrapper implemented in REDCapR. However, I've found that I can implement a minimal wrapper like this:

post_body <- 
  list(
    token = token,
    content = "project",
    format = "csv"
  )

kernel <- REDCapR:::kernel_api(redcap_uri, post_body, config_options = NULL)

d <- readr::read_csv(I(kernel$raw_text))

We could either contribute the wrapper to REDCapR or use the above code.

@skadauke
Copy link
Collaborator

It would be nice to also have the project title and project PID in this table. This will require a call to the "Export Project Information" method, for which there currently isn't a wrapper implemented in REDCapR. However, I've found that I can implement a minimal wrapper like this:

post_body <- 
  list(
    token = token,
    content = "project",
    format = "csv"
  )

kernel <- REDCapR:::kernel_api(redcap_uri, post_body, config_options = NULL)

d <- readr::read_csv(I(kernel$raw_text))

We could either contribute the wrapper to REDCapR or use the above code.

Sounds like Will is going to implement a wrapper inside REDCapR. Let's wait for it.

@skadauke
Copy link
Collaborator

See also this REDCapR issue

@rsh52 rsh52 added the backlog not to be worked on now label Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog not to be worked on now enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants