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

[BUG] Package does not support forms used in both repeating and non-repeating contexts #176

Closed mike-caarg closed 8 months ago

mike-caarg commented 9 months ago

Expected Behavior

When a form is used in both a repeating and non-repeating manner, I expect REDCapTidieR to know the difference and partition the data accordingly

Current Behavior

Currently, if a form is used in both a repeating and non-repeating manner, REDCapTidieR throws an error.

How to Reproduce the Bug:

Screenshots

Example output from using "read_redcap()" on a database with a form used in repeating and non-repeating contexts

> db <- REDCapTidieR::read_redcap(api$uri, api$token)
Error in `clean_redcap_long()`:                                                                                                                                                                                                                     
✖ Instruments detected that have both repeating and nonrepeating instances defined in the project:

Failure Logs

NA

Checklist

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

rsh52 commented 9 months ago

Hi @mike-caarg, thank you for raising this to our attention. You can see our discussion in another issue #169

It was intended originally to keep this as a barrier due to conflicts between tidy data principles and REDCap database design. However, we will likely be looking into a solution to help with this for v1.1.

rsh52 commented 8 months ago

@mike-caarg, @brianmsm, @bcuer (from issue #169 )

Can you try the development version on REDCapTidieR on main now with your respective databases and use allow_mixed_structure = TRUE to see if it handles your use cases? When allowed, non-repeating versions of mixed-structure instruments should appear in repeating tibbles as single repeating instances.

Please use below to install:

devtools::install_github("CHOP-CGTInformatics/REDCapTidieR")

Thank you!

brianmsm commented 8 months ago

Hi @rsh52 Great! it works. Everything is fine. Thank you very much for your work

rsh52 commented 8 months ago

Hi @mike-caarg and @bcuer, is there any chance we can get confirmation from you as well? We would like to submit a new release of the package at the end of this week.

bcuer commented 8 months ago

Hi, Thank you for adding the functionality. It's perfect, everything works correctly on our test data.

mike-caarg commented 8 months ago

Hi, I have not had time for extensive testing, but this seems to fix this issue! Thanks!

rsh52 commented 8 months ago

Thank you all! Considering this closed from #177