Skip to content

Refine REDCap metadata handling and package documentation#7

Merged
rsh52 merged 4 commits into
mainfrom
codex/package-review
Jul 14, 2026
Merged

Refine REDCap metadata handling and package documentation#7
rsh52 merged 4 commits into
mainfrom
codex/package-review

Conversation

@rsh52

@rsh52 rsh52 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

  • Refactor codebook construction around focused choice and repeating-instrument helpers.
  • Include checkbox, dropdown, radio, yes/no, and true/false fields in codebook choices, with a choice_type column.
  • Use REDCapR::redcap_instrument_repeating() as the repeating configuration source and align the codebook repeating output with REDCapR.
  • Move codebook CSS and JavaScript into package assets and cover their rendered contents with snapshots.
  • Rename the record-status dataset builder to build_record_status_data() and remove the deprecated compatibility function.
  • Simplify quality-report checks, improve realistic edge-case coverage, and refresh mock datasets.
  • Add a comprehensive quality-report article and expose it through the pkgdown Articles menu.
  • Add GitHub bug, feature, and pull-request templates; configure clean pkgdown deployments so obsolete pages are removed.
  • Tighten package imports, lint configuration, generated documentation, and README guidance.

Dependency Notes

  • Require the development version of REDCapR that provides redcap_instrument_repeating().
  • Require dplyr >= 1.1.0 for cross_join().
  • Move tidyr from Imports to Suggests because it is only used in tests.

Validation

  • devtools::test(reporter = "summary")
  • lintr::lint_package()
  • air format --check .
  • Full pkgdown site build, including articles/quality-report.html
  • git diff --check

Review Notes

The codebook output shape changes intentionally:

  • choices gains choice_type and includes implicit yes/no and true/false choices.
  • repeating removes the redundant redcap_event_name column and follows REDCapR::redcap_instrument_repeating()$data.

No issue is linked to this review-driven change.

rsh52 added 4 commits July 14, 2026 14:14
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 rsh52 self-assigned this Jul 14, 2026
@rsh52 rsh52 added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 14, 2026
@rsh52
rsh52 marked this pull request as ready for review July 14, 2026 19:09
@rsh52
rsh52 merged commit e245bb0 into main Jul 14, 2026
3 checks passed
@rsh52
rsh52 deleted the codex/package-review branch July 14, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant