Skip to content

Commit

Permalink
Correct use of keys to overwrite old data
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Sep 26, 2024
1 parent a161376 commit 52cb41c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions R/CohortRelationship.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#' @param targetCohortIds A vector of one or more Cohort Ids for use as target cohorts.
#'
#' @param comparatorCohortIds A vector of one or more Cohort Ids for use as feature/comparator cohorts.
#' @param targetComparatorPairs A vector of one or more Cohort Ids for use as feature/comparator cohorts.
#'
#' @param relationshipDays A dataframe with two columns startDay and endDay representing periods of time to compute relationship
#'
Expand All @@ -44,8 +45,9 @@ runCohortRelationshipDiagnostics <-
cohortDatabaseSchema = NULL,
tempEmulationSchema = NULL,
cohortTable = "cohort",
targetCohortIds,
comparatorCohortIds,
targetCohortIds = NULL,
comparatorCohortIds = NULL,
targetComparatorPairs = NULL,
relationshipDays) {
startTime <- Sys.time()

Expand All @@ -66,7 +68,8 @@ runCohortRelationshipDiagnostics <-
any.missing = FALSE,
min.len = 1,
unique = TRUE,
add = errorMessage
add = errorMessage,
null.ok = TRUE
)
checkmate::assertIntegerish(
x = comparatorCohortIds,
Expand Down Expand Up @@ -369,7 +372,11 @@ executeCohortRelationshipDiagnostics <- function(connection,
writeToCsv(
data = data,
fileName = outputFile,
incremental = TRUE
incremental = TRUE,
cohortId = data$cohortId,
comparatorCohortId = data$comparatorCohortId,
startDay = data$startDay,
endDay = data$endDay
)

recordTasksDone(
Expand Down

0 comments on commit 52cb41c

Please sign in to comment.