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

PD > IPD and display site activation / participant enrollment in study info. #1945

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

samussiah
Copy link
Contributor

Overview

Minor tweaks to:

  • 1_mappings/STUDY.yaml: Remove Label suffix
  • 2_metrics/cou0004.yaml: PD > IPD
  • 2_metrics/kri0004.yaml: PD > IPD
  • R/Report_StudyInfo.R: SiteCount > SiteActivation and ParticipantCount > ParticipantEnrollment
  • R/util-CountPercentage.R: works without target column

Test Notes/Sample Code

Connected Issues

Copy link
Collaborator

@zdz2101 zdz2101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things

@@ -15,15 +15,22 @@
#' @return A data frame containing two additional columns for the precentage value and associated string
#' @export
CalculatePercentage <- function(data, strCurrentCol, strTargetCol, strPercVal, strPercStrVal) {
if (!(strCurrentCol %in% names(data) & strTargetCol %in% names(data))) {
if (!(strCurrentCol %in% names(data))) {
cli::cli_abort("Check that both {strCurrentCol} and {strTargetCol} are in data")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cli::cli_abort("Check that both {strCurrentCol} and {strTargetCol} are in data")
cli::cli_abort("Check that {strCurrentCol} is in {data}")

} else {
data <- data %>%
dplyr::mutate(
{{ strPercStrVal }} := .data[[strCurrentCol]]
Copy link
Collaborator

@zdz2101 zdz2101 Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument name strPercStrVal feels a little deceiving here perhaps we should consider a renaming of the argument (?), and I could see why target/denominator numbers wouldn't be available soemtimes. If I'm interpreting correctly, if the denominator column isn't available you still want to be able to run this and return a new column which is just the numerator renamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that would be my preference - if the target column is missing set site activation and participant enrollment to the numerator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants