Refine REDCap metadata handling and package documentation#7
Merged
Conversation
Introduce get_choice_rows() and get_standard_repeating_instruments() to centralize choice parsing and normalize repeating-instrument metadata; move choice logic out of codebook and quality workflows. Rename get_record_status_data() to build_record_status_data() and update plot/Docs accordingly. Externalize codebook viewer CSS/JS into inst/codebook-viewer and register via htmlDependency; add snapshots and tests for viewer assets. Improve input validation, tidy NAMESPACE imports/exports, update DESCRIPTION and README/vignette, and add .lintr rules and .Rbuildignore entry.
rsh52
marked this pull request as ready for review
July 14, 2026 19:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR applies the package-wide review findings to simplify the implementation, strengthen REDCap metadata handling, and improve test and documentation coverage.
Proposed Changes
choice_typecolumn.REDCapR::redcap_instrument_repeating()as the repeating configuration source and align the codebook repeating output with REDCapR.build_record_status_data()and remove the deprecated compatibility function.Dependency Notes
REDCapRthat providesredcap_instrument_repeating().dplyr >= 1.1.0forcross_join().tidyrfrom Imports to Suggests because it is only used in tests.Validation
devtools::test(reporter = "summary")lintr::lint_package()air format --check .articles/quality-report.htmlgit diff --checkReview Notes
The codebook output shape changes intentionally:
choicesgainschoice_typeand includes implicit yes/no and true/false choices.repeatingremoves the redundantredcap_event_namecolumn and followsREDCapR::redcap_instrument_repeating()$data.No issue is linked to this review-driven change.