Skip to content

Commit eabfb42

Browse files
authored
Merge pull request #272 from OHDSI/develop
Release v3.7.0
2 parents a0bbc9b + 725aee8 commit eabfb42

93 files changed

Lines changed: 335 additions & 313 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 3.5.2
2-
Date: 2024-04-30 18:12:58 UTC
3-
SHA: fe1f8048024d84e8079e872e60c4623c9d0c5c5f
1+
Version: 3.7.0
2+
Date: 2024-09-03 08:24:46 UTC
3+
SHA: efa425b67203564c5a581de9180a87d14c28767e

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: FeatureExtraction
22
Type: Package
33
Title: Generating Features for a Cohort
4-
Version: 3.6.0
5-
Date: 2024-07-15
4+
Version: 3.7.0
5+
Date: 2024-09-02
66
Authors@R: c(
77
person("Martijn", "Schuemie", , "schuemie@ohdsi.org", role = c("aut")),
88
person("Marc", "Suchard", role = c("aut")),
@@ -45,6 +45,6 @@ VignetteBuilder: knitr
4545
URL: https://github.com/OHDSI/FeatureExtraction
4646
BugReports: https://github.com/OHDSI/FeatureExtraction/issues
4747
NeedsCompilation: no
48-
RoxygenNote: 7.3.1
48+
RoxygenNote: 7.3.2
4949
Encoding: UTF-8
5050
Language: en-US

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
FeatureExtraction 3.7.0
2+
=======================
3+
4+
- Deprecate oracleTempSchema param, add tempEmulationSchema param (#126)
5+
- Filter binary covariates server side (#255)
6+
- Limit tests that are run on CRAN (#267)
7+
18
FeatureExtraction 3.6.0
29
=======================
310

R/DefaultCovariateSettings.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@
483483
#' useMeasurementValueAsConceptAnyTimePrior = FALSE,
484484
#' useMeasurementValueAsConceptLongTerm = TRUE,
485485
#' useMeasurementValueAsConceptMediumTerm = FALSE,
486-
#' useMeasurementValueAsConceptShortTerm = TRUE,
486+
#' useMeasurementValueAsConceptShortTerm = TRUE,
487487
#' useObservationAnyTimePrior = FALSE,
488488
#' useObservationLongTerm = TRUE,
489489
#' useObservationMediumTerm = FALSE,
@@ -617,7 +617,7 @@ createCovariateSettings <- function(useDemographicsGender = FALSE,
617617
useObservationValueAsConceptAnyTimePrior = FALSE,
618618
useObservationValueAsConceptLongTerm = FALSE,
619619
useObservationValueAsConceptMediumTerm = FALSE,
620-
useObservationValueAsConceptShortTerm = FALSE,
620+
useObservationValueAsConceptShortTerm = FALSE,
621621
useCharlsonIndex = FALSE,
622622
useDcsi = FALSE,
623623
useChads2 = FALSE,

R/GetCovariates.R

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#' \code{connect} function in the \code{DatabaseConnector} package.
3434
#' Either the \code{connection} or \code{connectionDetails} argument
3535
#' should be specified.
36-
#' @param oracleTempSchema A schema where temp tables can be created in Oracle.
36+
#' @param oracleTempSchema DEPRECATED: use \code{tempEmulationSchema} instead.
3737
#' @param cdmDatabaseSchema The name of the database schema that contains the OMOP CDM instance.
3838
#' Requires read permissions to this database. On SQL Server, this should
3939
#' specify both the database and the schema, so for example
@@ -66,6 +66,9 @@
6666
#' @param minCharacterizationMean The minimum mean value for characterization output. Values below this will be cut off from output. This
6767
#' will help reduce the file size of the characterization output, but will remove information
6868
#' on covariates that have very low values. The default is 0.
69+
#' @param tempEmulationSchema Some database platforms like Oracle and Impala do not truly support
70+
#' temp tables. To emulate temp tables, provide a schema with write
71+
#' privileges where temp tables can be created.
6972
#'
7073
#' @return
7174
#' Returns an object of type \code{covariateData}, containing information on the covariates.
@@ -82,7 +85,7 @@
8285
#' )
8386
#' covData <- getDbCovariateData(
8487
#' connectionDetails = eunomiaConnectionDetails,
85-
#' oracleTempSchema = NULL,
88+
#' tempEmulationSchema = NULL,
8689
#' cdmDatabaseSchema = "main",
8790
#' cdmVersion = "5",
8891
#' cohortTable = "cohort",
@@ -109,7 +112,8 @@ getDbCovariateData <- function(connectionDetails = NULL,
109112
rowIdField = "subject_id",
110113
covariateSettings,
111114
aggregated = FALSE,
112-
minCharacterizationMean = 0) {
115+
minCharacterizationMean = 0,
116+
tempEmulationSchema = NULL) {
113117
if (is.null(connectionDetails) && is.null(connection)) {
114118
stop("Need to provide either connectionDetails or connection")
115119
}
@@ -123,6 +127,13 @@ getDbCovariateData <- function(connectionDetails = NULL,
123127
warning("cohortId argument has been deprecated, please use cohortIds")
124128
cohortIds <- cohortId
125129
}
130+
if (!is.null(oracleTempSchema) && oracleTempSchema != "") {
131+
rlang::warn("The 'oracleTempSchema' argument is deprecated. Use 'tempEmulationSchema' instead.",
132+
.frequency = "regularly",
133+
.frequency_id = "oracleTempSchema"
134+
)
135+
tempEmulationSchema <- oracleTempSchema
136+
}
126137
errorMessages <- checkmate::makeAssertCollection()
127138
minCharacterizationMean <- utils::type.convert(minCharacterizationMean, as.is = TRUE)
128139
checkmate::assertNumeric(x = minCharacterizationMean, lower = 0, upper = 1, add = errorMessages)
@@ -149,7 +160,7 @@ getDbCovariateData <- function(connectionDetails = NULL,
149160
sql <- SqlRender::translate(
150161
sql = sql,
151162
targetDialect = attr(connection, "dbms"),
152-
oracleTempSchema = oracleTempSchema
163+
tempEmulationSchema = tempEmulationSchema
153164
)
154165
temp <- DatabaseConnector::querySql(connection, sql, snakeCaseToCamelCase = TRUE)
155166
if (aggregated) {
@@ -174,7 +185,7 @@ getDbCovariateData <- function(connectionDetails = NULL,
174185
fun <- attr(covariateSettings[[i]], "fun")
175186
args <- list(
176187
connection = connection,
177-
oracleTempSchema = oracleTempSchema,
188+
tempEmulationSchema = tempEmulationSchema,
178189
cdmDatabaseSchema = cdmDatabaseSchema,
179190
cohortTable = cohortDatabaseSchemaTable,
180191
cohortIds = cohortIds,

R/GetCovariatesFromCohortAttributes.R

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#'
4646
#' covData <- getDbCohortAttrCovariatesData(
4747
#' connection = connection,
48-
#' oracleTempSchema = NULL,
48+
#' tempEmulationSchema = NULL,
4949
#' cdmDatabaseSchema = "main",
5050
#' cdmVersion = "5",
5151
#' cohortTable = "cohort",
@@ -66,7 +66,8 @@ getDbCohortAttrCovariatesData <- function(connection,
6666
cdmVersion = "5",
6767
rowIdField = "subject_id",
6868
covariateSettings,
69-
aggregated = FALSE) {
69+
aggregated = FALSE,
70+
tempEmulationSchema = NULL) {
7071
if (aggregated) {
7172
stop("Aggregation not implemented for covariates from cohort attributes.")
7273
}
@@ -77,6 +78,13 @@ getDbCohortAttrCovariatesData <- function(connection,
7778
warning("cohortId argument has been deprecated, please use cohortIds")
7879
cohortIds <- cohortId
7980
}
81+
if (!is.null(oracleTempSchema) && oracleTempSchema != "") {
82+
rlang::warn("The 'oracleTempSchema' argument is deprecated. Use 'tempEmulationSchema' instead.",
83+
.frequency = "regularly",
84+
.frequency_id = "oracleTempSchema"
85+
)
86+
tempEmulationSchema <- oracleTempSchema
87+
}
8088
start <- Sys.time()
8189
writeLines("Constructing covariates from cohort attributes table")
8290

@@ -93,7 +101,7 @@ getDbCohortAttrCovariatesData <- function(connection,
93101
dropTableIfExists = TRUE,
94102
createTable = TRUE,
95103
tempTable = TRUE,
96-
oracleTempSchema = oracleTempSchema
104+
tempEmulationSchema = tempEmulationSchema
97105
)
98106
}
99107
sql <- SqlRender::readSql(system.file("sql/sql_server/GetAttrCovariates.sql", package = "FeatureExtraction"))
@@ -108,12 +116,12 @@ getDbCohortAttrCovariatesData <- function(connection,
108116
renderedSql <- SqlRender::translate(
109117
sql = renderedSql,
110118
targetDialect = attr(connection, "dbms"),
111-
oracleTempSchema = oracleTempSchema
119+
tempEmulationSchema = tempEmulationSchema
112120
)
113121
# renderedSql <- SqlRender::loadRenderTranslateSql("GetAttrCovariates.sql",
114122
# packageName = "FeatureExtraction",
115123
# dbms = attr(connection, "dbms"),
116-
# oracleTempSchema = oracleTempSchema,
124+
# tempEmulationSchema = tempEmulationSchema,
117125
# attr_database_schema = covariateSettings$attrDatabaseSchema,
118126
# cohort_table = cohortTable,
119127
# row_id_field = rowIdField,
@@ -129,7 +137,7 @@ getDbCohortAttrCovariatesData <- function(connection,
129137
covariateRefSql <- SqlRender::translate(
130138
sql = covariateRefSql,
131139
targetDialect = attr(connection, "dbms"),
132-
oracleTempSchema = oracleTempSchema
140+
tempEmulationSchema = tempEmulationSchema
133141
)
134142
covariateRef <- DatabaseConnector::querySql(connection, covariateRefSql, snakeCaseToCamelCase = TRUE)
135143
covariateRef$analysisId <- rep(as.numeric(covariateSettings$analysisId), length = nrow(covariateRef))

R/GetCovariatesFromOtherCohorts.R

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ getDbCohortBasedCovariatesData <- function(connection,
3838
rowIdField = "subject_id",
3939
covariateSettings,
4040
aggregated = FALSE,
41-
minCharacterizationMean = 0) {
41+
minCharacterizationMean = 0,
42+
tempEmulationSchema = NULL) {
4243
errorMessages <- checkmate::makeAssertCollection()
4344
checkmate::assertClass(connection, "DatabaseConnectorConnection", add = errorMessages)
4445
checkmate::assertCharacter(oracleTempSchema, len = 1, null.ok = TRUE, add = errorMessages)
46+
checkmate::assertCharacter(tempEmulationSchema, len = 1, null.ok = TRUE, add = errorMessages)
4547
checkmate::assertCharacter(cdmDatabaseSchema, len = 1, null.ok = TRUE, add = errorMessages)
4648
checkmate::assertCharacter(cohortTable, len = 1, add = errorMessages)
4749
checkmate::assertIntegerish(cohortId, add = errorMessages)
@@ -56,6 +58,13 @@ getDbCohortBasedCovariatesData <- function(connection,
5658
warning("cohortId argument has been deprecated, please use cohortIds")
5759
cohortIds <- cohortId
5860
}
61+
if (!is.null(oracleTempSchema) && oracleTempSchema != "") {
62+
rlang::warn("The 'oracleTempSchema' argument is deprecated. Use 'tempEmulationSchema' instead.",
63+
.frequency = "regularly",
64+
.frequency_id = "oracleTempSchema"
65+
)
66+
tempEmulationSchema <- oracleTempSchema
67+
}
5968

6069
start <- Sys.time()
6170
message("Constructing covariates from other cohorts")
@@ -69,7 +78,7 @@ getDbCohortBasedCovariatesData <- function(connection,
6978
dropTableIfExists = TRUE,
7079
createTable = TRUE,
7180
tempTable = TRUE,
72-
oracleTempSchema = oracleTempSchema,
81+
tempEmulationSchema = tempEmulationSchema,
7382
camelCaseToSnakeCase = TRUE
7483
)
7584
if (is.null(covariateSettings$covariateCohortTable)) {
@@ -137,7 +146,7 @@ getDbCohortBasedCovariatesData <- function(connection,
137146
}
138147
result <- getDbDefaultCovariateData(
139148
connection = connection,
140-
oracleTempSchema = oracleTempSchema,
149+
tempEmulationSchema = tempEmulationSchema,
141150
cdmDatabaseSchema = cdmDatabaseSchema,
142151
cohortTable = cohortTable,
143152
cohortIds = cohortIds,
@@ -154,7 +163,7 @@ getDbCohortBasedCovariatesData <- function(connection,
154163
sql = sql,
155164
progressBar = FALSE,
156165
reportOverallTime = FALSE,
157-
oracleTempSchema = oracleTempSchema
166+
tempEmulationSchema = tempEmulationSchema
158167
)
159168
return(result)
160169
}

0 commit comments

Comments
 (0)