Skip to content

Commit

Permalink
Revert "Fixes to support big int cohorts ids"
Browse files Browse the repository at this point in the history
This reverts commit c1a46ce.
  • Loading branch information
azimov committed Jan 4, 2024
1 parent c1a46ce commit de27d57
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions R/Analyses.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,19 @@ createOutcome <- function(outcomeId,
riskWindowEnd = NULL,
endAnchor = NULL) {
errorMessages <- checkmate::makeAssertCollection()
checkmate::assertNumeric(outcomeId, add = errorMessages)
checkmate::assertInt(outcomeId, add = errorMessages)
checkmate::assertLogical(outcomeOfInterest, add = errorMessages)
checkmate::assertNumeric(trueEffectSize, len = 1, null.ok = TRUE, add = errorMessages)
checkmate::assertInt(riskWindowStart, null.ok = TRUE, add = errorMessages)
checkmate::assertInt(riskWindowEnd, null.ok = TRUE, add = errorMessages)
checkmate::reportAssertions(collection = errorMessages)
if (!is.null(startAnchor) && !grepl("start$|end$", startAnchor, ignore.case = TRUE)) {
stop("startAnchor should have value \'cohort start\' or \'cohort end\'")
stop("startAnchor should have value 'cohort start' or 'cohort end'")
}
if (!is.null(riskWindowEnd) && !grepl("start$|end$", endAnchor, ignore.case = TRUE)) {
stop("endAnchor should have value \'cohort start\' or \'cohort end\'")
stop("endAnchor should have value 'cohort start' or 'cohort end'")
}

outcome <- list()
for (name in names(formals(createOutcome))) {
outcome[[name]] <- get(name)
Expand Down Expand Up @@ -258,8 +259,8 @@ createTargetComparatorOutcomes <- function(targetId,
excludedCovariateConceptIds = c(),
includedCovariateConceptIds = c()) {
errorMessages <- checkmate::makeAssertCollection()
checkmate::assertNumeric(targetId, add = errorMessages)
checkmate::assertNumeric(comparatorId, add = errorMessages)
checkmate::assertInt(targetId, add = errorMessages)
checkmate::assertInt(comparatorId, add = errorMessages)
checkmate::assertList(outcomes, min.len = 1, add = errorMessages)
for (i in seq_along(outcomes)) {
checkmate::assertClass(outcomes[[i]], "outcome", add = errorMessages)
Expand Down
6 changes: 3 additions & 3 deletions R/DataLoadingSaving.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ getDbCohortMethodData <- function(connectionDetails,
checkmate::assertClass(connectionDetails, "ConnectionDetails", add = errorMessages)
checkmate::assertCharacter(cdmDatabaseSchema, len = 1, add = errorMessages)
checkmate::assertCharacter(tempEmulationSchema, len = 1, null.ok = TRUE, add = errorMessages)
checkmate::assertNumeric(targetId, add = errorMessages)
checkmate::assertNumeric(comparatorId, add = errorMessages)
checkmate::assertNumeric(outcomeIds, add = errorMessages)
checkmate::assertInt(targetId, add = errorMessages)
checkmate::assertInt(comparatorId, add = errorMessages)
checkmate::assertIntegerish(outcomeIds, add = errorMessages)
checkmate::assertCharacter(studyStartDate, len = 1, add = errorMessages)
checkmate::assertCharacter(studyEndDate, len = 1, add = errorMessages)
checkmate::assertCharacter(exposureDatabaseSchema, len = 1, add = errorMessages)
Expand Down
4 changes: 2 additions & 2 deletions R/RunAnalyses.R
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ getPs <- function(psFile) {
}

doCreateCmDataObject <- function(params) {
ParallelLogger::logDebug(sprintf("Calling getDbCohortMethodData() for targetId %s, comparatorId %s",
ParallelLogger::logDebug(sprintf("Calling getDbCohortMethodData() for targetId %d, comparatorId %d",
params$args$targetId,
params$args$comparatorId))
cohortMethodData <- do.call("getDbCohortMethodData", params$args)
Expand All @@ -761,7 +761,7 @@ doCreateStudyPopObject <- function(params) {
cohortMethodData <- getCohortMethodData(params$cohortMethodDataFile)
args <- params$args
args$cohortMethodData <- cohortMethodData
ParallelLogger::logDebug(sprintf("Calling createStudyPopulation() using %s for outcomeId %s",
ParallelLogger::logDebug(sprintf("Calling createStudyPopulation() using %s for outcomeId %d",
params$cohortMethodDataFile,
args$outcomeId))
studyPop <- do.call("createStudyPopulation", args)
Expand Down

0 comments on commit de27d57

Please sign in to comment.