dot-getDbLooCovariateData: Get covariate information from the database

.getDbLooCovariateDataR Documentation

Get covariate information from the database

Description

Get covariate information from the database

Usage

.getDbLooCovariateData(
  connection,
  oracleTempSchema = NULL,
  cdmDatabaseSchema,
  cohortTable = "#cohort_person",
  cohortIds = c(-1),
  cdmVersion = "5",
  rowIdField = "subject_id",
  covariateSettings,
  aggregated = FALSE,
  minCharacterizationMean = 0
)

Arguments

connection

A connection to the server containing the schema as created using the connect function in the DatabaseConnector package. Either the connection or connectionDetails argument should be specified.

oracleTempSchema

A schema where temp tables can be created in Oracle.

cdmDatabaseSchema

The name of the database schema that contains the OMOP CDM instance. Requires read permissions to this database. On SQL Server, this should specify both the database and the schema, so for example 'cdm_instance.dbo'.

cohortTable

Name of the (temp) table holding the cohort for which we want to construct covariates

cohortIds

For which cohort ID(s) should covariates be constructed? If set to -1, covariates will be constructed for all cohorts in the specified cohort table.

cdmVersion

Define the OMOP CDM version used: currently supported is "5".

rowIdField

The name of the field in the cohort table that is to be used as the row_id field in the output table. This can be especially usefull if there is more than one period per person.

covariateSettings

Either an object of type covariateSettings as created using one of the createCovariate functions, or a list of such objects.

aggregated

Should aggregate statistics be computed instead of covariates per cohort entry?

minCharacterizationMean

The minimum mean value for characterization output. Values below this will be cut off from output. This will help reduce the file size of the characterization output, but will remove information on covariates that have very low values. The default is 0.

Value

Returns an object of type covariateData, containing information on the covariates.

Examples

## Not run: 
eunomiaConnectionDetails <- Eunomia::getEunomiaConnectionDetails()
covSettings <- .createLooCovariateSettings(useLengthOfObs = TRUE)
Eunomia::createCohorts(
  connectionDetails = eunomiaConnectionDetails,
  cdmDatabaseSchema = "main",
  cohortDatabaseSchema = "main",
  cohortTable = "cohort"
)
connection <- DatabaseConnector::connect(connectionDetails)
looCovariateData <- .getDbLooCovariateData(connection,
  oracleTempSchema = NULL,
  cdmDatabaseSchema = "main",
  cohortTable = "cohort",
  cohortId = 1,
  cdmVersion = "5",
  rowIdField = "subject_id",
  covariateSettings = covSettings,
  aggregated = FALSE
)

## End(Not run)


OHDSI/FeatureExtraction documentation built on April 22, 2024, 10:24 p.m.