diff --git a/data-raw/test_db/create_test_db.R b/data-raw/test_db/create_test_db.R index 8b500f2..a9647e5 100644 --- a/data-raw/test_db/create_test_db.R +++ b/data-raw/test_db/create_test_db.R @@ -21,7 +21,7 @@ schema <- "main" withr::with_envvar( new = c(EUNOMIA_DATA_FOLDER = dir), { - invisible(CDMConnector::eunomia_dir(dataset_name = name, cdm_version = version)) + invisible(CDMConnector::eunomiaDir(datasetName = name, cdmVersion = version)) } ) @@ -103,7 +103,7 @@ write_table(dummy_observations, con, "observation", schema = schema) ## Verify integrity, turn warnings into error tryCatch( - cdm <- CDMConnector::cdm_from_con(con, cdm_schema = schema, write_schema = schema), + cdm <- CDMConnector::cdmFromCon(con, cdmSchema = schema, writeSchema = schema), warning = function(cnd) { msg <- sprintf("CDM integrity check produced warnings: %s", conditionMessage(cnd)) rlang::abort(msg, call = NULL) diff --git a/data-raw/test_db/dummy/add_dummy_bundle_concepts.R b/data-raw/test_db/dummy/add_dummy_bundle_concepts.R index 6e1af81..7b95552 100644 --- a/data-raw/test_db/dummy/add_dummy_bundle_concepts.R +++ b/data-raw/test_db/dummy/add_dummy_bundle_concepts.R @@ -9,11 +9,11 @@ here::i_am("data-raw/test_db/dummy/add_dummy_bundle_concepts.R") db_path <- here::here("data-raw/test_db/eunomia/synthea-allergies-10k_5.3_1.0.duckdb") con <- connect_to_db(db_path) -eunomia_cdm <- CDMConnector::cdm_from_con( +eunomia_cdm <- CDMConnector::cdmFromCon( con = con, - cdm_schema = "main", - write_schema = "main", - cdm_name = "synthea-allergies-10k" + cdmSchema = "main", + writeSchema = "main", + cdmName = "synthea-allergies-10k" ) eunomia_concepts <- eunomia_cdm$concept |> dplyr::pull(concept_id) diff --git a/preprocessing/R/concepts.R b/preprocessing/R/concepts.R index 6081e74..4229213 100644 --- a/preprocessing/R/concepts.R +++ b/preprocessing/R/concepts.R @@ -1,6 +1,6 @@ #' Generate the `omopcat_concepts` table #' -#' @param cdm A [`CDMConnector`] object, e.g. from [`CDMConnector::cdm_from_con()`] +#' @param cdm A [`CDMConnector`] object, e.g. from [`CDMConnector::cdmFromCon()`] #' @param concept_ids A vector of concept IDs #' #' @return A `data.frame` with the monthly counts diff --git a/preprocessing/R/monthly_counts.R b/preprocessing/R/monthly_counts.R index 105ddde..104f40c 100644 --- a/preprocessing/R/monthly_counts.R +++ b/preprocessing/R/monthly_counts.R @@ -1,6 +1,6 @@ #' Generate the 'omopcat_monthly_counts' table #' -#' @param cdm A [`CDMConnector`] object, e.g. from [`CDMConnector::cdm_from_con()`] +#' @param cdm A [`CDMConnector`] object, e.g. from [`CDMConnector::cdmFromCon()`] #' @param threshold Threshold value below which values will be replaced by `replacement` #' @param replacement Value with which values below `threshold` will be replaced #' @param level At which resolution the counts should be summarised. diff --git a/preprocessing/R/preprocess.R b/preprocessing/R/preprocess.R index b4cdce8..e4bcf91 100644 --- a/preprocessing/R/preprocess.R +++ b/preprocessing/R/preprocess.R @@ -104,7 +104,7 @@ preprocess <- function(out_path = Sys.getenv("PREPROCESS_OUT_PATH")) { #' configured through the relevant environment variables. #' #' When not in production, creates a CDM from one of the CDMConnector example -#' datasets (`"GiBleed"` by default), using [`CDMConnector::eunomia_dir()`]. +#' datasets (`"GiBleed"` by default), using [`CDMConnector::eunomiaDir()`]. #' This is intended for use in testing and development. #' #' @param .envir Passed on to [`connect_to_db()`], controls the scope in which the database @@ -124,16 +124,16 @@ preprocess <- function(out_path = Sys.getenv("PREPROCESS_OUT_PATH")) { ) } else { name <- Sys.getenv("DB_NAME", unset = "GiBleed") - duckdb_path <- CDMConnector::eunomia_dir(dataset_name = name) + duckdb_path <- CDMConnector::eunomiaDir(datasetName = name) rlang::check_installed("duckdb") con <- connect_to_db(duckdb::duckdb(duckdb_path), .envir = .envir) } # Load the data in a CDMConnector object - CDMConnector::cdm_from_con( + CDMConnector::cdmFromCon( con = con, - cdm_schema = Sys.getenv("DB_CDM_SCHEMA", unset = "main"), - write_schema = Sys.getenv("DB_CDM_SCHEMA", unset = "main"), - cdm_name = name + cdmSchema = Sys.getenv("DB_CDM_SCHEMA", unset = "main"), + writeSchema = Sys.getenv("DB_CDM_SCHEMA", unset = "main"), + cdmName = name ) } diff --git a/preprocessing/R/summary_stats.R b/preprocessing/R/summary_stats.R index 45d144b..46a9502 100644 --- a/preprocessing/R/summary_stats.R +++ b/preprocessing/R/summary_stats.R @@ -1,6 +1,6 @@ #' Generate the `omopcat_summary_stats` table #' -#' @param cdm A [`CDMConnector`] object, e.g. from [`CDMConnector::cdm_from_con()`] +#' @param cdm A [`CDMConnector`] object, e.g. from [`CDMConnector::cdmFromCon()`] #' @param threshold Threshold value below which values will be replaced by `replacement` #' @param replacement Value with which values below `threshold` will be replaced #' diff --git a/preprocessing/man/generate_concepts.Rd b/preprocessing/man/generate_concepts.Rd index dce5168..4b4e992 100644 --- a/preprocessing/man/generate_concepts.Rd +++ b/preprocessing/man/generate_concepts.Rd @@ -7,7 +7,7 @@ generate_concepts(cdm, concept_ids) } \arguments{ -\item{cdm}{A \code{\link{CDMConnector}} object, e.g. from \code{\link[CDMConnector:cdm_from_con]{CDMConnector::cdm_from_con()}}} +\item{cdm}{A \code{\link{CDMConnector}} object, e.g. from \code{\link[CDMConnector:cdmFromCon]{CDMConnector::cdmFromCon()}}} \item{concept_ids}{A vector of concept IDs} } diff --git a/preprocessing/man/generate_monthly_counts.Rd b/preprocessing/man/generate_monthly_counts.Rd index 930ae57..e9571fd 100644 --- a/preprocessing/man/generate_monthly_counts.Rd +++ b/preprocessing/man/generate_monthly_counts.Rd @@ -12,7 +12,7 @@ generate_monthly_counts( ) } \arguments{ -\item{cdm}{A \code{\link{CDMConnector}} object, e.g. from \code{\link[CDMConnector:cdm_from_con]{CDMConnector::cdm_from_con()}}} +\item{cdm}{A \code{\link{CDMConnector}} object, e.g. from \code{\link[CDMConnector:cdmFromCon]{CDMConnector::cdmFromCon()}}} \item{threshold}{Threshold value below which values will be replaced by \code{replacement}} diff --git a/preprocessing/man/generate_summary_stats.Rd b/preprocessing/man/generate_summary_stats.Rd index 00c61bf..eaf14ac 100644 --- a/preprocessing/man/generate_summary_stats.Rd +++ b/preprocessing/man/generate_summary_stats.Rd @@ -7,7 +7,7 @@ generate_summary_stats(cdm, threshold, replacement) } \arguments{ -\item{cdm}{A \code{\link{CDMConnector}} object, e.g. from \code{\link[CDMConnector:cdm_from_con]{CDMConnector::cdm_from_con()}}} +\item{cdm}{A \code{\link{CDMConnector}} object, e.g. from \code{\link[CDMConnector:cdmFromCon]{CDMConnector::cdmFromCon()}}} \item{threshold}{Threshold value below which values will be replaced by \code{replacement}}