Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time series #84

Merged
merged 18 commits into from
Oct 10, 2024
Prev Previous commit
Next Next commit
doc
ginberg committed Oct 8, 2024
commit 429a1b32a43a14718bf628683f748933f59d9e01
24 changes: 13 additions & 11 deletions R/runTimeSeries.R
Original file line number Diff line number Diff line change
@@ -417,20 +417,21 @@ getTimeSeries <- function(
#' @template CdmDatabaseSchema
#' @template TempEmulationSchema
#' @template CohortTable
#' @param cohortDefinitionSet
#' @template cohortDefinitionSet
#' @template databaseId
#' @template exportFolder
#' @template minCellCount
#' @template incremental
#' @template recordKeepingFile

#' @param runCohortTimeSeries Generate and export the cohort level time series?
#' @param runDataSourceTimeSeries Generate and export the Data source level time series? i.e.
#' using all persons found in observation period table.
#' @param databaseId
#' @param exportFolder
#' @param minCellCount
#' @param instantiatedCohorts
#' @param incremental
#' @param recordKeepingFile
#' @param observationPeriodDateRange
#' @param batchSize
#'
#' @return
#' @return None, it will write the results to a csv file
#' @export
#'
#' @examples
@@ -541,9 +542,10 @@ runTimeSeries <- function(connection,

# data source time series
if (runDataSourceTimeSeries) {
cohortId <- -44819062 # cohort id is identified by an omop concept id https://athena.ohdsi.org/search-terms/terms/44819062
subset <- subsetToRequiredCohorts(
cohorts = dplyr::tibble(
cohortId = -44819062, # cohort id is identified by an omop concept id https://athena.ohdsi.org/search-terms/terms/44819062
cohortId = cohortId,
checksum = computeChecksum(column = "data source time series")
),
task = "runDataSourceTimeSeries",
@@ -559,7 +561,7 @@ runTimeSeries <- function(connection,
timeExecution(
exportFolder,
"",
-44819062,
cohortId,
parent = "",
expr = {
data <-
@@ -582,11 +584,11 @@ runTimeSeries <- function(connection,
databaseId = databaseId,
exportFolder = exportFolder,
incremental = incremental,
cohortId = -44819062
cohortId = cohortId
)

recordTasksDone(
cohortId = -44819062,
cohortId = cohortId,
task = "runDataSourceTimeSeries",
checksum = subset$checksum,
recordKeepingFile = recordKeepingFile,
3 changes: 3 additions & 0 deletions man-roxygen/DatabaseIds.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#' @param databaseIds A vector one or more databaseIds to retrieve the results for. This is a
#' character field values from the `databaseId` field of the `database` table
#' of the results data model.
#' @param databaseId The databaseId to retrieve the results for. This is a
#' character field values from the `databaseId` field of the `database` table
#' of the results data model.
1 change: 1 addition & 0 deletions man-roxygen/ExportFolder.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#' @param exportFolder The folder where the results will be exported to
1 change: 1 addition & 0 deletions man-roxygen/Incremental.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#' @param incremental Create only cohort diagnostics that haven't been created before?
1 change: 1 addition & 0 deletions man-roxygen/MinCellCount.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#' @param minCellCount The minimum cell count for fields contains person counts or fractions
1 change: 1 addition & 0 deletions man-roxygen/RecordKeepingFile.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#' @template recordKeepingFile File that keeps a record of cohorts that have been created previously