Skip to content

Commit

Permalink
Merge pull request #313 from pharmaverse/covid270
Browse files Browse the repository at this point in the history
Covid270
  • Loading branch information
sarabodach authored May 22, 2024
2 parents 4c63e10 + f2f5438 commit 27894ae
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 67 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sdtmchecks
Title: Data Quality Checks for SDTM Datasets
Version: 0.1.10.9002
Version: 0.1.11
Authors@R:
person("Will", "Harris", , "[email protected]", role = c("aut", "cre"))
Description: Functions to identify common data issues in SDTM data. These checks are intended to be generalizable, actionable, and meaningful for analysis.
Expand Down
9 changes: 7 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# sdtmchecks 0.1.11 "Light Ice"

# sdtmchecks 0.1.10.9002 -- dev

## Metadata updates

* Re-create sdtmchecksmeta.RData with MedDRA dictionary version 27.0 listed instead of 26.1 ([#312](https://github.com/pharmaverse/sdtmchecks/issues/312))

## Misc package updates

* Unit test accompanying new CE check [`check_ce_missing_month()`](https://pharmaverse.github.io/sdtmchecks/reference/check_ce_missing_month.html) previously created by `@rymarinelli` added into tests/testthat subdirectory
* Fix minor typo in README ([#299](https://github.com/pharmaverse/sdtmchecks/issues/299))
* Add cran-comments.md ([#305](https://github.com/pharmaverse/sdtmchecks/pull/305))



# sdtmchecks 0.1.10 "Light Ice"

## Refinements of existing data check functions
Expand Down
102 changes: 51 additions & 51 deletions R/run_all_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,61 +50,61 @@ run_all_checks <- function(metads = sdtmchecksmeta,
type = c("ALL", "ONC", "COVID", "PRO", "OPHTH"),
verbose = TRUE,
ncores = 1) {

if (!is.null(priority) & !all(priority %in% c("High", "Medium", "Low"))) {
stop("priority argument should only take values 'High','Medium', or 'Low'")
}
if (!is.null(type) & !all(type %in% c("ALL", "ONC", "COVID", "PRO", "OPHTH"))) {
stop("type argument should only take values 'ALL', 'ONC', 'COVID', 'PRO', 'OPHTH'")
}

# subset meta dataset for specific Type and Priority
if (!is.null(priority)) {
metads <-subset(metads,metads$priority %in% priority)
}

if (!is.null(type) ) {
metads <-subset(metads, metads$category %in% type)
}

#Identify missing expected domains to cat out to the user later
expected.domains = sort(unique(strsplit(gsub(" ", "", paste(unique(metads$domains),
collapse=",")), ",")[[1]]))
missing.domains = expected.domains[!(expected.domains %in% ls(envir = .GlobalEnv))]

# Run checks

all_rec <- mcmapply(
FUN = run_check,
metads$check, metads$fxn_in, metads$xls_title, metads$pdf_title, metads$pdf_subtitle, metads$pdf_return,
verbose,
SIMPLIFY = FALSE, # forces mcmapply to return a list
USE.NAMES = TRUE, # generates list names
mc.cores = ncores

if (!is.null(priority) & !all(priority %in% c("High", "Medium", "Low"))) {
stop("priority argument should only take values 'High','Medium', or 'Low'")
}
if (!is.null(type) & !all(type %in% c("ALL", "ONC", "COVID", "PRO", "OPHTH"))) {
stop("type argument should only take values 'ALL', 'ONC', 'COVID', 'PRO', 'OPHTH'")
}

# subset meta dataset for specific Type and Priority
if (!is.null(priority)) {
metads <-subset(metads,metads$priority %in% priority)
}

if (!is.null(type) ) {
metads <-subset(metads, metads$category %in% type)
}

#Identify missing expected domains to cat out to the user later
expected.domains = sort(unique(strsplit(gsub(" ", "", paste(unique(metads$domains),
collapse=",")), ",")[[1]]))
missing.domains = expected.domains[!(expected.domains %in% ls(envir = .GlobalEnv))]

# Run checks

all_rec <- mcmapply(
FUN = run_check,
metads$check, metads$fxn_in, metads$xls_title, metads$pdf_title, metads$pdf_subtitle, metads$pdf_return,
verbose,
SIMPLIFY = FALSE, # forces mcmapply to return a list
USE.NAMES = TRUE, # generates list names
mc.cores = ncores
)

if (verbose == TRUE & length(missing.domains) > 0) {
cat(
paste0(
"\nDomain not found: ",
missing.domains,
". Checks requiring this domain were not run."
)
)

if (verbose == TRUE & length(missing.domains) > 0) {
cat(
paste0(
"\nDomain not found: ",
missing.domains,
". Checks requiring this domain were not run."
)
)
}

cat("\n")

if(!("covid_df" %in% ls(envir = .GlobalEnv))){
warning("An object named 'covid_df' was not found in your global environment so the following checks were not run:
}

cat("\n")

if(!("covid_df" %in% ls(envir = .GlobalEnv))){
warning("An object named 'covid_df' was not found in your global environment so the following checks were not run:
check_ae_aeacn_ds_disctx_covid
check_ae_aeacnoth_ds_stddisc_covid
check_dv_ae_aedecod_covid")
}
}

cat("\n")

# return the final list
return(all_rec)
} # end of function

} # end of function
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ reference:

news:
releases:
- text: "sdtmchecks 0.1.11"
href: news/index.html#sdtmchecks-0111-light-ice
- text: "sdtmchecks 0.1.10"
href: news/index.html#sdtmchecks-0110-light-ice
- text: "sdtmchecks 0.1.8"
Expand Down
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
0 errors ✔ | 0 warnings ✔ | 0 notes ✔
Binary file modified data/sdtmchecksmeta.RData
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/sdtmchecksmeta.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sdtmchecksmeta <- googlesheets4::read_sheet(sdtmchecksmeta_url)
# only update this in May and November when updating and re-running covid.R
## MedDRA &MEDDRV. COVID-19 SMQ (Narrow) --> MedDRA v23.1 COVID-19 SMQ (Narrow)

MEDDRV <- "v26.1"
MEDDRV <- "v27.0"
sdtmchecksmeta$pdf_subtitle <- gsub("&MEDDRV.", MEDDRV, sdtmchecksmeta$pdf_subtitle)


Expand Down
2 changes: 1 addition & 1 deletion man/check_ae_aelat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_oe_bcva_1m_late_early_tot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_oe_bcva_4m_late_early_tot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_oe_bcva_4m_vs_1m_req.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_oe_bcva_tot_mismatch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_oe_sc_lat_count_fingers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_pr_prlat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_sc_dm_eligcrit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/check_sc_dm_seyeselc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/staging_testthat/empty.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 27894ae

Please sign in to comment.