OuhscBbmc / REDCapR

R utilities for interacting with REDCap
https://ouhscbbmc.github.io/REDCapR
Other
112 stars 45 forks source link

Handle trailing newline in REDCap checkbox options #502

Closed BlairCooper closed 11 months ago

BlairCooper commented 11 months ago

fixes #501

wibeasley commented 11 months ago

@BlairCooper, I've tagged you about this in two previous issues (#501 & #500). Can you respond to those?

wibeasley commented 11 months ago

@BlairCooper, sorry I missed your previous response in the other thread.

For this PR, the regex isn't working if the id is a negative number. I don't want to discourage you here if you're passionate about continuing a home-grown regex. But I think the two-step approach (of strsplit() and readr::read_csv()) will be more robust to most of these corner cases.

Screenshot of REDCap designer: image

String for test cases: https://github.com/OuhscBbmc/REDCapR/blob/982662bddd7f788d52d8b0ac06bccdf4fedcde58/tests/testthat/test-metadata-utilities.R#L37

wibeasley commented 11 months ago

@BlairCooper, it sounds like you're ok with the approach of #504, so I'm closing this PR. Please tell me if I'm wrong. I've moved this PR's new scenarios to the list of tests.