From 0fa1c12cdaaa36d8004139899145e2948ff5340c Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 17 Jan 2025 14:46:57 +0100 Subject: [PATCH] fix oracleTempSchema --- R/AdditionalCovariates.R | 17 ++++++++++++++--- R/ExtractData.R | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/R/AdditionalCovariates.R b/R/AdditionalCovariates.R index 3f7377bac..141d4560a 100644 --- a/R/AdditionalCovariates.R +++ b/R/AdditionalCovariates.R @@ -24,7 +24,9 @@ #' cohort during the time periods relative to target population cohort index #' #' @param connection The database connection -#' @param oracleTempSchema The temp schema if using oracle + +#' @param tempEmulationSchema The schema to use for temp tables +#' @param oracleTempSchema DEPRECATED The temp schema if using oracle #' @param cdmDatabaseSchema The schema of the OMOP CDM data #' @param cdmVersion version of the OMOP CDM data #' @param cohortTable the table name that contains the target population cohort @@ -40,6 +42,7 @@ #' @export getCohortCovariateData <- function( connection, + tempEmulationSchema = NULL, oracleTempSchema = NULL, cdmDatabaseSchema, cdmVersion = "5", @@ -49,6 +52,14 @@ getCohortCovariateData <- function( cohortIds, covariateSettings, ...) { + if (!is.null(oracleTempSchema) && oracleTempSchema != "") { + rlang::warn("The 'oracleTempSchema' argument is deprecated. Use 'tempEmulationSchema' instead.", + .frequency = "regularly", + .frequency_id = "oracleTempSchema" + ) + tempEmulationSchema <- oracleTempSchema + } + # Some SQL to construct the covariate: sql <- paste( "select a.@row_id_field AS row_id, @covariate_id AS covariate_id,", @@ -104,7 +115,7 @@ getCohortCovariateData <- function( sql <- SqlRender::translate( sql = sql, targetDialect = attr(connection, "dbms"), - tempEmulationSchema = oracleTempSchema + tempEmulationSchema = tempEmulationSchema ) # Retrieve the covariate: @@ -135,7 +146,7 @@ getCohortCovariateData <- function( sql <- SqlRender::translate( sql = sql, targetDialect = attr(connection, "dbms"), - tempEmulationSchema = oracleTempSchema + tempEmulationSchema = tempEmulationSchema ) # Retrieve the covariateRef: diff --git a/R/ExtractData.R b/R/ExtractData.R index d7be8e637..4dbd6bcfe 100644 --- a/R/ExtractData.R +++ b/R/ExtractData.R @@ -316,7 +316,7 @@ getPlpData <- function( covariateData <- FeatureExtraction::getDbCovariateData( connection = connection, - oracleTempSchema = databaseDetails$tempEmulationSchema, + tempEmulationSchema = databaseDetails$tempEmulationSchema, cdmDatabaseSchema = databaseDetails$cdmDatabaseSchema, cdmVersion = databaseDetails$cdmVersion, cohortTable = "#cohort_person",