diff --git a/DESCRIPTION b/DESCRIPTION
index fddffaee2..81daa817c 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: CohortDiagnostics
Type: Package
Title: Diagnostics for OHDSI Cohorts
-Version: 3.2.4
+Version: 3.3.0
Date: 2022-12-19
Authors@R: c(
person("Jamie", "Gilbert", email = "gilbert@ohdsi.org", role = c("aut", "cre")),
@@ -25,7 +25,7 @@ Depends:
R (>= 4.1.0)
Imports:
Andromeda (>= 0.6.0),
- ResultModelManager,
+ ResultModelManager (>= 0.5.2),
checkmate,
clock,
digest,
@@ -50,14 +50,16 @@ Suggests:
zip,
knitr,
shiny,
- OhdsiShinyModules
+ OhdsiShinyModules,
+ rsconnect,
+ yaml
Remotes:
ohdsi/Eunomia,
ohdsi/FeatureExtraction,
ohdsi/ResultModelManager,
ohdsi/ROhdsiWebApi,
ohdsi/CirceR,
- ohdsi/CohortGenerator,
+ ohdsi/CohortGenerator@random_sample,
ohdsi/OhdsiShinyModules
License: Apache License
VignetteBuilder: knitr
diff --git a/NAMESPACE b/NAMESPACE
index 2626704ae..883dc22a9 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -3,6 +3,7 @@
export(createDiagnosticsExplorerZip)
export(createMergedResultsFile)
export(createResultsDataModel)
+export(deployPositConnectApp)
export(executeDiagnostics)
export(getCdmDataSourceInformation)
export(getCohortCounts)
diff --git a/NEWS.md b/NEWS.md
index 92ea27cad..67404baf1 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,22 @@
+CohortDiagnostics 3.3.0
+=======================
+
+Changes:
+
+1. Resolved issues with package creating build errors
+
+2. Added function to make deployment to posit connect servers easier
+
+3. Added ability to use CohortGenerator sample functionality to executeDiagnostics which speeds up execution for very
+large cohort definitions
+
+Bug fix:
+
+1. Fixes to loading shiny app in OHDSI shiny modules
+
+2. Bug fixes to prevent null value issues with included source concept diagnostics
+
+
CohortDiagnostics 3.2.4
=======================
Bug Fix:
diff --git a/R/CohortCharacterizationDiagnostics.R b/R/CohortCharacterizationDiagnostics.R
index 2878ab9c0..030e0c765 100644
--- a/R/CohortCharacterizationDiagnostics.R
+++ b/R/CohortCharacterizationDiagnostics.R
@@ -82,11 +82,11 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
covariates <- featureExtractionOutput$covariates %>%
dplyr::rename("cohortId" = "cohortDefinitionId") %>%
dplyr::left_join(populationSize, by = "cohortId", copy = TRUE) %>%
- dplyr::mutate(p = sumValue / populationSize)
+ dplyr::mutate(p = .data$sumValue / populationSize)
if (nrow(covariates %>%
- dplyr::filter(p > 1) %>%
- dplyr::collect()) > 0) {
+ dplyr::filter(.data$p > 1) %>%
+ dplyr::collect()) > 0) {
stop(
paste0(
"During characterization, population size (denominator) was found to be smaller than features Value (numerator).",
@@ -96,10 +96,10 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
}
covariates <- covariates %>%
- dplyr::mutate(sd = sqrt(p * (1 - p))) %>%
- dplyr::select(-p) %>%
+ dplyr::mutate(sd = sqrt(.data$p * (1 - .data$p))) %>%
+ dplyr::select(-"p") %>%
dplyr::rename("mean" = "averageValue") %>%
- dplyr::select(-populationSize)
+ dplyr::select(-"populationSize")
if (FeatureExtraction::isTemporalCovariateData(featureExtractionOutput)) {
covariates <- covariates %>%
@@ -113,13 +113,13 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
)
tidNaCount <- covariates %>%
- dplyr::filter(is.na(timeId)) %>%
+ dplyr::filter(is.na(.data$timeId)) %>%
dplyr::count() %>%
dplyr::pull()
if (tidNaCount > 0) {
covariates <- covariates %>%
- dplyr::mutate(timeId = if_else(is.na(.data$timeId), -1, .data$timeId))
+ dplyr::mutate(timeId = dplyr::if_else(is.na(.data$timeId), -1, .data$timeId))
}
} else {
covariates <- covariates %>%
@@ -144,9 +144,9 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
dplyr::pull(dplyr::count(featureExtractionOutput$covariatesContinuous)) > 0) {
covariates <- featureExtractionOutput$covariatesContinuous %>%
dplyr::rename(
- mean = averageValue,
- sd = standardDeviation,
- cohortId = cohortDefinitionId
+ mean = "averageValue",
+ sd = "standardDeviation",
+ cohortId = "cohortDefinitionId"
)
covariatesContinuous <- covariates
if (FeatureExtraction::isTemporalCovariateData(featureExtractionOutput)) {
@@ -162,13 +162,13 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
)
tidNaCount <- covariates %>%
- dplyr::filter(is.na(timeId)) %>%
+ dplyr::filter(is.na(.data$timeId)) %>%
dplyr::count() %>%
dplyr::pull()
if (tidNaCount > 0) {
covariates <- covariates %>%
- dplyr::mutate(timeId = if_else(is.na(.data$timeId), -1, .data$timeId))
+ dplyr::mutate(timeId = dplyr::if_else(is.na(.data$timeId), -1, .data$timeId))
}
} else {
covariates <- covariates %>%
@@ -235,7 +235,7 @@ executeCohortCharacterization <- function(connection,
startCohortCharacterization <- Sys.time()
subset <- subsetToRequiredCohorts(
cohorts = cohorts %>%
- dplyr::filter(cohortId %in% instantiatedCohorts),
+ dplyr::filter(.data$cohortId %in% instantiatedCohorts),
task = task,
incremental = incremental,
recordKeepingFile = recordKeepingFile
@@ -286,7 +286,7 @@ executeCohortCharacterization <- function(connection,
tempEmulationSchema = tempEmulationSchema,
cohortDatabaseSchema = cohortDatabaseSchema,
cohortTable = cohortTable,
- cohortIds = subset[start:end,]$cohortId,
+ cohortIds = subset[start:end, ]$cohortId,
covariateSettings = covariateSettings,
cdmVersion = cdmVersion,
exportFolder = exportFolder
@@ -308,9 +308,9 @@ executeCohortCharacterization <- function(connection,
)
recordTasksDone(
- cohortId = subset[start:end,]$cohortId,
+ cohortId = subset[start:end, ]$cohortId,
task = task,
- checksum = subset[start:end,]$checksum,
+ checksum = subset[start:end, ]$checksum,
recordKeepingFile = recordKeepingFile,
incremental = incremental
)
diff --git a/R/CohortRelationship.R b/R/CohortRelationship.R
index ed56c1f01..b7b3ee194 100644
--- a/R/CohortRelationship.R
+++ b/R/CohortRelationship.R
@@ -85,7 +85,7 @@ runCohortRelationshipDiagnostics <-
timePeriods <- relationshipDays %>%
dplyr::distinct() %>%
- dplyr::arrange(startDay, endDay) %>%
+ dplyr::arrange(.data$startDay, .data$endDay) %>%
dplyr::mutate(timeId = dplyr::row_number())
ParallelLogger::logTrace(" - Creating Andromeda object to collect results")
@@ -161,12 +161,12 @@ runCohortRelationshipDiagnostics <-
resultsInAndromeda$cohortRelationships <-
resultsInAndromeda$cohortRelationships %>%
dplyr::inner_join(resultsInAndromeda$timePeriods, by = "timeId") %>%
- dplyr::select(-timeId) %>%
+ dplyr::select(-"timeId") %>%
dplyr::arrange(
- cohortId,
- comparatorCohortId,
- startDay,
- endDay
+ .data$cohortId,
+ .data$comparatorCohortId,
+ .data$startDay,
+ .data$endDay
)
resultsInAndromeda$timePeriods <- NULL
@@ -209,21 +209,21 @@ executeCohortRelationshipDiagnostics <- function(connection,
startCohortRelationship <- Sys.time()
allCohortIds <- cohortDefinitionSet %>%
- dplyr::select(cohortId, checksum) %>%
+ dplyr::select("cohortId", "checksum") %>%
dplyr::rename(
- targetCohortId = cohortId,
- targetChecksum = checksum
+ targetCohortId = "cohortId",
+ targetChecksum = "checksum"
) %>%
dplyr::distinct()
combinationsOfPossibleCohortRelationships <- allCohortIds %>%
tidyr::crossing(allCohortIds %>%
dplyr::rename(
- comparatorCohortId = targetCohortId,
- comparatorChecksum = targetChecksum
+ comparatorCohortId = "targetCohortId",
+ comparatorChecksum = "targetChecksum"
)) %>%
- dplyr::filter(targetCohortId != comparatorCohortId) %>%
- dplyr::arrange(targetCohortId, comparatorCohortId) %>%
- dplyr::mutate(checksum = paste0(targetChecksum, comparatorChecksum))
+ dplyr::filter(.data$targetCohortId != .data$comparatorCohortId) %>%
+ dplyr::arrange(.data$targetCohortId, .data$comparatorCohortId) %>%
+ dplyr::mutate(checksum = paste0(.data$targetChecksum, .data$comparatorChecksum))
subset <- subsetToRequiredCombis(
combis = combinationsOfPossibleCohortRelationships,
@@ -247,7 +247,7 @@ executeCohortRelationshipDiagnostics <- function(connection,
(nrow(combinationsOfPossibleCohortRelationships) - (
nrow(
combinationsOfPossibleCohortRelationships %>%
- dplyr::filter(targetCohortId %in% c(subset$targetCohortId))
+ dplyr::filter(.data$targetCohortId %in% c(subset$targetCohortId))
)
)) > 0) {
ParallelLogger::logInfo(
@@ -255,7 +255,7 @@ executeCohortRelationshipDiagnostics <- function(connection,
" - Skipping %s combinations in incremental mode because these were previously computed.",
nrow(combinationsOfPossibleCohortRelationships) - nrow(
combinationsOfPossibleCohortRelationships %>%
- dplyr::filter(targetCohortId %in% c(subset$targetCohortId))
+ dplyr::filter(.data$targetCohortId %in% c(subset$targetCohortId))
)
)
)
diff --git a/R/ConceptSets.R b/R/ConceptSets.R
index 141a1e89c..95f1991e3 100644
--- a/R/ConceptSets.R
+++ b/R/ConceptSets.R
@@ -20,6 +20,9 @@ extractConceptSetsSqlFromCohortSql <- function(cohortSql) {
}
sql <- gsub("with primary_events.*", "", cohortSql)
+ if (is.null(sql) || length(nchar(sql)) == 0 || is.na(nchar(sql)) || is.nan(nchar(sql))) {
+ return(tidyr::tibble())
+ }
# Find opening and closing parentheses:
starts <- stringr::str_locate_all(sql, "\\(")[[1]][, 1]
ends <- stringr::str_locate_all(sql, "\\)")[[1]][, 1]
@@ -71,8 +74,14 @@ extractConceptSetsSqlFromCohortSql <- function(cohortSql) {
extractConceptSetsJsonFromCohortJson <- function(cohortJson) {
- cohortDefinition <-
- RJSONIO::fromJSON(content = cohortJson, digits = 23)
+ cohortDefinition <- tryCatch(
+ {
+ RJSONIO::fromJSON(content = cohortJson, digits = 23)
+ },
+ error = function(msg) {
+ return(list())
+ }
+ )
if ("expression" %in% names(cohortDefinition)) {
expression <- cohortDefinition$expression
} else {
@@ -121,10 +130,10 @@ combineConceptSetsFromCohorts <- function(cohorts) {
checkmate::reportAssertions(errorMessage)
checkmate::assertDataFrame(
x = cohorts %>% dplyr::select(
- cohortId,
- sql,
- json,
- cohortName
+ "cohortId",
+ "sql",
+ "json",
+ "cohortName"
),
any.missing = FALSE,
min.cols = 4,
@@ -176,7 +185,7 @@ combineConceptSetsFromCohorts <- function(cohorts) {
}
}
if (length(conceptSets) == 0) {
- return(NULL)
+ return(data.frame())
}
conceptSets <- dplyr::bind_rows(conceptSets) %>%
dplyr::arrange(.data$cohortId, .data$conceptSetId)
@@ -187,7 +196,10 @@ combineConceptSetsFromCohorts <- function(cohorts) {
dplyr::distinct()
conceptSets <- conceptSets %>%
- dplyr::inner_join(uniqueConceptSets, by = "conceptSetExpression") %>%
+ dplyr::inner_join(uniqueConceptSets,
+ by = "conceptSetExpression",
+ relationship = "many-to-many"
+ ) %>%
dplyr::distinct() %>%
dplyr::relocate(
"uniqueConceptSetId",
@@ -321,7 +333,7 @@ getCodeSetIds <- function(criterionList) {
return(NULL)
} else {
return(dplyr::tibble(domain = names(criterionList), codeSetIds = codeSetIds)
- %>% dplyr::filter(!is.na(codeSetIds)))
+ %>% dplyr::filter(!is.na(.data$codeSetIds)))
}
}
@@ -330,11 +342,17 @@ exportConceptSets <- function(cohortDefinitionSet, exportFolder, minCellCount, d
# We need to get concept sets from all cohorts in case subsets are present and
# Added incrementally after cohort generation
conceptSets <- combineConceptSetsFromCohorts(cohortDefinitionSet)
+
+ if (!hasData(conceptSets)) {
+ return(invisible(NULL))
+ }
+
+ conceptSets <- conceptSets %>%
+ dplyr::select(-"uniqueConceptSetId") %>%
+ dplyr::distinct()
# Save concept set metadata ---------------------------------------
conceptSetsExport <- makeDataExportable(
- x = conceptSets %>%
- dplyr::select(-uniqueConceptSetId) %>%
- dplyr::distinct(),
+ x = conceptSets,
tableName = "concept_sets",
minCellCount = minCellCount,
databaseId = databaseId
@@ -404,7 +422,7 @@ runConceptSetDiagnostics <- function(connection,
subset <- dplyr::distinct(subset)
if (nrow(subset) == 0) {
- return()
+ return(NULL)
}
# We need to get concept sets from all cohorts in case subsets are present and
@@ -514,7 +532,8 @@ runConceptSetDiagnostics <- function(connection,
"cohortId",
"conceptSetId"
) %>% dplyr::distinct(),
- by = "uniqueConceptSetId"
+ by = "uniqueConceptSetId",
+ relationship = "many-to-many"
) %>%
dplyr::select(-"uniqueConceptSetId") %>%
dplyr::mutate(databaseId = !!databaseId) %>%
@@ -664,7 +683,7 @@ runConceptSetDiagnostics <- function(connection,
)
return(tidyr::tibble())
}
- primaryCodesetIds <- primaryCodesetIds %>% dplyr::filter(domain %in%
+ primaryCodesetIds <- primaryCodesetIds %>% dplyr::filter(.data$domain %in%
c(domains$domain %>% unique()))
if (nrow(primaryCodesetIds) == 0) {
warning(
@@ -927,7 +946,8 @@ runConceptSetDiagnostics <- function(connection,
"cohortId",
"conceptSetId"
) %>% dplyr::distinct(),
- by = "uniqueConceptSetId"
+ by = "uniqueConceptSetId",
+ relationship = "many-to-many"
) %>%
dplyr::select(-"uniqueConceptSetId") %>%
dplyr::select(
@@ -943,8 +963,8 @@ runConceptSetDiagnostics <- function(connection,
.data$conceptId
) %>%
dplyr::summarise(
- conceptCount = max(conceptCount),
- conceptSubjects = max(conceptSubjects)
+ conceptCount = max(.data$conceptCount),
+ conceptSubjects = max(.data$conceptSubjects)
) %>%
dplyr::ungroup()
data <- makeDataExportable(
@@ -1012,7 +1032,8 @@ runConceptSetDiagnostics <- function(connection,
dplyr::tibble() %>%
dplyr::rename("uniqueConceptSetId" = "codesetId") %>%
dplyr::inner_join(conceptSets %>% dplyr::distinct(),
- by = "uniqueConceptSetId"
+ by = "uniqueConceptSetId",
+ relationship = "many-to-many"
) %>%
dplyr::select(
"cohortId",
diff --git a/R/ExportCharacterization.R b/R/ExportCharacterization.R
index c82a1f9bb..62ffe1d94 100644
--- a/R/ExportCharacterization.R
+++ b/R/ExportCharacterization.R
@@ -31,7 +31,7 @@ exportCharacterization <- function(characteristics,
} else if (dplyr::pull(dplyr::count(characteristics$covariateRef)) > 0) {
characteristics$filteredCovariates <-
characteristics$covariates %>%
- dplyr::filter(mean >= minCharacterizationMean) %>%
+ dplyr::filter(.data$mean >= minCharacterizationMean) %>%
dplyr::mutate(databaseId = !!databaseId) %>%
dplyr::left_join(counts,
by = c("cohortId", "databaseId"),
@@ -39,22 +39,22 @@ exportCharacterization <- function(characteristics,
) %>%
dplyr::mutate(
mean = dplyr::if_else(
- mean != 0 & mean < minCellCount / as.numeric(cohortEntries),
- -minCellCount / as.numeric(cohortEntries),
- mean
+ .data$mean != 0 & .data$mean < minCellCount / as.numeric(.data$cohortEntries),
+ -minCellCount / as.numeric(.data$cohortEntries),
+ .data$mean
),
sumValue = dplyr::if_else(
- sumValue != 0 & sumValue < minCellCount,
+ .data$sumValue != 0 & .data$sumValue < minCellCount,
-minCellCount,
- sumValue
+ .data$sumValue
)
) %>%
- dplyr::mutate(sd = dplyr::if_else(mean >= 0, sd, 0)) %>%
+ dplyr::mutate(sd = dplyr::if_else(mean >= 0, .data$sd, 0)) %>%
dplyr::mutate(
- mean = round(mean, digits = 4),
- sd = round(sd, digits = 4)
+ mean = round(.data$mean, digits = 4),
+ sd = round(.data$sd, digits = 4)
) %>%
- dplyr::select(-cohortEntries, -cohortSubjects) %>%
+ dplyr::select(-"cohortEntries", -"cohortSubjects") %>%
dplyr::distinct() %>%
makeDataExportable(
tableName = "temporal_covariate_value",
diff --git a/R/IncidenceRates.R b/R/IncidenceRates.R
index 345421f3e..1a081c779 100644
--- a/R/IncidenceRates.R
+++ b/R/IncidenceRates.R
@@ -218,7 +218,7 @@ computeIncidenceRates <- function(connection,
startIncidenceRate <- Sys.time()
subset <- subsetToRequiredCohorts(
cohorts = cohorts %>%
- dplyr::filter(cohortId %in% instantiatedCohorts),
+ dplyr::filter(.data$cohortId %in% instantiatedCohorts),
task = "runIncidenceRate",
incremental = incremental,
recordKeepingFile = recordKeepingFile
diff --git a/R/InclusionRules.R b/R/InclusionRules.R
index 8648f10f9..70214a44f 100644
--- a/R/InclusionRules.R
+++ b/R/InclusionRules.R
@@ -27,7 +27,7 @@ getInclusionStats <- function(connection,
ParallelLogger::logInfo("Fetching inclusion statistics from files")
subset <- subsetToRequiredCohorts(
cohorts = cohortDefinitionSet %>%
- dplyr::filter(cohortId %in% instantiatedCohorts),
+ dplyr::filter(.data$cohortId %in% instantiatedCohorts),
task = "runInclusionStatistics",
incremental = incremental,
recordKeepingFile = recordKeepingFile
diff --git a/R/Incremental.R b/R/Incremental.R
index b49dfb199..99fb64a19 100644
--- a/R/Incremental.R
+++ b/R/Incremental.R
@@ -125,11 +125,11 @@ recordTasksDone <-
as.character(recordKeeping$timeStamp)
if ("cohortId" %in% colnames(recordKeeping)) {
recordKeeping <- recordKeeping %>%
- dplyr::mutate(cohortId = as.double(cohortId))
+ dplyr::mutate(cohortId = as.double(.data$cohortId))
}
if ("comparatorId" %in% colnames(recordKeeping)) {
recordKeeping <- recordKeeping %>%
- dplyr::mutate(comparatorId = as.double(comparatorId))
+ dplyr::mutate(comparatorId = as.double(.data$comparatorId))
}
idx <- getKeyIndex(list(...), recordKeeping)
if (length(idx) > 0) {
diff --git a/R/Private.R b/R/Private.R
index c8381f1a9..f7317affe 100644
--- a/R/Private.R
+++ b/R/Private.R
@@ -56,9 +56,11 @@ swapColumnContents <-
enforceMinCellValue <-
function(data, columnName, minValues, silent = FALSE) {
+ data <- as.data.frame(data)
toCensor <-
!is.na(data[, columnName]) &
- data[, columnName] < minValues & data[, columnName] != 0
+ data[, columnName] < minValues & data[, columnName] > 0
+
if (!silent) {
percent <- round(100 * sum(toCensor) / nrow(data), 1)
ParallelLogger::logInfo(
@@ -71,6 +73,7 @@ enforceMinCellValue <-
" because value below minimum"
)
}
+
if (length(minValues) == 1) {
data[toCensor, columnName] <- -minValues
} else {
@@ -141,28 +144,28 @@ makeDataExportable <- function(x,
fieldsInDataModel <- resultsDataModel %>%
dplyr::filter(.data$tableName == !!tableName) %>%
- dplyr::pull(columnName) %>%
+ dplyr::pull(.data$columnName) %>%
SqlRender::snakeCaseToCamelCase() %>%
unique()
requiredFieldsInDataModel <- resultsDataModel %>%
dplyr::filter(.data$tableName == !!tableName) %>%
- dplyr::filter(isRequired == "Yes") %>%
- dplyr::pull(columnName) %>%
+ dplyr::filter(.data$isRequired == "Yes") %>%
+ dplyr::pull(.data$columnName) %>%
SqlRender::snakeCaseToCamelCase() %>%
unique()
primaryKeyInDataModel <- resultsDataModel %>%
dplyr::filter(.data$tableName == !!tableName) %>%
- dplyr::filter(primaryKey == "Yes") %>%
- dplyr::pull(columnName) %>%
+ dplyr::filter(.data$primaryKey == "Yes") %>%
+ dplyr::pull(.data$columnName) %>%
SqlRender::snakeCaseToCamelCase() %>%
unique()
columnsToApplyMinCellValue <- resultsDataModel %>%
dplyr::filter(.data$tableName == !!tableName) %>%
- dplyr::filter(minCellCount == "Yes") %>%
- dplyr::pull(columnName) %>%
+ dplyr::filter(.data$minCellCount == "Yes") %>%
+ dplyr::pull(.data$columnName) %>%
SqlRender::snakeCaseToCamelCase() %>%
unique()
@@ -244,7 +247,9 @@ makeDataExportable <- function(x,
# Ensure that timeId is never NA
if ("timeId" %in% colnames(x)) {
- x[is.na(x$timeId), ]$timeId <- 0
+ if (any(is.na(x$timeId))) {
+ x[is.na(x$timeId), "timeId"] <- 0
+ }
}
return(x)
}
@@ -310,7 +315,7 @@ getPrefixedTableNames <- function(tablePrefix) {
return(resultList)
}
-#' Internal utility function for logging execution of variables
+# Internal utility function for logging execution of variables
timeExecution <- function(exportFolder,
taskName,
cohortIds = NULL,
diff --git a/R/RunDiagnostics.R b/R/RunDiagnostics.R
index 6c7d9a483..02c5e43d4 100644
--- a/R/RunDiagnostics.R
+++ b/R/RunDiagnostics.R
@@ -136,7 +136,23 @@ getDefaultCovariateSettings <- function() {
#' @param incremental Create only cohort diagnostics that haven't been created before?
#' @param incrementalFolder If \code{incremental = TRUE}, specify a folder where records are kept
#' of which cohort diagnostics has been executed.
+#' @param runOnSample Logical. If TRUE, the function will operate on a sample of the data.
+#' Default is FALSE, meaning the function will operate on the full data set.
#'
+#' @param sampleN Integer. The number of records to include in the sample if runOnSample is TRUE.
+#' Default is 1000. Ignored if runOnSample is FALSE.
+#'
+#' @param seed Integer. The seed for the random number generator used to create the sample.
+#' This ensures that the same sample can be drawn again in future runs. Default is 64374.
+#'
+#' @param seedArgs List. Additional arguments to pass to the sampling function.
+#' This can be used to control aspects of the sampling process beyond the seed and sample size.
+#'
+#' @param sampleIdentifierExpression Character. An expression that generates unique identifiers for each sample.
+#' This expression can use the variables 'cohortId' and 'seed'.
+#' Default is "cohortId * 1000 + seed", which ensures unique identifiers
+#' as long as there are fewer than 1000 cohorts.
+
#' @examples
#' \dontrun{
#' # Load cohorts (assumes that they have already been instantiated)
@@ -211,7 +227,12 @@ executeDiagnostics <- function(cohortDefinitionSet,
minCharacterizationMean = 0.01,
irWashoutPeriod = 0,
incremental = FALSE,
- incrementalFolder = file.path(exportFolder, "incremental")) {
+ incrementalFolder = file.path(exportFolder, "incremental"),
+ runOnSample = FALSE,
+ sampleN = 1000,
+ seed = 64374,
+ seedArgs = NULL,
+ sampleIdentifierExpression = "cohortId * 1000 + seed") {
# collect arguments that were passed to cohort diagnostics at initiation
callingArgs <- formals(executeDiagnostics)
callingArgsJson <-
@@ -288,7 +309,7 @@ executeDiagnostics <- function(cohortDefinitionSet,
add = errorMessage
)
minCellCount <- utils::type.convert(minCellCount, as.is = TRUE)
- checkmate::assertInteger(x = minCellCount, lower = 0, add = errorMessage)
+ checkmate::assertInteger(x = minCellCount, len = 1, lower = 0, add = errorMessage)
minCharacterizationMean <- utils::type.convert(minCharacterizationMean, as.is = TRUE)
checkmate::assertNumeric(x = minCharacterizationMean, lower = 0, add = errorMessage)
checkmate::assertLogical(incremental, add = errorMessage)
@@ -443,7 +464,7 @@ executeDiagnostics <- function(cohortDefinitionSet,
checkmate::reportAssertions(collection = errorMessage)
if (!is.null(cohortIds)) {
- cohortDefinitionSet <- cohortDefinitionSet %>% dplyr::filter(cohortId %in% cohortIds)
+ cohortDefinitionSet <- cohortDefinitionSet %>% dplyr::filter(.data$cohortId %in% cohortIds)
}
if (nrow(cohortDefinitionSet) == 0) {
@@ -528,6 +549,23 @@ executeDiagnostics <- function(cohortDefinitionSet,
}
}
+ if (runOnSample & !isTRUE(attr(cohortDefinitionSet, "isSampledCohortDefinition"))) {
+ cohortDefinitionSet <-
+ CohortGenerator::sampleCohortDefinitionSet(
+ connection = connection,
+ cohortDefinitionSet = cohortDefinitionSet,
+ tempEmulationSchema = tempEmulationSchema,
+ cohortDatabaseSchema = cohortDatabaseSchema,
+ cohortTableNames = cohortTableNames,
+ n = sampleN,
+ seed = seed,
+ seedArgs = seedArgs,
+ identifierExpression = sampleIdentifierExpression,
+ incremental = incremental,
+ incrementalFolder = incrementalFolder
+ )
+ }
+
## CDM source information----
timeExecution(
exportFolder,
@@ -631,8 +669,8 @@ executeDiagnostics <- function(cohortDefinitionSet,
if (nrow(cohortCounts) > 0) {
instantiatedCohorts <- cohortCounts %>%
- dplyr::filter(cohortEntries > 0) %>%
- dplyr::pull(cohortId)
+ dplyr::filter(.data$cohortEntries > 0) %>%
+ dplyr::pull(.data$cohortId)
ParallelLogger::logInfo(
sprintf(
"Found %s of %s (%1.2f%%) submitted cohorts instantiated. ",
@@ -646,6 +684,9 @@ executeDiagnostics <- function(cohortDefinitionSet,
stop("All cohorts were either not instantiated or all have 0 records.")
}
+ cohortDefinitionSet <- cohortDefinitionSet %>%
+ dplyr::filter(.data$cohortId %in% instantiatedCohorts)
+
# Inclusion statistics -----------------------------------------------------------------------
if (runInclusionStatistics) {
timeExecution(
diff --git a/R/Shiny.R b/R/Shiny.R
index 0e357c875..867072bbf 100644
--- a/R/Shiny.R
+++ b/R/Shiny.R
@@ -33,7 +33,6 @@
#' @param port (optional) Only used if \code{runOverNetwork} = TRUE.
#' @param launch.browser Should the app be launched in your default browser, or in a Shiny window.
#' Note: copying to clipboard will not work in a Shiny window.
-#' @param enableAnnotation Enable annotation functionality in shiny app
#' @param aboutText Text (using HTML markup) that will be displayed in an About tab in the Shiny app.
#' If not provided, no About tab will be shown.
#' @param tablePrefix (Optional) string to insert before table names (e.g. "cd_") for database table names
@@ -63,8 +62,7 @@ launchDiagnosticsExplorer <- function(sqliteDbPath = "MergedCohortDiagnosticsDat
makePublishable = FALSE,
publishDir = file.path(getwd(), "DiagnosticsExplorer"),
overwritePublishDir = FALSE,
- launch.browser = FALSE,
- enableAnnotation = TRUE) {
+ launch.browser = FALSE) {
useShinyPublishFile <- FALSE
if (is.null(shinyConfigPath)) {
if (is.null(connectionDetails)) {
@@ -106,11 +104,8 @@ launchDiagnosticsExplorer <- function(sqliteDbPath = "MergedCohortDiagnosticsDat
tablePrefix = tablePrefix,
cohortTableName = cohortTableName,
databaseTableName = databaseTableName,
- enableAnnotation = enableAnnotation,
enableAuthorization = FALSE
)
-
- options("enableCdAnnotation" = enableAnnotation)
on.exit(rm("shinySettings", envir = .GlobalEnv))
} else {
checkmate::assertFileExists(shinyConfigPath)
@@ -118,7 +113,7 @@ launchDiagnosticsExplorer <- function(sqliteDbPath = "MergedCohortDiagnosticsDat
on.exit(options("CD-shiny-config" = NULL))
}
- if (!"OhdsiShinyModules" %in% as.data.frame(installed.packages())$Package) {
+ if (!"OhdsiShinyModules" %in% as.data.frame(utils::installed.packages())$Package) {
remotes::install_github("OHDSI/OhdsiShinyModules")
}
@@ -134,7 +129,7 @@ launchDiagnosticsExplorer <- function(sqliteDbPath = "MergedCohortDiagnosticsDat
}
dir.create(publishDir, showWarnings = FALSE)
- filesToCopy <- file.path(appDir, list.files(appDir))
+ filesToCopy <- list.files(appDir, all.files = TRUE, full.names = TRUE)
file.copy(filesToCopy, publishDir, recursive = TRUE, overwrite = TRUE)
if (useShinyPublishFile) {
file.copy(sqliteDbPath, file.path(publishDir, "data", "MergedCohortDiagnosticsData.sqlite"), overwrite = TRUE)
@@ -198,6 +193,7 @@ createMergedResultsFile <-
list.files(
path = dataFolder,
pattern = ".zip",
+ all.files = TRUE,
full.names = TRUE,
recursive = TRUE
)
@@ -251,8 +247,103 @@ createDiagnosticsExplorerZip <- function(outputZipfile = file.path(getwd(), "Dia
on.exit(unlink(tmpDir, recursive = TRUE, force = TRUE), add = TRUE)
file.copy(shinyDirectory, tmpDir, recursive = TRUE)
- dir.create(file.path(tmpDir, "DiagnosticsExplorer", "data"))
+ dir.create(file.path(tmpDir, "DiagnosticsExplorer", "data"), showWarnings = FALSE)
file.copy(sqliteDbPath, file.path(tmpDir, "DiagnosticsExplorer", "data", "MergedCohortDiagnosticsData.sqlite"))
DatabaseConnector::createZipFile(outputZipfile, file.path(tmpDir, "DiagnosticsExplorer"), rootFolder = tmpDir)
}
+
+
+#' Rsconnect deploy
+#' @description
+#' Deploy your application to an posit connect platform or shinyapps.io server
+#'
+#' @export
+#' @inheritParams launchDiagnosticsExplorer
+#' @param appName string name to call app - should be unique on posit connect server
+#' @param appDir optional - directory to use to copy files for deployment. If you use a consistent dir
+#' other internal options can change.
+#' @param useRenvironFile logical - not recommended, store db credentials in .Renviron file
+#' @param shinyDirectory (optional) Directyory shiny app code lives. Use this if you wish to modify the explorer
+#' @param ... other parameters passed to rsconnect::deployApp
+deployPositConnectApp <- function(appName,
+ appDir = tempfile(),
+ sqliteDbPath = "MergedCohortDiagnosticsData.sqlite",
+ shinyDirectory = system.file(file.path("shiny", "DiagnosticsExplorer"),
+ package = "CohortDiagnostics"
+ ),
+ connectionDetails = NULL,
+ shinyConfigPath = NULL,
+ resultsDatabaseSchema = NULL,
+ vocabularyDatabaseSchemas = resultsDatabaseSchema,
+ tablePrefix = "",
+ cohortTableName = "cohort",
+ databaseTableName = "database",
+ port = 80,
+ useRenvironFile = FALSE,
+ ...) {
+ if (!"rsconnect" %in% as.data.frame(utils::installed.packages())$Package) {
+ install.packages("rsconnect")
+ }
+
+ if (!"yaml" %in% as.data.frame(utils::installed.packages())$Package) {
+ install.packages("yaml")
+ }
+
+ if (!"OhdsiShinyModules" %in% as.data.frame(utils::installed.packages())$Package) {
+ remotes::install_github("OHDSI/OhdsiShinyModules")
+ }
+
+ checkmate::assertDirectory(appDir, access = "w")
+
+ args <- rlang::dots_list(...)
+ args$envVars <- c(args$envVars, DATABASECONNECTOR_JAR_FOLDER = "./")
+
+ dir.create(appDir, showWarnings = FALSE)
+ filesToCopy <- list.files(shinyDirectory, all.files = TRUE, full.names = TRUE)
+ file.copy(filesToCopy, appDir, recursive = TRUE, overwrite = TRUE)
+
+ if (is.null(connectionDetails) && is.null(shinyConfigPath)) {
+ checkmate::assertFileExists(sqliteDbPath)
+ file.copy(sqliteDbPath, file.path(appDir, "data", "MergedCohortDiagnosticsData.sqlite"), overwrite = TRUE)
+ } else if (!is.null(shinyConfigPath)) {
+ DatabaseConnector::downloadJdbcDrivers(connectionDetails$dbms, appDir)
+ file.copy(shinyConfigPath, file.path(appDir, "config.yml"))
+ } else {
+ DatabaseConnector::downloadJdbcDrivers(connectionDetails$dbms, appDir)
+ if (useRenvironFile) {
+ outputText <- "# Edit credentials here to set on remote server
+# Using an renviron file will store plaintext variables and is not reccomended.
+# A local copy of this will be created and deleted following app deployment
+shinyDbServer=''
+shinydbPw=''
+shinydbUser=''
+shinydbPort=5432
+DATABASECONNECTOR_JAR_FOLDER='.'
+"
+ writeLines(outputText, file.path(appDir, ".Renviron"))
+ res <- utils::edit(file = file.path(appDir, ".Renviron"))
+ # File should always be deleted
+ on.exit(unlink(file.path(appDir, ".Renviron"), force = TRUE))
+ } else {
+ args$envVars <- c(args$envVars,
+ shinyDbServer = connectionDetails$server(),
+ shinydbPw = connectionDetails$password(),
+ shinydbUser = connectionDetails$user(),
+ shinydbPort = connectionDetails$port()
+ )
+ }
+
+ configOpts <- yaml::read_yaml(file.path(appDir, "config-ohdsi-shiny.yml"))
+ configOpts$tablePrefix <- tablePrefix
+ configOpts$resultsDatabaseSchema <- resultsDatabaseSchema
+ configOpts$vocabularyDatabaseSchemas <- vocabularyDatabaseSchemas
+ configOpts$cohortTableName <- cohortTableName
+ configOpts$databaseTableName <- databaseTableName
+ yaml::write_yaml(configOpts, file.path(appDir, "config.yml"))
+ }
+
+ args$appDir <- appDir
+ args$appName <- appName
+ do.call(rsconnect::deployApp, args)
+}
diff --git a/R/TimeSeries.R b/R/TimeSeries.R
index ab4d3a48e..33841dda7 100644
--- a/R/TimeSeries.R
+++ b/R/TimeSeries.R
@@ -98,7 +98,7 @@ runCohortTimeSeriesDiagnostics <- function(connectionDetails = NULL,
)
if (resultsInAndromeda$cohortCount %>%
dplyr::summarise(n = dplyr::n()) %>%
- dplyr::pull(n) == 0) {
+ dplyr::pull(.data$n) == 0) {
warning("Please check if cohorts are instantiated. Exiting cohort time series.")
return(NULL)
}
@@ -123,7 +123,7 @@ runCohortTimeSeriesDiagnostics <- function(connectionDetails = NULL,
by = clock::duration_months(3)
)
) %>%
- dplyr::mutate(periodEnd = clock::add_months(x = periodBegin, n = 3) - 1) %>%
+ dplyr::mutate(periodEnd = clock::add_months(x = .data$periodBegin, n = 3) - 1) %>%
dplyr::mutate(calendarInterval = "q")
calendarMonth <-
@@ -134,7 +134,7 @@ runCohortTimeSeriesDiagnostics <- function(connectionDetails = NULL,
by = clock::duration_months(1)
)
) %>%
- dplyr::mutate(periodEnd = clock::add_months(x = periodBegin, n = 1) - 1) %>%
+ dplyr::mutate(periodEnd = clock::add_months(x = .data$periodBegin, n = 1) - 1) %>%
dplyr::mutate(calendarInterval = "m")
calendarYear <-
@@ -145,7 +145,7 @@ runCohortTimeSeriesDiagnostics <- function(connectionDetails = NULL,
by = clock::duration_years(1)
)
) %>%
- dplyr::mutate(periodEnd = clock::add_years(x = periodBegin, n = 1) - 1) %>%
+ dplyr::mutate(periodEnd = clock::add_years(x = .data$periodBegin, n = 1) - 1) %>%
dplyr::mutate(calendarInterval = "y")
timeSeriesDateRange <- dplyr::tibble(
@@ -162,7 +162,7 @@ runCohortTimeSeriesDiagnostics <- function(connectionDetails = NULL,
timeSeriesDateRange
) %>% # calendarWeek
dplyr::distinct() %>%
- dplyr::arrange(periodBegin, periodEnd, calendarInterval) %>%
+ dplyr::arrange(.data$periodBegin, .data$periodEnd, .data$calendarInterval) %>%
dplyr::mutate(timeId = dplyr::row_number())
ParallelLogger::logTrace(" - Inserting calendar periods")
@@ -454,11 +454,11 @@ runCohortTimeSeriesDiagnostics <- function(connectionDetails = NULL,
by = c("timeId")
) %>%
dplyr::arrange(
- cohortId,
- periodBegin,
- calendarInterval,
- seriesType,
- periodBegin
+ .data$cohortId,
+ .data$periodBegin,
+ .data$calendarInterval,
+ .data$seriesType,
+ .data$periodBegin
) %>%
dplyr::select(-"timeId") %>%
dplyr::mutate(ageGroup = dplyr::if_else(
@@ -533,7 +533,7 @@ executeTimeSeriesDiagnostics <- function(connection,
incremental = incremental,
recordKeepingFile = recordKeepingFile
) %>%
- dplyr::arrange(cohortId)
+ dplyr::arrange(.data$cohortId)
if (nrow(subset) > 0) {
if (incremental &&
diff --git a/R/VisitContext.R b/R/VisitContext.R
index 668b728ac..3ecd4ed89 100644
--- a/R/VisitContext.R
+++ b/R/VisitContext.R
@@ -107,7 +107,7 @@ executeVisitContextDiagnostics <- function(connection,
ParallelLogger::logInfo("Retrieving visit context for index dates")
subset <- subsetToRequiredCohorts(
cohorts = cohorts %>%
- dplyr::filter(cohortId %in% instantiatedCohorts),
+ dplyr::filter(.data$cohortId %in% instantiatedCohorts),
task = "runVisitContext",
incremental = incremental,
recordKeepingFile = recordKeepingFile
diff --git a/docs/404.html b/docs/404.html
index 5e7a49d8d..55e65e878 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -32,7 +32,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/articles/CreatingAStudyPackage.html b/docs/articles/CreatingAStudyPackage.html
index 01773dc89..baf9d5f53 100644
--- a/docs/articles/CreatingAStudyPackage.html
+++ b/docs/articles/CreatingAStudyPackage.html
@@ -33,7 +33,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -97,7 +97,7 @@
Creating a study package
Gowtham A.
Rao
- 2023-09-19
+ 2023-11-16
Source: vignettes/CreatingAStudyPackage.Rmd
CreatingAStudyPackage.Rmd
diff --git a/docs/articles/DatabaseModeInDiagnosticsExplorer.html b/docs/articles/DatabaseModeInDiagnosticsExplorer.html
index 23cfe96cc..611755608 100644
--- a/docs/articles/DatabaseModeInDiagnosticsExplorer.html
+++ b/docs/articles/DatabaseModeInDiagnosticsExplorer.html
@@ -33,7 +33,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -97,7 +97,7 @@ Database mode in Diagnostics Explorer
Gowtham
Rao
- 2023-09-19
+ 2023-11-16
Source: vignettes/DatabaseModeInDiagnosticsExplorer.Rmd
DatabaseModeInDiagnosticsExplorer.Rmd
diff --git a/docs/articles/RunningCohortDiagnostics.html b/docs/articles/RunningCohortDiagnostics.html
index 2d1af9433..deb2425b2 100644
--- a/docs/articles/RunningCohortDiagnostics.html
+++ b/docs/articles/RunningCohortDiagnostics.html
@@ -33,7 +33,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -97,7 +97,7 @@ Running Cohort Diagnostics
Gowtham Rao and
James P. Gilbert
- 2023-09-19
+ 2023-11-16
Source: vignettes/RunningCohortDiagnostics.Rmd
RunningCohortDiagnostics.Rmd
@@ -148,7 +148,7 @@ Configuring the connection to
For the purposes of this example, we will use the Eunomia test CDM
package that is in an Sqlite database stored locally.
-connectionDetails <- Eunomia :: getEunomiaConnectionDetails ( )
+connectionDetails <- Eunomia :: getEunomiaConnectionDetails ( )
cdmDatabaseSchema <- "main"
tempEmulationSchema <- NULL
diff --git a/docs/articles/ViewingResultsUsingDiagnosticsExplorer.html b/docs/articles/ViewingResultsUsingDiagnosticsExplorer.html
index 515d223a2..272798bd4 100644
--- a/docs/articles/ViewingResultsUsingDiagnosticsExplorer.html
+++ b/docs/articles/ViewingResultsUsingDiagnosticsExplorer.html
@@ -33,7 +33,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -97,7 +97,7 @@ Viewing results using Diagnostics Explorer
Gowtham
Rao
- 2023-09-19
+ 2023-11-16
Source: vignettes/ViewingResultsUsingDiagnosticsExplorer.Rmd
ViewingResultsUsingDiagnosticsExplorer.Rmd
diff --git a/docs/articles/WhatIsCohortDiagnostics.html b/docs/articles/WhatIsCohortDiagnostics.html
index 22ad3cc37..4f6b2f40b 100644
--- a/docs/articles/WhatIsCohortDiagnostics.html
+++ b/docs/articles/WhatIsCohortDiagnostics.html
@@ -33,7 +33,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -97,7 +97,7 @@ What is Cohort Diagnostics?
Gowtham
Rao
- 2023-09-19
+ 2023-11-16
Source: vignettes/WhatIsCohortDiagnostics.Rmd
WhatIsCohortDiagnostics.Rmd
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 2043de551..ef8f0d07c 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/authors.html b/docs/authors.html
index 478196a77..e3c520238 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -108,13 +108,14 @@ Citation
Gilbert J, Rao G, Schuemie M, Ryan P, Weaver J (2023).
CohortDiagnostics: Diagnostics for OHDSI Cohorts .
-https://ohdsi.github.io/CohortDiagnostics, https://github.com/OHDSI/CohortDiagnostics.
+R package version 3.3.0, https://github.com/OHDSI/CohortDiagnostics, https://ohdsi.github.io/CohortDiagnostics .
@Manual{,
title = {CohortDiagnostics: Diagnostics for OHDSI Cohorts},
author = {Jamie Gilbert and Gowtham Rao and Martijn Schuemie and Patrick Ryan and James Weaver},
year = {2023},
- note = {https://ohdsi.github.io/CohortDiagnostics, https://github.com/OHDSI/CohortDiagnostics},
+ note = {R package version 3.3.0, https://github.com/OHDSI/CohortDiagnostics},
+ url = {https://ohdsi.github.io/CohortDiagnostics},
}
diff --git a/docs/index.html b/docs/index.html
index c7d82f7d1..4ad9974f1 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -39,7 +39,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -157,13 +157,13 @@ PDF versions of the documentation are also available:
diff --git a/docs/news/index.html b/docs/news/index.html
index 1a39727f8..4151c18c1 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -72,6 +72,16 @@ Changelog
Source: NEWS.md
+
+
+
Changes:
+
Resolved issues with package creating build errors
+Added function to make deployment to posit connect servers easier
+Added ability to use CohortGenerator sample functionality to executeDiagnostics which speeds up execution for very large cohort definitions
+Bug fix:
+
Fixes to loading shiny app in OHDSI shiny modules
+Bug fixes to prevent null value issues with included source concept diagnostics
+
Bug Fix:
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index b615b8513..ed8784ce6 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -7,5 +7,5 @@ articles:
RunningCohortDiagnostics: RunningCohortDiagnostics.html
ViewingResultsUsingDiagnosticsExplorer: ViewingResultsUsingDiagnosticsExplorer.html
WhatIsCohortDiagnostics: WhatIsCohortDiagnostics.html
-last_built: 2023-09-19T21:26Z
+last_built: 2023-11-16T15:11Z
diff --git a/docs/reference/CohortDiagnostics-package.html b/docs/reference/CohortDiagnostics-package.html
index 790dcf7d4..2c51c79d7 100644
--- a/docs/reference/CohortDiagnostics-package.html
+++ b/docs/reference/CohortDiagnostics-package.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/checkInputFileEncoding.html b/docs/reference/checkInputFileEncoding.html
index 853a42554..5cb44ed1b 100644
--- a/docs/reference/checkInputFileEncoding.html
+++ b/docs/reference/checkInputFileEncoding.html
@@ -18,7 +18,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/createDiagnosticsExplorerZip.html b/docs/reference/createDiagnosticsExplorerZip.html
index ac9d8ea7d..79caf9a59 100644
--- a/docs/reference/createDiagnosticsExplorerZip.html
+++ b/docs/reference/createDiagnosticsExplorerZip.html
@@ -20,7 +20,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/createMergedResultsFile.html b/docs/reference/createMergedResultsFile.html
index a7ca7393f..cb2d55fda 100644
--- a/docs/reference/createMergedResultsFile.html
+++ b/docs/reference/createMergedResultsFile.html
@@ -19,7 +19,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/createResultsDataModel.html b/docs/reference/createResultsDataModel.html
index ad99e2687..2c93876a1 100644
--- a/docs/reference/createResultsDataModel.html
+++ b/docs/reference/createResultsDataModel.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/deployPositConnectApp.html b/docs/reference/deployPositConnectApp.html
new file mode 100644
index 000000000..8aa40f0f5
--- /dev/null
+++ b/docs/reference/deployPositConnectApp.html
@@ -0,0 +1,191 @@
+
+Rsconnect deploy — deployPositConnectApp • CohortDiagnostics
+
+
+
+
+
+
+
+
+
Deploy your application to an posit connect platform or shinyapps.io server
+
+
+
+
deployPositConnectApp (
+ appName ,
+ appDir = tempfile ( ) ,
+ sqliteDbPath = "MergedCohortDiagnosticsData.sqlite" ,
+ shinyDirectory = system.file ( file.path ( "shiny" , "DiagnosticsExplorer" ) , package =
+ "CohortDiagnostics" ) ,
+ connectionDetails = NULL ,
+ shinyConfigPath = NULL ,
+ resultsDatabaseSchema = NULL ,
+ vocabularyDatabaseSchemas = resultsDatabaseSchema ,
+ tablePrefix = "" ,
+ cohortTableName = "cohort" ,
+ databaseTableName = "database" ,
+ port = 80 ,
+ useRenvironFile = FALSE ,
+ ...
+)
+
+
+
+
Arguments
+
appName
+string name to call app - should be unique on posit connect server
+
+
+appDir
+optional - directory to use to copy files for deployment. If you use a consistent dir
+other internal options can change.
+
+
+sqliteDbPath
+Path to merged sqlite file. See createMergedResultsFile
to create file.
+
+
+shinyDirectory
+(optional) Directyory shiny app code lives. Use this if you wish to modify the explorer
+
+
+connectionDetails
+An object of type connectionDetails
as created using the
+createConnectionDetails
function in the
+DatabaseConnector package, specifying how to connect to the server where
+the CohortDiagnostics results have been uploaded using the
+uploadResults
function.
+
+
+shinyConfigPath
+Path to shiny yml configuration file (use instead of sqliteDbPath or connectionDetails object)
+
+
+resultsDatabaseSchema
+The schema on the database server where the CohortDiagnostics results
+have been uploaded.
+
+
+vocabularyDatabaseSchemas
+(optional) A list of one or more schemas on the database server where the vocabulary tables are located.
+The default value is the value of the resultsDatabaseSchema. We can provide a list of vocabulary schema
+that might represent different versions of the OMOP vocabulary tables. It allows us to compare the impact
+of vocabulary changes on Diagnostics. Not supported with an sqlite database.
+
+
+tablePrefix
+(Optional) string to insert before table names (e.g. "cd_") for database table names
+
+
+cohortTableName
+(Optional) if cohort table name differs from the standard - cohort (ignores prefix if set)
+
+
+databaseTableName
+(Optional) if database table name differs from the standard - database (ignores prefix if set)
+
+
+port
+(optional) Only used if runOverNetwork
= TRUE.
+
+
+useRenvironFile
+logical - not recommended, store db credentials in .Renviron file
+
+
+...
+other parameters passed to rsconnect::deployApp
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/reference/deployShinyApp.html b/docs/reference/deployShinyApp.html
new file mode 100644
index 000000000..1a725c5a5
--- /dev/null
+++ b/docs/reference/deployShinyApp.html
@@ -0,0 +1,110 @@
+
+Deploy shiny app to rsconnect platform — deployShinyApp • CohortDiagnostics
+
+
+
+
+
+
+
+
+
Uses the rsconnect package to create a bundle suitable for deployment on a posit connect server.
+For example, shinyApps.io
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/reference/executeDiagnostics.html b/docs/reference/executeDiagnostics.html
index 693ab6b4a..eaaf64010 100644
--- a/docs/reference/executeDiagnostics.html
+++ b/docs/reference/executeDiagnostics.html
@@ -22,7 +22,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -118,7 +118,12 @@ Execute cohort diagnostics
minCharacterizationMean = 0.01 ,
irWashoutPeriod = 0 ,
incremental = FALSE ,
- incrementalFolder = file.path ( exportFolder , "incremental" )
+ incrementalFolder = file.path ( exportFolder , "incremental" ) ,
+ runOnSample = FALSE ,
+ sampleN = 1000 ,
+ seed = 64374 ,
+ seedArgs = NULL ,
+ sampleIdentifierExpression = "cohortId * 1000 + seed"
)
@@ -267,6 +272,33 @@ Arguments
If incremental = TRUE
, specify a folder where records are kept
of which cohort diagnostics has been executed.
+
+runOnSample
+Logical. If TRUE, the function will operate on a sample of the data.
+Default is FALSE, meaning the function will operate on the full data set.
+
+
+sampleN
+Integer. The number of records to include in the sample if runOnSample is TRUE.
+Default is 1000. Ignored if runOnSample is FALSE.
+
+
+seed
+Integer. The seed for the random number generator used to create the sample.
+This ensures that the same sample can be drawn again in future runs. Default is 64374.
+
+
+seedArgs
+List. Additional arguments to pass to the sampling function.
+This can be used to control aspects of the sampling process beyond the seed and sample size.
+
+
+sampleIdentifierExpression
+Character. An expression that generates unique identifiers for each sample.
+This expression can use the variables 'cohortId' and 'seed'.
+Default is "cohortId * 1000 + seed", which ensures unique identifiers
+as long as there are fewer than 1000 cohorts.
+
Details
diff --git a/docs/reference/getCdmDataSourceInformation.html b/docs/reference/getCdmDataSourceInformation.html
index e39eecb97..bab245cf7 100644
--- a/docs/reference/getCdmDataSourceInformation.html
+++ b/docs/reference/getCdmDataSourceInformation.html
@@ -18,7 +18,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/getCohortCounts.html b/docs/reference/getCohortCounts.html
index 96357a4b8..7a42574c2 100644
--- a/docs/reference/getCohortCounts.html
+++ b/docs/reference/getCohortCounts.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/getDataMigrator.html b/docs/reference/getDataMigrator.html
index 61c802b3f..4150efab4 100644
--- a/docs/reference/getDataMigrator.html
+++ b/docs/reference/getDataMigrator.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/getDefaultCovariateSettings.html b/docs/reference/getDefaultCovariateSettings.html
index 7853cc908..2ff90f622 100644
--- a/docs/reference/getDefaultCovariateSettings.html
+++ b/docs/reference/getDefaultCovariateSettings.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/getDefaultVocabularyTableNames.html b/docs/reference/getDefaultVocabularyTableNames.html
index 1f40bfd3a..617b07b49 100644
--- a/docs/reference/getDefaultVocabularyTableNames.html
+++ b/docs/reference/getDefaultVocabularyTableNames.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/getResultsDataModelSpecifications.html b/docs/reference/getResultsDataModelSpecifications.html
index 7f8eef6cf..3d60d272e 100644
--- a/docs/reference/getResultsDataModelSpecifications.html
+++ b/docs/reference/getResultsDataModelSpecifications.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/index.html b/docs/reference/index.html
index 1bbee13f5..4f51cb11a 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -92,9 +92,9 @@ All functions
Create the results data model tables on a database server.
- deployShinyApp()
+ deployPositConnectApp()
- Deploy shiny app to rsconnect platform
+ Rsconnect deploy
executeDiagnostics()
@@ -139,10 +139,6 @@
- timeExecution()
-
- Internal utility function for logging execution of variables
uploadResults()
diff --git a/docs/reference/launchDiagnosticsExplorer.html b/docs/reference/launchDiagnosticsExplorer.html
index 57b08053a..8564d945a 100644
--- a/docs/reference/launchDiagnosticsExplorer.html
+++ b/docs/reference/launchDiagnosticsExplorer.html
@@ -17,7 +17,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
@@ -94,8 +94,7 @@ Launch the Diagnostics Explorer Shiny app
makePublishable = FALSE ,
publishDir = file.path ( getwd ( ) , "DiagnosticsExplorer" ) ,
overwritePublishDir = FALSE ,
- launch.browser = FALSE ,
- enableAnnotation = TRUE
+ launch.browser = FALSE
)
@@ -174,10 +173,6 @@ Arguments
Should the app be launched in your default browser, or in a Shiny window.
Note: copying to clipboard will not work in a Shiny window.
-
-enableAnnotation
-Enable annotation functionality in shiny app
-
Details
diff --git a/docs/reference/migrateDataModel.html b/docs/reference/migrateDataModel.html
index a72bf29d2..493a76414 100644
--- a/docs/reference/migrateDataModel.html
+++ b/docs/reference/migrateDataModel.html
@@ -19,7 +19,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/runCohortRelationshipDiagnostics.html b/docs/reference/runCohortRelationshipDiagnostics.html
index c0f9c2f9e..c8a57a736 100644
--- a/docs/reference/runCohortRelationshipDiagnostics.html
+++ b/docs/reference/runCohortRelationshipDiagnostics.html
@@ -18,7 +18,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/runCohortTimeSeriesDiagnostics.html b/docs/reference/runCohortTimeSeriesDiagnostics.html
index 1bd102b8c..148a5ecd3 100644
--- a/docs/reference/runCohortTimeSeriesDiagnostics.html
+++ b/docs/reference/runCohortTimeSeriesDiagnostics.html
@@ -25,7 +25,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/reference/uploadResults.html b/docs/reference/uploadResults.html
index 5eb3a6514..a8c7bc34e 100644
--- a/docs/reference/uploadResults.html
+++ b/docs/reference/uploadResults.html
@@ -19,7 +19,7 @@
CohortDiagnostics
- 3.2.4
+ 3.3.0
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index f9a99ba7b..f7ac2a523 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -87,6 +87,9 @@
/reference/createResultsDataModel.html
+
+ /reference/deployPositConnectApp.html
+
/reference/deployShinyApp.html
diff --git a/extras/EditIncrementalLogDiagnostics.R b/extras/EditIncrementalLogDiagnostics.R
index b8e183126..e01e56a74 100644
--- a/extras/EditIncrementalLogDiagnostics.R
+++ b/extras/EditIncrementalLogDiagnostics.R
@@ -31,7 +31,7 @@ for (i in (1:length(listFiles))) {
col_types = readr::cols(),
guess_max = min(1e7)
) %>%
- dplyr::filter(!task %in% tasksToRemove) %>%
+ dplyr::filter(!.data$task %in% tasksToRemove) %>%
readr::write_excel_csv(file = listFiles[[i]])
}
diff --git a/extras/PackageMaintenance.R b/extras/PackageMaintenance.R
index f8229d68e..6424161b3 100644
--- a/extras/PackageMaintenance.R
+++ b/extras/PackageMaintenance.R
@@ -68,10 +68,4 @@ filePath <- file.path("inst", "sql", "sql_server", "UpdateVersionNumber.sql")
text <- readChar(filePath, file.info(filePath)$size)
patternRep <- "\\{DEFAULT @version_number = '(\\d+\\.\\d+\\.\\d+)'\\}"
text <- gsub(patternRep, paste0("\\{DEFAULT @version_number = '", version, "'\\}"), text)
-writeLines(text, con = file(filePath))
-
-
-# Copy data model specs to Shiny app
-file.copy(from = "inst/settings/resultsDataModelSpecification.csv",
- to = "inst/shiny/DiagnosticsExplorer/data/resultsDataModelSpecification.csv",
- overwrite = TRUE)
+writeLines(text, con = file(filePath))
\ No newline at end of file
diff --git a/inst/doc/RunningCohortDiagnostics.pdf b/inst/doc/RunningCohortDiagnostics.pdf
index ac855cd4a..666dc0c65 100644
Binary files a/inst/doc/RunningCohortDiagnostics.pdf and b/inst/doc/RunningCohortDiagnostics.pdf differ
diff --git a/inst/doc/ViewingResultsUsingDiagnosticsExplorer.pdf b/inst/doc/ViewingResultsUsingDiagnosticsExplorer.pdf
index 46ab0568e..fbeb0fed6 100644
Binary files a/inst/doc/ViewingResultsUsingDiagnosticsExplorer.pdf and b/inst/doc/ViewingResultsUsingDiagnosticsExplorer.pdf differ
diff --git a/inst/doc/WhatIsCohortDiagnostics.pdf b/inst/doc/WhatIsCohortDiagnostics.pdf
index 23ea367e6..eeaabfeda 100644
Binary files a/inst/doc/WhatIsCohortDiagnostics.pdf and b/inst/doc/WhatIsCohortDiagnostics.pdf differ
diff --git a/inst/shiny/DiagnosticsExplorer/config-ohdsi-shiny.yml b/inst/shiny/DiagnosticsExplorer/config-ohdsi-shiny.yml
index 046e6e066..5557dafd1 100644
--- a/inst/shiny/DiagnosticsExplorer/config-ohdsi-shiny.yml
+++ b/inst/shiny/DiagnosticsExplorer/config-ohdsi-shiny.yml
@@ -23,12 +23,3 @@ resultsDatabaseSchema: "some_schema"
vocabularyDatabaseSchemas: ["some_schema"]
cohortTableName: "cohort"
databaseTableName: "database"
-
-enableAnnotation: TRUE
-enableAuthorization: TRUE
-
-### if you need a way to authorize users
-### generate hash using code like digest::digest("diagnostics",algo = "sha512")
-### store in external file called UserCredentials.csv - with fields userId, hashCode
-### place the file in the root folder
-userCredentialsFile: UserCredentials.csv
diff --git a/inst/shiny/DiagnosticsExplorer/global.R b/inst/shiny/DiagnosticsExplorer/global.R
index c3895f518..03fe5208e 100644
--- a/inst/shiny/DiagnosticsExplorer/global.R
+++ b/inst/shiny/DiagnosticsExplorer/global.R
@@ -78,30 +78,29 @@ if (FALSE) {
connectionHandler <- ResultModelManager::PooledConnectionHandler$new(shinySettings$connectionDetails)
+if (!shinySettings$connectionDetails$dbms %in% c("duckdb", "sqlite")) {
+ DatabaseConnector::downloadJdbcDrivers(dbms = shinySettings$connectionDetails,
+ pathToDriver = shinySettings$connectionDetails$pathToDriver)
-if (packageVersion("OhdsiShinyModules") >= as.numeric_version("1.2.0")) {
- resultDatabaseSettings <- list(
- schema = shinySettings$resultsDatabaseSchema,
- vocabularyDatabaseSchema = shinySettings$vocabularyDatabaseSchema,
- cdTablePrefix = shinySettings$tablePrefix,
- cgTable = shinySettings$cohortTableName,
- databaseTable = shinySettings$databaseTableName
- )
-
- dataSource <-
- OhdsiShinyModules::createCdDatabaseDataSource(connectionHandler = connectionHandler,
- resultDatabaseSettings = resultDatabaseSettings)
-} else {
- dataSource <-
- OhdsiShinyModules::createCdDatabaseDataSource(
- connectionHandler = connectionHandler,
- schema = shinySettings$resultsDatabaseSchema,
- vocabularyDatabaseSchema = shinySettings$vocabularyDatabaseSchema,
- tablePrefix = shinySettings$tablePrefix,
- cohortTableName = shinySettings$cohortTableName,
- databaseTableName = shinySettings$databaseTableName
- )
+}
+if (packageVersion("OhdsiShinyModules") <= as.numeric_version("2.0.0")) {
+ stop("OhdsiShinyModules version no longer supported.
+ Update to a newer version with remotes::install_github('OhdsiShinyModules')")
}
+resultDatabaseSettings <- list(
+ schema = shinySettings$resultsDatabaseSchema,
+ vocabularyDatabaseSchema = shinySettings$vocabularyDatabaseSchema,
+ cdTablePrefix = shinySettings$tablePrefix,
+ cgTable = shinySettings$cohortTableName,
+ databaseTable = shinySettings$databaseTableName
+)
+
+dataSource <-
+ OhdsiShinyModules::createCdDatabaseDataSource(connectionHandler = connectionHandler,
+ resultDatabaseSettings = resultDatabaseSettings)
+
+
+
diff --git a/inst/shiny/DiagnosticsExplorer/renv.lock b/inst/shiny/DiagnosticsExplorer/renv.lock
deleted file mode 100644
index 46f050bb5..000000000
--- a/inst/shiny/DiagnosticsExplorer/renv.lock
+++ /dev/null
@@ -1,1721 +0,0 @@
-{
- "R": {
- "Version": "4.2.3",
- "Repositories": [
- {
- "Name": "CRAN",
- "URL": "https://packagemanager.posit.co/cran/latest"
- }
- ]
- },
- "Packages": {
- "BH": {
- "Package": "BH",
- "Version": "1.81.0-1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Hash": "68122010f01c4dcfbe58ce7112f2433d"
- },
- "CirceR": {
- "Package": "CirceR",
- "Version": "1.3.1",
- "Source": "GitHub",
- "RemoteType": "github",
- "RemoteHost": "api.github.com",
- "RemoteRepo": "CirceR",
- "RemoteUsername": "ohdsi",
- "RemoteRef": "HEAD",
- "RemoteSha": "9a5a58003fa94c7a8cb1e98234ad000005497a10",
- "Requirements": [
- "R",
- "RJSONIO",
- "rJava"
- ],
- "Hash": "39c1e31ab9c3d830ddaf548d5c6430fd"
- },
- "DBI": {
- "Package": "DBI",
- "Version": "1.1.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "b2866e62bab9378c3cc9476a1954226b"
- },
- "DT": {
- "Package": "DT",
- "Version": "0.29",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "crosstalk",
- "htmltools",
- "htmlwidgets",
- "httpuv",
- "jquerylib",
- "jsonlite",
- "magrittr",
- "promises"
- ],
- "Hash": "02f42b77a951a5ea7c891ef5c187d774"
- },
- "DatabaseConnector": {
- "Package": "DatabaseConnector",
- "Version": "6.2.4",
- "Source": "GitHub",
- "RemoteType": "github",
- "RemoteHost": "api.github.com",
- "RemoteRepo": "DatabaseConnector",
- "RemoteUsername": "OHDSI",
- "RemoteRef": "HEAD",
- "RemoteSha": "5867bc151cda2dcf30a682b23eb0afa1997f9abd",
- "Requirements": [
- "DBI",
- "R",
- "SqlRender",
- "bit64",
- "checkmate",
- "dbplyr",
- "digest",
- "methods",
- "rJava",
- "readr",
- "rlang",
- "stringr",
- "urltools",
- "utils"
- ],
- "Hash": "7b09eb5986ea9b0f7e9ea79949b6236d"
- },
- "MASS": {
- "Package": "MASS",
- "Version": "7.3-58.2",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "grDevices",
- "graphics",
- "methods",
- "stats",
- "utils"
- ],
- "Hash": "e02d1a0f6122fd3e634b25b433704344"
- },
- "Matrix": {
- "Package": "Matrix",
- "Version": "1.5-3",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "graphics",
- "grid",
- "lattice",
- "methods",
- "stats",
- "utils"
- ],
- "Hash": "4006dffe49958d2dd591c17e61e60591"
- },
- "OhdsiShinyModules": {
- "Package": "OhdsiShinyModules",
- "Version": "1.1.0",
- "Source": "GitHub",
- "Remotes": "ohdsi/CirceR, ohdsi/ResultModelManager",
- "RemoteType": "github",
- "RemoteHost": "api.github.com",
- "RemoteRepo": "OhdsiShinyModules",
- "RemoteUsername": "Ohdsi",
- "RemoteRef": "HEAD",
- "RemoteSha": "619fed22a61343ec0566f36b2a6c9152bcb49fa8",
- "Requirements": [
- "CirceR",
- "DT",
- "DatabaseConnector",
- "ParallelLogger",
- "R",
- "RColorBrewer",
- "RJSONIO",
- "SqlRender",
- "checkmate",
- "dplyr",
- "ggplot2",
- "gridExtra",
- "htmltools",
- "lubridate",
- "methods",
- "plotly",
- "purrr",
- "reactable",
- "readr",
- "rlang",
- "rmarkdown",
- "scales",
- "shiny",
- "shinyWidgets",
- "shinycssloaders",
- "shinydashboard",
- "stringr",
- "tibble",
- "tidyr",
- "tidyselect",
- "tippy"
- ],
- "Hash": "2940d8995b790eab102b6a3018edcfc0"
- },
- "ParallelLogger": {
- "Package": "ParallelLogger",
- "Version": "3.3.0",
- "Source": "GitHub",
- "RemoteType": "github",
- "RemoteHost": "api.github.com",
- "RemoteRepo": "ParallelLogger",
- "RemoteUsername": "ohdsi",
- "RemoteRef": "HEAD",
- "RemoteSha": "f875565f778414df7c0e4fbcaf38f34a1c36fa28",
- "Requirements": [
- "R",
- "jsonlite",
- "methods",
- "snow",
- "utils",
- "xml2"
- ],
- "Hash": "64b88278107424ea011e310a9b5b83e5"
- },
- "R6": {
- "Package": "R6",
- "Version": "2.5.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "470851b6d5d0ac559e9d01bb352b4021"
- },
- "RColorBrewer": {
- "Package": "RColorBrewer",
- "Version": "1.1-3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "45f0398006e83a5b10b72a90663d8d8c"
- },
- "RJSONIO": {
- "Package": "RJSONIO",
- "Version": "1.3-1.8",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "methods"
- ],
- "Hash": "cd79d1874fb20217463451f8c310c526"
- },
- "RSQLite": {
- "Package": "RSQLite",
- "Version": "2.3.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "DBI",
- "R",
- "bit64",
- "blob",
- "cpp11",
- "memoise",
- "methods",
- "pkgconfig",
- "plogr"
- ],
- "Hash": "207c90cd5438a1f596da2cd54c606fee"
- },
- "Rcpp": {
- "Package": "Rcpp",
- "Version": "1.0.11",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "methods",
- "utils"
- ],
- "Hash": "ae6cbbe1492f4de79c45fce06f967ce8"
- },
- "ResultModelManager": {
- "Package": "ResultModelManager",
- "Version": "0.4.0.9999",
- "Source": "GitHub",
- "RemoteType": "github",
- "RemoteHost": "api.github.com",
- "RemoteRepo": "ResultModelManager",
- "RemoteUsername": "ohdsi",
- "RemoteRef": "develop",
- "RemoteSha": "b6f097aae1b5d48f1f80f3d101ba4a33cc326887",
- "Requirements": [
- "DBI",
- "DatabaseConnector",
- "ParallelLogger",
- "R",
- "R6",
- "SqlRender",
- "checkmate",
- "dplyr",
- "fastmap",
- "fs",
- "lubridate",
- "pool",
- "readr",
- "rlang",
- "zip"
- ],
- "Hash": "95454bacdfdfce9f8b09f3217c733a33"
- },
- "SqlRender": {
- "Package": "SqlRender",
- "Version": "1.16.0",
- "Source": "GitHub",
- "RemoteType": "github",
- "RemoteHost": "api.github.com",
- "RemoteRepo": "SqlRender",
- "RemoteUsername": "ohdsi",
- "RemoteRef": "develop",
- "RemoteSha": "2cf2e020295926f45faf4cd926b2ae733af65382",
- "Requirements": [
- "checkmate",
- "rJava",
- "rlang"
- ],
- "Hash": "ddc1431776d50ca435dd9db42f46b403"
- },
- "anytime": {
- "Package": "anytime",
- "Version": "0.3.9",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "BH",
- "R",
- "Rcpp"
- ],
- "Hash": "74a64813f17b492da9c6afda6b128e3d"
- },
- "askpass": {
- "Package": "askpass",
- "Version": "1.2.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "sys"
- ],
- "Hash": "cad6cf7f1d5f6e906700b9d3e718c796"
- },
- "assertthat": {
- "Package": "assertthat",
- "Version": "0.2.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "tools"
- ],
- "Hash": "50c838a310445e954bc13f26f26a6ecf"
- },
- "backports": {
- "Package": "backports",
- "Version": "1.4.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "c39fbec8a30d23e721980b8afb31984c"
- },
- "base64enc": {
- "Package": "base64enc",
- "Version": "0.1-3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "543776ae6848fde2f48ff3816d0628bc"
- },
- "bit": {
- "Package": "bit",
- "Version": "4.0.5",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "d242abec29412ce988848d0294b208fd"
- },
- "bit64": {
- "Package": "bit64",
- "Version": "4.0.5",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "bit",
- "methods",
- "stats",
- "utils"
- ],
- "Hash": "9fe98599ca456d6552421db0d6772d8f"
- },
- "blob": {
- "Package": "blob",
- "Version": "1.2.4",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "methods",
- "rlang",
- "vctrs"
- ],
- "Hash": "40415719b5a479b87949f3aa0aee737c"
- },
- "bslib": {
- "Package": "bslib",
- "Version": "0.5.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "base64enc",
- "cachem",
- "grDevices",
- "htmltools",
- "jquerylib",
- "jsonlite",
- "memoise",
- "mime",
- "rlang",
- "sass"
- ],
- "Hash": "283015ddfbb9d7bf15ea9f0b5698f0d9"
- },
- "cachem": {
- "Package": "cachem",
- "Version": "1.0.8",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "fastmap",
- "rlang"
- ],
- "Hash": "c35768291560ce302c0a6589f92e837d"
- },
- "checkmate": {
- "Package": "checkmate",
- "Version": "2.2.0",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "backports",
- "utils"
- ],
- "Hash": "ca9c113196136f4a9ca9ce6079c2c99e"
- },
- "cli": {
- "Package": "cli",
- "Version": "3.6.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "utils"
- ],
- "Hash": "89e6d8219950eac806ae0c489052048a"
- },
- "clipr": {
- "Package": "clipr",
- "Version": "0.8.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "utils"
- ],
- "Hash": "3f038e5ac7f41d4ac41ce658c85e3042"
- },
- "colorspace": {
- "Package": "colorspace",
- "Version": "2.1-0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "grDevices",
- "graphics",
- "methods",
- "stats"
- ],
- "Hash": "f20c47fd52fae58b4e377c37bb8c335b"
- },
- "commonmark": {
- "Package": "commonmark",
- "Version": "1.9.0",
- "Source": "Repository",
- "Repository": "CRAN",
- "Hash": "d691c61bff84bd63c383874d2d0c3307"
- },
- "cpp11": {
- "Package": "cpp11",
- "Version": "0.4.6",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "707fae4bbf73697ec8d85f9d7076c061"
- },
- "crayon": {
- "Package": "crayon",
- "Version": "1.5.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "grDevices",
- "methods",
- "utils"
- ],
- "Hash": "e8a1e41acf02548751f45c718d55aa6a"
- },
- "crosstalk": {
- "Package": "crosstalk",
- "Version": "1.2.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R6",
- "htmltools",
- "jsonlite",
- "lazyeval"
- ],
- "Hash": "6aa54f69598c32177e920eb3402e8293"
- },
- "curl": {
- "Package": "curl",
- "Version": "5.0.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "511bacbfa153a15251166b463b4da4f9"
- },
- "data.table": {
- "Package": "data.table",
- "Version": "1.14.8",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "b4c06e554f33344e044ccd7fdca750a9"
- },
- "dbplyr": {
- "Package": "dbplyr",
- "Version": "2.3.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "DBI",
- "R",
- "R6",
- "blob",
- "cli",
- "dplyr",
- "glue",
- "lifecycle",
- "magrittr",
- "methods",
- "pillar",
- "purrr",
- "rlang",
- "tibble",
- "tidyr",
- "tidyselect",
- "utils",
- "vctrs",
- "withr"
- ],
- "Hash": "d6fd1b1440c1cacc6623aaa4e9fe352b"
- },
- "digest": {
- "Package": "digest",
- "Version": "0.6.33",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "utils"
- ],
- "Hash": "b18a9cf3c003977b0cc49d5e76ebe48d"
- },
- "dplyr": {
- "Package": "dplyr",
- "Version": "1.1.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "R6",
- "cli",
- "generics",
- "glue",
- "lifecycle",
- "magrittr",
- "methods",
- "pillar",
- "rlang",
- "tibble",
- "tidyselect",
- "utils",
- "vctrs"
- ],
- "Hash": "e85ffbebaad5f70e1a2e2ef4302b4949"
- },
- "ellipsis": {
- "Package": "ellipsis",
- "Version": "0.3.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "rlang"
- ],
- "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077"
- },
- "evaluate": {
- "Package": "evaluate",
- "Version": "0.21",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "d59f3b464e8da1aef82dc04b588b8dfb"
- },
- "fansi": {
- "Package": "fansi",
- "Version": "1.0.4",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "grDevices",
- "utils"
- ],
- "Hash": "1d9e7ad3c8312a192dea7d3db0274fde"
- },
- "farver": {
- "Package": "farver",
- "Version": "2.1.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Hash": "8106d78941f34855c440ddb946b8f7a5"
- },
- "fastmap": {
- "Package": "fastmap",
- "Version": "1.1.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Hash": "f7736a18de97dea803bde0a2daaafb27"
- },
- "filelock": {
- "Package": "filelock",
- "Version": "1.0.2",
- "Source": "Repository",
- "Repository": "CRAN",
- "Hash": "38ec653c2613bed60052ba3787bd8a2c"
- },
- "fontawesome": {
- "Package": "fontawesome",
- "Version": "0.5.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "htmltools",
- "rlang"
- ],
- "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d"
- },
- "fs": {
- "Package": "fs",
- "Version": "1.6.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "47b5f30c720c23999b913a1a635cf0bb"
- },
- "generics": {
- "Package": "generics",
- "Version": "0.1.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "15e9634c0fcd294799e9b2e929ed1b86"
- },
- "ggplot2": {
- "Package": "ggplot2",
- "Version": "3.4.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "MASS",
- "R",
- "cli",
- "glue",
- "grDevices",
- "grid",
- "gtable",
- "isoband",
- "lifecycle",
- "mgcv",
- "rlang",
- "scales",
- "stats",
- "tibble",
- "vctrs",
- "withr"
- ],
- "Hash": "85846544c596e71f8f46483ab165da33"
- },
- "glue": {
- "Package": "glue",
- "Version": "1.6.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e"
- },
- "gridExtra": {
- "Package": "gridExtra",
- "Version": "2.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "grDevices",
- "graphics",
- "grid",
- "gtable",
- "utils"
- ],
- "Hash": "7d7f283939f563670a697165b2cf5560"
- },
- "gtable": {
- "Package": "gtable",
- "Version": "0.3.4",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cli",
- "glue",
- "grid",
- "lifecycle",
- "rlang"
- ],
- "Hash": "b29cf3031f49b04ab9c852c912547eef"
- },
- "highr": {
- "Package": "highr",
- "Version": "0.10",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "xfun"
- ],
- "Hash": "06230136b2d2b9ba5805e1963fa6e890"
- },
- "hms": {
- "Package": "hms",
- "Version": "1.1.3",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "lifecycle",
- "methods",
- "pkgconfig",
- "rlang",
- "vctrs"
- ],
- "Hash": "b59377caa7ed00fa41808342002138f9"
- },
- "htmltools": {
- "Package": "htmltools",
- "Version": "0.5.6",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "base64enc",
- "digest",
- "ellipsis",
- "fastmap",
- "grDevices",
- "rlang",
- "utils"
- ],
- "Hash": "a2326a66919a3311f7fbb1e3bf568283"
- },
- "htmlwidgets": {
- "Package": "htmlwidgets",
- "Version": "1.6.2",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "grDevices",
- "htmltools",
- "jsonlite",
- "knitr",
- "rmarkdown",
- "yaml"
- ],
- "Hash": "a865aa85bcb2697f47505bfd70422471"
- },
- "httpuv": {
- "Package": "httpuv",
- "Version": "1.6.11",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "R6",
- "Rcpp",
- "later",
- "promises",
- "utils"
- ],
- "Hash": "838602f54e32c1a0f8cc80708cefcefa"
- },
- "httr": {
- "Package": "httr",
- "Version": "1.4.7",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "R6",
- "curl",
- "jsonlite",
- "mime",
- "openssl"
- ],
- "Hash": "ac107251d9d9fd72f0ca8049988f1d7f"
- },
- "isoband": {
- "Package": "isoband",
- "Version": "0.2.7",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "grid",
- "utils"
- ],
- "Hash": "0080607b4a1a7b28979aecef976d8bc2"
- },
- "jquerylib": {
- "Package": "jquerylib",
- "Version": "0.1.4",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "htmltools"
- ],
- "Hash": "5aab57a3bd297eee1c1d862735972182"
- },
- "jsonlite": {
- "Package": "jsonlite",
- "Version": "1.8.7",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "methods"
- ],
- "Hash": "266a20443ca13c65688b2116d5220f76"
- },
- "keyring": {
- "Package": "keyring",
- "Version": "1.3.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R6",
- "askpass",
- "assertthat",
- "filelock",
- "openssl",
- "rappdirs",
- "sodium",
- "tools",
- "utils",
- "yaml"
- ],
- "Hash": "b7880ebefe188d62b099673bbc04afac"
- },
- "knitr": {
- "Package": "knitr",
- "Version": "1.44",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "evaluate",
- "highr",
- "methods",
- "tools",
- "xfun",
- "yaml"
- ],
- "Hash": "60885b9f746c9dfaef110d070b5f7dc0"
- },
- "labeling": {
- "Package": "labeling",
- "Version": "0.4.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "graphics",
- "stats"
- ],
- "Hash": "b64ec208ac5bc1852b285f665d6368b3"
- },
- "later": {
- "Package": "later",
- "Version": "1.3.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "Rcpp",
- "rlang"
- ],
- "Hash": "40401c9cf2bc2259dfe83311c9384710"
- },
- "lattice": {
- "Package": "lattice",
- "Version": "0.20-45",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "grDevices",
- "graphics",
- "grid",
- "stats",
- "utils"
- ],
- "Hash": "b64cdbb2b340437c4ee047a1f4c4377b"
- },
- "lazyeval": {
- "Package": "lazyeval",
- "Version": "0.2.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "d908914ae53b04d4c0c0fd72ecc35370"
- },
- "lifecycle": {
- "Package": "lifecycle",
- "Version": "1.0.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cli",
- "glue",
- "rlang"
- ],
- "Hash": "001cecbeac1cff9301bdc3775ee46a86"
- },
- "lubridate": {
- "Package": "lubridate",
- "Version": "1.9.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "generics",
- "methods",
- "timechange"
- ],
- "Hash": "e25f18436e3efd42c7c590a1c4c15390"
- },
- "magrittr": {
- "Package": "magrittr",
- "Version": "2.0.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "7ce2733a9826b3aeb1775d56fd305472"
- },
- "memoise": {
- "Package": "memoise",
- "Version": "2.0.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "cachem",
- "rlang"
- ],
- "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c"
- },
- "mgcv": {
- "Package": "mgcv",
- "Version": "1.8-42",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "Matrix",
- "R",
- "graphics",
- "methods",
- "nlme",
- "splines",
- "stats",
- "utils"
- ],
- "Hash": "3460beba7ccc8946249ba35327ba902a"
- },
- "mime": {
- "Package": "mime",
- "Version": "0.12",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "tools"
- ],
- "Hash": "18e9c28c1d3ca1560ce30658b22ce104"
- },
- "munsell": {
- "Package": "munsell",
- "Version": "0.5.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "colorspace",
- "methods"
- ],
- "Hash": "6dfe8bf774944bd5595785e3229d8771"
- },
- "nlme": {
- "Package": "nlme",
- "Version": "3.1-162",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "graphics",
- "lattice",
- "stats",
- "utils"
- ],
- "Hash": "0984ce8da8da9ead8643c5cbbb60f83e"
- },
- "openssl": {
- "Package": "openssl",
- "Version": "2.1.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "askpass"
- ],
- "Hash": "273a6bb4a9844c296a459d2176673270"
- },
- "pillar": {
- "Package": "pillar",
- "Version": "1.9.0",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "cli",
- "fansi",
- "glue",
- "lifecycle",
- "rlang",
- "utf8",
- "utils",
- "vctrs"
- ],
- "Hash": "15da5a8412f317beeee6175fbc76f4bb"
- },
- "pkgconfig": {
- "Package": "pkgconfig",
- "Version": "2.0.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "utils"
- ],
- "Hash": "01f28d4278f15c76cddbea05899c5d6f"
- },
- "plogr": {
- "Package": "plogr",
- "Version": "0.2.0",
- "Source": "Repository",
- "Repository": "CRAN",
- "Hash": "09eb987710984fc2905c7129c7d85e65"
- },
- "plotly": {
- "Package": "plotly",
- "Version": "4.10.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "RColorBrewer",
- "base64enc",
- "crosstalk",
- "data.table",
- "digest",
- "dplyr",
- "ggplot2",
- "htmltools",
- "htmlwidgets",
- "httr",
- "jsonlite",
- "lazyeval",
- "magrittr",
- "promises",
- "purrr",
- "rlang",
- "scales",
- "tibble",
- "tidyr",
- "tools",
- "vctrs",
- "viridisLite"
- ],
- "Hash": "6c00a09ba7d34917d9a3e28b15dd74e3"
- },
- "pool": {
- "Package": "pool",
- "Version": "1.0.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "DBI",
- "R",
- "R6",
- "later",
- "methods",
- "rlang",
- "withr"
- ],
- "Hash": "52d086ff1a2ccccbae6d462cb0773835"
- },
- "prettyunits": {
- "Package": "prettyunits",
- "Version": "1.1.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Hash": "95ef9167b75dde9d2ccc3c7528393e7e"
- },
- "progress": {
- "Package": "progress",
- "Version": "1.2.2",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R6",
- "crayon",
- "hms",
- "prettyunits"
- ],
- "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061"
- },
- "promises": {
- "Package": "promises",
- "Version": "1.2.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R6",
- "Rcpp",
- "fastmap",
- "later",
- "magrittr",
- "rlang",
- "stats"
- ],
- "Hash": "0d8a15c9d000970ada1ab21405387dee"
- },
- "purrr": {
- "Package": "purrr",
- "Version": "1.0.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cli",
- "lifecycle",
- "magrittr",
- "rlang",
- "vctrs"
- ],
- "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc"
- },
- "rJava": {
- "Package": "rJava",
- "Version": "1.0-6",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "0415819f6baa75d86d52483f7292b623"
- },
- "rappdirs": {
- "Package": "rappdirs",
- "Version": "0.3.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "5e3c5dc0b071b21fa128676560dbe94d"
- },
- "reactR": {
- "Package": "reactR",
- "Version": "0.4.4",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "htmltools"
- ],
- "Hash": "75389c8091eb14ee21c6bc87a88b3809"
- },
- "reactable": {
- "Package": "reactable",
- "Version": "0.4.4",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "digest",
- "htmltools",
- "htmlwidgets",
- "jsonlite",
- "reactR"
- ],
- "Hash": "6069eb2a6597963eae0605c1875ff14c"
- },
- "readr": {
- "Package": "readr",
- "Version": "2.1.4",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "R6",
- "cli",
- "clipr",
- "cpp11",
- "crayon",
- "hms",
- "lifecycle",
- "methods",
- "rlang",
- "tibble",
- "tzdb",
- "utils",
- "vroom"
- ],
- "Hash": "b5047343b3825f37ad9d3b5d89aa1078"
- },
- "renv": {
- "Package": "renv",
- "Version": "1.0.2",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "utils"
- ],
- "Hash": "4b22ac016fe54028b88d0c68badbd061"
- },
- "rlang": {
- "Package": "rlang",
- "Version": "1.1.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "utils"
- ],
- "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb"
- },
- "rmarkdown": {
- "Package": "rmarkdown",
- "Version": "2.24",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "bslib",
- "evaluate",
- "fontawesome",
- "htmltools",
- "jquerylib",
- "jsonlite",
- "knitr",
- "methods",
- "stringr",
- "tinytex",
- "tools",
- "utils",
- "xfun",
- "yaml"
- ],
- "Hash": "3854c37590717c08c32ec8542a2e0a35"
- },
- "sass": {
- "Package": "sass",
- "Version": "0.4.7",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R6",
- "fs",
- "htmltools",
- "rappdirs",
- "rlang"
- ],
- "Hash": "6bd4d33b50ff927191ec9acbf52fd056"
- },
- "scales": {
- "Package": "scales",
- "Version": "1.2.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "R6",
- "RColorBrewer",
- "farver",
- "labeling",
- "lifecycle",
- "munsell",
- "rlang",
- "viridisLite"
- ],
- "Hash": "906cb23d2f1c5680b8ce439b44c6fa63"
- },
- "shiny": {
- "Package": "shiny",
- "Version": "1.7.5",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "R6",
- "bslib",
- "cachem",
- "commonmark",
- "crayon",
- "ellipsis",
- "fastmap",
- "fontawesome",
- "glue",
- "grDevices",
- "htmltools",
- "httpuv",
- "jsonlite",
- "later",
- "lifecycle",
- "methods",
- "mime",
- "promises",
- "rlang",
- "sourcetools",
- "tools",
- "utils",
- "withr",
- "xtable"
- ],
- "Hash": "438b99792adbe82a8329ad8697d45afe"
- },
- "shinyWidgets": {
- "Package": "shinyWidgets",
- "Version": "0.8.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "anytime",
- "bslib",
- "grDevices",
- "htmltools",
- "jsonlite",
- "rlang",
- "sass",
- "shiny"
- ],
- "Hash": "c6acc72327e63668bbc7bd258ee54132"
- },
- "shinycssloaders": {
- "Package": "shinycssloaders",
- "Version": "1.0.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "digest",
- "glue",
- "grDevices",
- "shiny"
- ],
- "Hash": "f39bb3c44a9b496723ec7e86f9a771d8"
- },
- "shinydashboard": {
- "Package": "shinydashboard",
- "Version": "0.7.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "htmltools",
- "promises",
- "shiny",
- "utils"
- ],
- "Hash": "e418b532e9bb4eb22a714b9a9f1acee7"
- },
- "snow": {
- "Package": "snow",
- "Version": "0.4-4",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "utils"
- ],
- "Hash": "40b74690debd20c57d93d8c246b305d4"
- },
- "sodium": {
- "Package": "sodium",
- "Version": "1.2.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Hash": "3606bb09e0914edd4fc8313b500dcd5e"
- },
- "sourcetools": {
- "Package": "sourcetools",
- "Version": "0.1.7-1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "5f5a7629f956619d519205ec475fe647"
- },
- "stringi": {
- "Package": "stringi",
- "Version": "1.7.12",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "stats",
- "tools",
- "utils"
- ],
- "Hash": "ca8bd84263c77310739d2cf64d84d7c9"
- },
- "stringr": {
- "Package": "stringr",
- "Version": "1.5.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cli",
- "glue",
- "lifecycle",
- "magrittr",
- "rlang",
- "stringi",
- "vctrs"
- ],
- "Hash": "671a4d384ae9d32fc47a14e98bfa3dc8"
- },
- "sys": {
- "Package": "sys",
- "Version": "3.4.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Hash": "3a1be13d68d47a8cd0bfd74739ca1555"
- },
- "tibble": {
- "Package": "tibble",
- "Version": "3.2.1",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "fansi",
- "lifecycle",
- "magrittr",
- "methods",
- "pillar",
- "pkgconfig",
- "rlang",
- "utils",
- "vctrs"
- ],
- "Hash": "a84e2cc86d07289b3b6f5069df7a004c"
- },
- "tidyr": {
- "Package": "tidyr",
- "Version": "1.3.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cli",
- "cpp11",
- "dplyr",
- "glue",
- "lifecycle",
- "magrittr",
- "purrr",
- "rlang",
- "stringr",
- "tibble",
- "tidyselect",
- "utils",
- "vctrs"
- ],
- "Hash": "e47debdc7ce599b070c8e78e8ac0cfcf"
- },
- "tidyselect": {
- "Package": "tidyselect",
- "Version": "1.2.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cli",
- "glue",
- "lifecycle",
- "rlang",
- "vctrs",
- "withr"
- ],
- "Hash": "79540e5fcd9e0435af547d885f184fd5"
- },
- "timechange": {
- "Package": "timechange",
- "Version": "0.2.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cpp11"
- ],
- "Hash": "8548b44f79a35ba1791308b61e6012d7"
- },
- "tinytex": {
- "Package": "tinytex",
- "Version": "0.46",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "xfun"
- ],
- "Hash": "0c41a73214d982f539c56a7773c7afa5"
- },
- "tippy": {
- "Package": "tippy",
- "Version": "0.1.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "htmltools",
- "htmlwidgets",
- "jsonlite",
- "shiny"
- ],
- "Hash": "39b1d69229e30314e7cba023c777f52d"
- },
- "triebeard": {
- "Package": "triebeard",
- "Version": "0.4.1",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "Rcpp"
- ],
- "Hash": "642507a148b0dd9b5620177e0a044413"
- },
- "tzdb": {
- "Package": "tzdb",
- "Version": "0.4.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cpp11"
- ],
- "Hash": "f561504ec2897f4d46f0c7657e488ae1"
- },
- "urltools": {
- "Package": "urltools",
- "Version": "1.7.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "Rcpp",
- "methods",
- "triebeard"
- ],
- "Hash": "e86a704261a105f4703f653e05defa3e"
- },
- "utf8": {
- "Package": "utf8",
- "Version": "1.2.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "1fe17157424bb09c48a8b3b550c753bc"
- },
- "vctrs": {
- "Package": "vctrs",
- "Version": "0.6.3",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "cli",
- "glue",
- "lifecycle",
- "rlang"
- ],
- "Hash": "d0ef2856b83dc33ea6e255caf6229ee2"
- },
- "viridisLite": {
- "Package": "viridisLite",
- "Version": "0.4.2",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R"
- ],
- "Hash": "c826c7c4241b6fc89ff55aaea3fa7491"
- },
- "vroom": {
- "Package": "vroom",
- "Version": "1.6.3",
- "Source": "Repository",
- "Repository": "CRAN",
- "Requirements": [
- "R",
- "bit64",
- "cli",
- "cpp11",
- "crayon",
- "glue",
- "hms",
- "lifecycle",
- "methods",
- "progress",
- "rlang",
- "stats",
- "tibble",
- "tidyselect",
- "tzdb",
- "vctrs",
- "withr"
- ],
- "Hash": "8318e64ffb3a70e652494017ec455561"
- },
- "withr": {
- "Package": "withr",
- "Version": "2.5.0",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "grDevices",
- "graphics",
- "stats"
- ],
- "Hash": "c0e49a9760983e81e55cdd9be92e7182"
- },
- "xfun": {
- "Package": "xfun",
- "Version": "0.40",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "stats",
- "tools"
- ],
- "Hash": "be07d23211245fc7d4209f54c4e4ffc8"
- },
- "xml2": {
- "Package": "xml2",
- "Version": "1.3.5",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "methods"
- ],
- "Hash": "6c40e5cfcc6aefd88110666e18c31f40"
- },
- "xtable": {
- "Package": "xtable",
- "Version": "1.8-4",
- "Source": "Repository",
- "Repository": "RSPM",
- "Requirements": [
- "R",
- "stats",
- "utils"
- ],
- "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2"
- },
- "yaml": {
- "Package": "yaml",
- "Version": "2.3.7",
- "Source": "Repository",
- "Repository": "RSPM",
- "Hash": "0d0056cc5383fbc240ccd0cb584bf436"
- },
- "zip": {
- "Package": "zip",
- "Version": "2.3.0",
- "Source": "Repository",
- "Repository": "CRAN",
- "Hash": "d98c94dacb7e0efcf83b0a133a705504"
- }
- }
-}
diff --git a/inst/sql/sql_server/CohortSourceCodes.sql b/inst/sql/sql_server/CohortSourceCodes.sql
index cc45ab8f1..03ac9ba55 100644
--- a/inst/sql/sql_server/CohortSourceCodes.sql
+++ b/inst/sql/sql_server/CohortSourceCodes.sql
@@ -13,7 +13,7 @@ IF OBJECT_ID('tempdb..@include_source_concept_table', 'U') IS NOT NULL
SELECT codeset_id AS concept_set_id,
concept_sets.concept_id,
- source_concept_id,
+ COALESCE(source_concept_id, concept_sets.concept_id) as source_concept_id,
{@by_month} ? {
event_year,
event_month,
diff --git a/inst/sql/sql_server/UpdateVersionNumber.sql b/inst/sql/sql_server/UpdateVersionNumber.sql
index b9b3bcdbf..2cb68a1e0 100644
--- a/inst/sql/sql_server/UpdateVersionNumber.sql
+++ b/inst/sql/sql_server/UpdateVersionNumber.sql
@@ -1,5 +1,5 @@
{DEFAULT @package_version = package_version}
-{DEFAULT @version_number = '3.2.4'}
+{DEFAULT @version_number = '3.3.0'}
DELETE FROM @database_schema.@table_prefix@package_version;
INSERT INTO @database_schema.@table_prefix@package_version (version_number) VALUES ('@version_number');
@@ -10,3 +10,4 @@ INSERT INTO @database_schema.@table_prefix@package_version (version_number) VALU
+
diff --git a/man/deployPositConnectApp.Rd b/man/deployPositConnectApp.Rd
new file mode 100644
index 000000000..71b2659e4
--- /dev/null
+++ b/man/deployPositConnectApp.Rd
@@ -0,0 +1,65 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Shiny.R
+\name{deployPositConnectApp}
+\alias{deployPositConnectApp}
+\title{Rsconnect deploy}
+\usage{
+deployPositConnectApp(
+ appName,
+ appDir = tempfile(),
+ sqliteDbPath = "MergedCohortDiagnosticsData.sqlite",
+ shinyDirectory = system.file(file.path("shiny", "DiagnosticsExplorer"), package =
+ "CohortDiagnostics"),
+ connectionDetails = NULL,
+ shinyConfigPath = NULL,
+ resultsDatabaseSchema = NULL,
+ vocabularyDatabaseSchemas = resultsDatabaseSchema,
+ tablePrefix = "",
+ cohortTableName = "cohort",
+ databaseTableName = "database",
+ port = 80,
+ useRenvironFile = FALSE,
+ ...
+)
+}
+\arguments{
+\item{appName}{string name to call app - should be unique on posit connect server}
+
+\item{appDir}{optional - directory to use to copy files for deployment. If you use a consistent dir
+other internal options can change.}
+
+\item{sqliteDbPath}{Path to merged sqlite file. See \code{\link{createMergedResultsFile}} to create file.}
+
+\item{shinyDirectory}{(optional) Directyory shiny app code lives. Use this if you wish to modify the explorer}
+
+\item{connectionDetails}{An object of type \code{connectionDetails} as created using the
+\code{\link[DatabaseConnector]{createConnectionDetails}} function in the
+DatabaseConnector package, specifying how to connect to the server where
+the CohortDiagnostics results have been uploaded using the
+\code{\link{uploadResults}} function.}
+
+\item{shinyConfigPath}{Path to shiny yml configuration file (use instead of sqliteDbPath or connectionDetails object)}
+
+\item{resultsDatabaseSchema}{The schema on the database server where the CohortDiagnostics results
+have been uploaded.}
+
+\item{vocabularyDatabaseSchemas}{(optional) A list of one or more schemas on the database server where the vocabulary tables are located.
+The default value is the value of the resultsDatabaseSchema. We can provide a list of vocabulary schema
+that might represent different versions of the OMOP vocabulary tables. It allows us to compare the impact
+of vocabulary changes on Diagnostics. Not supported with an sqlite database.}
+
+\item{tablePrefix}{(Optional) string to insert before table names (e.g. "cd_") for database table names}
+
+\item{cohortTableName}{(Optional) if cohort table name differs from the standard - cohort (ignores prefix if set)}
+
+\item{databaseTableName}{(Optional) if database table name differs from the standard - database (ignores prefix if set)}
+
+\item{port}{(optional) Only used if \code{runOverNetwork} = TRUE.}
+
+\item{useRenvironFile}{logical - not recommended, store db credentials in .Renviron file}
+
+\item{...}{other parameters passed to rsconnect::deployApp}
+}
+\description{
+Deploy your application to an posit connect platform or shinyapps.io server
+}
diff --git a/man/executeDiagnostics.Rd b/man/executeDiagnostics.Rd
index 836c50549..9884c5824 100644
--- a/man/executeDiagnostics.Rd
+++ b/man/executeDiagnostics.Rd
@@ -34,7 +34,12 @@ executeDiagnostics(
minCharacterizationMean = 0.01,
irWashoutPeriod = 0,
incremental = FALSE,
- incrementalFolder = file.path(exportFolder, "incremental")
+ incrementalFolder = file.path(exportFolder, "incremental"),
+ runOnSample = FALSE,
+ sampleN = 1000,
+ seed = 64374,
+ seedArgs = NULL,
+ sampleIdentifierExpression = "cohortId * 1000 + seed"
)
}
\arguments{
@@ -121,6 +126,23 @@ on covariates that have very low values. The default is 0.001 (i.e. 0.1 percent)
\item{incrementalFolder}{If \code{incremental = TRUE}, specify a folder where records are kept
of which cohort diagnostics has been executed.}
+
+\item{runOnSample}{Logical. If TRUE, the function will operate on a sample of the data.
+Default is FALSE, meaning the function will operate on the full data set.}
+
+\item{sampleN}{Integer. The number of records to include in the sample if runOnSample is TRUE.
+Default is 1000. Ignored if runOnSample is FALSE.}
+
+\item{seed}{Integer. The seed for the random number generator used to create the sample.
+This ensures that the same sample can be drawn again in future runs. Default is 64374.}
+
+\item{seedArgs}{List. Additional arguments to pass to the sampling function.
+This can be used to control aspects of the sampling process beyond the seed and sample size.}
+
+\item{sampleIdentifierExpression}{Character. An expression that generates unique identifiers for each sample.
+This expression can use the variables 'cohortId' and 'seed'.
+Default is "cohortId * 1000 + seed", which ensures unique identifiers
+as long as there are fewer than 1000 cohorts.}
}
\description{
Runs the cohort diagnostics on all (or a subset of) the cohorts instantiated using the
diff --git a/man/launchDiagnosticsExplorer.Rd b/man/launchDiagnosticsExplorer.Rd
index 33eeb8fb3..390e7f6af 100644
--- a/man/launchDiagnosticsExplorer.Rd
+++ b/man/launchDiagnosticsExplorer.Rd
@@ -20,8 +20,7 @@ launchDiagnosticsExplorer(
makePublishable = FALSE,
publishDir = file.path(getwd(), "DiagnosticsExplorer"),
overwritePublishDir = FALSE,
- launch.browser = FALSE,
- enableAnnotation = TRUE
+ launch.browser = FALSE
)
}
\arguments{
@@ -66,8 +65,6 @@ If not provided, no About tab will be shown.}
\item{launch.browser}{Should the app be launched in your default browser, or in a Shiny window.
Note: copying to clipboard will not work in a Shiny window.}
-
-\item{enableAnnotation}{Enable annotation functionality in shiny app}
}
\description{
Launch the Diagnostics Explorer Shiny app
diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R
index 75ba366cf..276c61fdb 100644
--- a/tests/testthat/helper.R
+++ b/tests/testthat/helper.R
@@ -67,7 +67,7 @@ loadTestCohortDefinitionSet <- function(cohortIds = NULL, useSubsets = TRUE) {
cohortFileNameValue = c("cohortId")
)
if (!is.null(cohortIds)) {
- cohortDefinitionSet <- cohortDefinitionSet %>% dplyr::filter(cohortId %in% cohortIds)
+ cohortDefinitionSet <- cohortDefinitionSet %>% dplyr::filter(.data$cohortId %in% cohortIds)
}
if (useSubsets) {
diff --git a/tests/testthat/test-1-ResultsDataModel.R b/tests/testthat/test-1-ResultsDataModel.R
index 01b448192..07d71a30e 100644
--- a/tests/testthat/test-1-ResultsDataModel.R
+++ b/tests/testthat/test-1-ResultsDataModel.R
@@ -122,7 +122,8 @@ VALUES ('Synthea','Synthea','OHDSI Community','SyntheaTM is a Synthetic Patient
runOrphanConcepts = TRUE,
incremental = TRUE,
incrementalFolder = file.path(folder, "incremental"),
- temporalCovariateSettings = temporalCovariateSettings
+ temporalCovariateSettings = temporalCovariateSettings,
+ runOnSample = TRUE
)
},
"CDM Source table has more than one record while only one is expected."
@@ -147,7 +148,8 @@ VALUES ('Synthea','Synthea','OHDSI Community','SyntheaTM is a Synthetic Patient
runOrphanConcepts = TRUE,
incremental = TRUE,
incrementalFolder = file.path(folder, "incremental"),
- temporalCovariateSettings = temporalCovariateSettings
+ temporalCovariateSettings = temporalCovariateSettings,
+ runOnSample = TRUE
)
}
@@ -175,7 +177,7 @@ VALUES ('Synthea','Synthea','OHDSI Community','SyntheaTM is a Synthetic Patient
primaryKey <- specifications %>%
dplyr::filter(tableName == !!tableName &
primaryKey == "Yes") %>%
- dplyr::select(columnName) %>%
+ dplyr::select("columnName") %>%
dplyr::pull()
if ("database_id" %in% primaryKey) {
@@ -211,7 +213,7 @@ test_that("Sqlite results data model", {
primaryKey <- specifications %>%
dplyr::filter(tableName == !!tableName &
primaryKey == "Yes") %>%
- dplyr::select(columnName) %>%
+ dplyr::select("columnName") %>%
dplyr::pull()
if ("database_id" %in% primaryKey) {
diff --git a/tests/testthat/test-2-againstCdm.R b/tests/testthat/test-2-againstCdm.R
index 54a2107ba..fa2ffeb15 100644
--- a/tests/testthat/test-2-againstCdm.R
+++ b/tests/testthat/test-2-againstCdm.R
@@ -44,7 +44,8 @@ test_that("Cohort diagnostics in incremental mode", {
minCellCount = minCellCountValue,
incremental = TRUE,
incrementalFolder = file.path(folder, "incremental"),
- temporalCovariateSettings = temporalCovariateSettings
+ temporalCovariateSettings = temporalCovariateSettings,
+ runOnSample = TRUE
)
)
@@ -74,7 +75,8 @@ test_that("Cohort diagnostics in incremental mode", {
minCellCount = minCellCountValue,
incremental = TRUE,
incrementalFolder = file.path(folder, "incremental"),
- temporalCovariateSettings = temporalCovariateSettings
+ temporalCovariateSettings = temporalCovariateSettings,
+ runOnSample = TRUE
)
)
# generate sqlite file
@@ -120,7 +122,8 @@ test_that("Cohort diagnostics in incremental mode", {
minCellCount = minCellCountValue,
incremental = FALSE,
incrementalFolder = file.path(folder, "incremental"),
- temporalCovariateSettings = temporalCovariateSettings
+ temporalCovariateSettings = temporalCovariateSettings,
+ runOnSample = TRUE
)
})
diff --git a/tests/testthat/test-5-moduleTimeSeries.R b/tests/testthat/test-5-moduleTimeSeries.R
index e2e857a77..b8b5feee2 100644
--- a/tests/testthat/test-5-moduleTimeSeries.R
+++ b/tests/testthat/test-5-moduleTimeSeries.R
@@ -232,9 +232,9 @@ test_that("Testing time series logic", {
# testing if values returned for cohort 1 is as expected
timeSeriesCohort <- timeSeries %>%
- dplyr::filter(cohortId == 1) %>%
- dplyr::filter(seriesType == "T1") %>%
- dplyr::filter(calendarInterval == "m")
+ dplyr::filter(.data$cohortId == 1) %>%
+ dplyr::filter(.data$seriesType == "T1") %>%
+ dplyr::filter(.data$calendarInterval == "m")
# there should be 8 records in this data frame, representing 8 months for the one subject in the cohort id = 1
testthat::expect_equal(
@@ -244,13 +244,13 @@ test_that("Testing time series logic", {
# there should be 2 records in this data frame, representing the 2 starts for the one subject in the cohort id = 1
testthat::expect_equal(
- object = nrow(timeSeriesCohort %>% dplyr::filter(recordsStart == 1)),
+ object = nrow(timeSeriesCohort %>% dplyr::filter(.data$recordsStart == 1)),
expected = 2
)
# there should be 1 records in this data frame, representing the 1 incident start for the one subject in the cohort id = 1
testthat::expect_equal(
- object = nrow(timeSeriesCohort %>% dplyr::filter(subjectsStartIn == 1)),
+ object = nrow(timeSeriesCohort %>% dplyr::filter(.data$subjectsStartIn == 1)),
expected = 1
)
})
diff --git a/tests/testthat/test-other.R b/tests/testthat/test-other.R
index cf57588c3..475f17b18 100644
--- a/tests/testthat/test-other.R
+++ b/tests/testthat/test-other.R
@@ -124,3 +124,35 @@ test_that("timeExecutions function", {
checkmate::expect_data_frame(result, nrows = 5, ncols = 5)
expect_false(all(is.na(result$startTime)))
})
+
+test_that("enforceMinCellValue replaces values below minimum with negative of minimum", {
+ data <- data.frame(a = c(1, 2, 3, 4, 5))
+ minValues <- 3
+ result <- enforceMinCellValue(data, "a", minValues, silent = TRUE)
+
+ expect_equal(result$a, c(-3, -3, 3, 4, 5))
+})
+
+test_that("enforceMinCellValue does not replace NA values", {
+ data <- data.frame(a = c(1, 2, NA, 4, 5))
+ minValues <- 3
+ result <- enforceMinCellValue(data, "a", minValues, silent = TRUE)
+
+ expect_equal(result$a, c(-3, -3, NA, 4, 5))
+})
+
+test_that("enforceMinCellValue does not replace zero values", {
+ data <- data.frame(a = c(0, 2, 3, 4, 5))
+ minValues <- 3
+ result <- enforceMinCellValue(data, "a", minValues, silent = TRUE)
+
+ expect_equal(result$a, c(0, -3, 3, 4, 5))
+})
+
+test_that("enforceMinCellValue works with vector of minimum values", {
+ data <- data.frame(a = c(1, 2, 3, 4, 5))
+ minValues <- c(1, 2, 3, 4, 5)
+ result <- enforceMinCellValue(data, "a", minValues, silent = TRUE)
+
+ expect_equal(result$a, c(1, 2, 3, 4, 5))
+})