Skip to content

Commit

Permalink
Hotfix 3.2.5 (#1101)
Browse files Browse the repository at this point in the history
* Alternative method of updating time id in andromeda objects (#1091)

* Fix exported null concepts in included_source_concept result

* Fix exported null concepts in included_source_concept result

* Update Migration_3-v3_2_0_suport_cohort_subsets.sql (#1086)

* fixed manual links

* added manual for link download

* Description and news

* addeed  readr::local_edition(1) to fix issue with vroom

* Description and news

* Java fix on linux platforms in shiny app

* package maintenance

* name source concept field

* table_prefix missing in migration

* Removed bad migrations
  • Loading branch information
azimov authored Dec 1, 2023
1 parent 76911f7 commit 03c40ab
Show file tree
Hide file tree
Showing 47 changed files with 113 additions and 69 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: CohortDiagnostics
Type: Package
Title: Diagnostics for OHDSI Cohorts
Version: 3.2.4
Date: 2022-12-19
Version: 3.2.5
Date: 2023-29-11
Authors@R: c(
person("Jamie", "Gilbert", email = "[email protected]", role = c("aut", "cre")),
person("Gowtham", "Rao", role = c("aut")),
Expand All @@ -25,7 +25,7 @@ Depends:
R (>= 4.1.0)
Imports:
Andromeda (>= 0.6.0),
ResultModelManager,
ResultModelManager (>= 0.5.2),
checkmate,
clock,
digest,
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
CohortDiagnostics 3.2.5
=======================
Bug Fixes:

1. fixed broken migrations using "ADD COLUMN "

2. Fixed broken links in manaual

3. Fixed issue with Andromeda calls in characterization on R 4.3.x

4. Fix for Vroom issue on mac

CohortDiagnostics 3.2.4
=======================
Bug Fix:
Expand Down
22 changes: 18 additions & 4 deletions R/CohortCharacterizationDiagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,15 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
"mean",
"sd"
)
if (length(is.na(covariates$timeId)) > 0) {
covariates[is.na(covariates$timeId), ]$timeId <- -1

tidNaCount <- covariates %>%
dplyr::filter(is.na(timeId)) %>%
dplyr::count() %>%
dplyr::pull()

if (tidNaCount > 0) {
covariates <- covariates %>%
dplyr::mutate(timeId = if_else(is.na(.data$timeId), -1, .data$timeId))
}
} else {
covariates <- covariates %>%
Expand Down Expand Up @@ -153,8 +160,15 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
"mean",
"sd"
)
if (length(is.na(covariates$timeId)) > 0) {
covariates[is.na(covariates$timeId), ]$timeId <- -1

tidNaCount <- covariates %>%
dplyr::filter(is.na(timeId)) %>%
dplyr::count() %>%
dplyr::pull()

if (tidNaCount > 0) {
covariates <- covariates %>%
dplyr::mutate(timeId = if_else(is.na(.data$timeId), -1, .data$timeId))
}
} else {
covariates <- covariates %>%
Expand Down
1 change: 1 addition & 0 deletions R/ConceptSets.R
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ runConceptSetDiagnostics <- function(connection,
}
if (nrow(subsetBreakdown) > 0) {
start <- Sys.time()
readr::local_edition(1)
domains <-
readr::read_csv(
system.file("csv", "domains.csv", package = utils::packageName()),
Expand Down
9 changes: 9 additions & 0 deletions R/Incremental.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ isTaskRequired <-
recordKeepingFile,
verbose = TRUE) {
if (file.exists(recordKeepingFile)) {
readr::local_edition(1)
recordKeeping <- readr::read_csv(recordKeepingFile,
col_types = readr::cols(),
guess_max = min(1e7),
Expand Down Expand Up @@ -64,6 +65,7 @@ isTaskRequired <-
getRequiredTasks <- function(..., checksum, recordKeepingFile) {
tasks <- list(...)
if (file.exists(recordKeepingFile) && length(tasks[[1]]) > 0) {
readr::local_edition(1)
recordKeeping <- readr::read_csv(recordKeepingFile,
col_types = readr::cols(),
guess_max = min(1e7),
Expand Down Expand Up @@ -112,6 +114,7 @@ recordTasksDone <-
}

if (file.exists(recordKeepingFile)) {
readr::local_edition(1)
# reading record keeping file into memory
# prevent lazy loading to avoid lock on file
recordKeeping <- readr::read_csv(
Expand Down Expand Up @@ -142,6 +145,7 @@ recordTasksDone <-
newRow$checksum <- checksum
newRow$timeStamp <- as.character(Sys.time())
recordKeeping <- dplyr::bind_rows(recordKeeping, newRow)
readr::local_edition(1)
readr::write_csv(x = recordKeeping, file = recordKeepingFile, na = "")
}

Expand Down Expand Up @@ -171,6 +175,7 @@ writeToCsv.default <- function(data, fileName, incremental = FALSE, ...) {
} else {
ParallelLogger::logDebug("creating ", fileName)
}
readr::local_edition(1)
readr::write_excel_csv(
x = data,
file = fileName,
Expand All @@ -194,11 +199,13 @@ writeToCsv.tbl_Andromeda <-
tempName <- paste0(fileName, "2")

processChunk <- function(chunk, pos) {
readr::local_edition(1)
chunk <- chunk %>%
dplyr::filter(!.data$cohort_id %in% cohortIds)
readr::write_csv(chunk, tempName, append = (pos != 1))
}

readr::local_edition(1)
readr::read_csv_chunked(
file = fileName,
callback = processChunk,
Expand Down Expand Up @@ -246,6 +253,7 @@ writeToCsv.tbl_Andromeda <-
if (first) {
colnames(batch) <- SqlRender::camelCaseToSnakeCase(colnames(batch))
}
readr::local_edition(1)
readr::write_csv(batch, fileName, append = !first)
}
Andromeda::batchApply(data, writeToFile)
Expand All @@ -259,6 +267,7 @@ saveIncremental <- function(data, fileName, ...) {
}
}
if (file.exists(fileName)) {
readr::local_edition(1)
previousData <- readr::read_csv(fileName,
col_types = readr::cols(),
guess_max = min(1e7),
Expand Down
2 changes: 2 additions & 0 deletions R/Private.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ enforceMinCellValue <-
#' Throws an error if the input file does not have the correct encoding.
#'
checkInputFileEncoding <- function(fileName) {
readr::local_edition(1)
encoding <- readr::guess_encoding(file = fileName, n_max = min(1e7))

if (!encoding$encoding[1] %in% c("UTF-8", "ASCII")) {
Expand Down Expand Up @@ -318,6 +319,7 @@ timeExecution <- function(exportFolder,
start = NA,
execTime = NA,
expr = NULL) {
readr::local_edition(1)
executionTimePath <- file.path(exportFolder, "executionTimes.csv")
if (is.na(start)) {
start <- Sys.time()
Expand Down
1 change: 1 addition & 0 deletions R/ResultsDataModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#'
#' @export
getResultsDataModelSpecifications <- function() {
readr::local_edition(1)
pathToCsv <-
system.file("settings", "resultsDataModelSpecification.csv", package = utils::packageName())
resultsDataModelSpecifications <-
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ Documentation can be found on the [package website](https://ohdsi.github.io/Coho

PDF versions of the documentation are also available:

* Package manual: [CohortDiagnostics manual](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/master/extras/CohortDiagnostics.pdf)
* Vignette: [What is Cohort Diagnostics](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/master/inst/doc/WhatIsCohortDiagnostics.pdf)
* Vignette: [Running Cohort Diagnostics](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/master/inst/doc/RunningCohortDiagnostics.pdf)
* Vignette: [Viewing Results Using Diagnostics Explorer](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/master/inst/doc/ViewingResultsUsingDiagnosticsExplorer.pdf)
* Package manual: [CohortDiagnostics manual](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/main/extras/CohortDiagnostics.pdf)
* Vignette: [What is Cohort Diagnostics](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/main/inst/doc/WhatIsCohortDiagnostics.pdf)
* Vignette: [Running Cohort Diagnostics](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/main/inst/doc/RunningCohortDiagnostics.pdf)
* Vignette: [Viewing Results Using Diagnostics Explorer](https://raw.githubusercontent.com/OHDSI/CohortDiagnostics/main/inst/doc/ViewingResultsUsingDiagnosticsExplorer.pdf)


Support
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

4 changes: 2 additions & 2 deletions docs/articles/CreatingAStudyPackage.html

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

4 changes: 2 additions & 2 deletions docs/articles/DatabaseModeInDiagnosticsExplorer.html

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

6 changes: 3 additions & 3 deletions docs/articles/RunningCohortDiagnostics.html

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

4 changes: 2 additions & 2 deletions docs/articles/ViewingResultsUsingDiagnosticsExplorer.html

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

4 changes: 2 additions & 2 deletions docs/articles/WhatIsCohortDiagnostics.html

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

2 changes: 1 addition & 1 deletion docs/articles/index.html

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

7 changes: 4 additions & 3 deletions docs/authors.html

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

10 changes: 5 additions & 5 deletions docs/index.html

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

10 changes: 9 additions & 1 deletion docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ articles:
RunningCohortDiagnostics: RunningCohortDiagnostics.html
ViewingResultsUsingDiagnosticsExplorer: ViewingResultsUsingDiagnosticsExplorer.html
WhatIsCohortDiagnostics: WhatIsCohortDiagnostics.html
last_built: 2023-09-19T21:26Z
last_built: 2023-11-30T21:46Z

2 changes: 1 addition & 1 deletion docs/reference/CohortDiagnostics-package.html

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

Loading

0 comments on commit 03c40ab

Please sign in to comment.