R/UnitTestHelperFunctions.R
dot-getDbLooCovariateData.Rd
Get covariate information from the database
.getDbLooCovariateData(
connection,
tempEmulationSchema = NULL,
cdmDatabaseSchema,
cohortTable = "#cohort_person",
cohortIds = c(-1),
cdmVersion = "5",
rowIdField = "subject_id",
covariateSettings,
aggregated = FALSE,
minCharacterizationMean = 0
)
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.
Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.
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'.
Name of the (temp) table holding the cohort for which we want to construct covariates
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.
Define the OMOP CDM version used: currently supported is "5".
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.
Either an object of type covariateSettings
as created using one
of the createCovariate functions, or a list of such objects.
Should aggregate statistics be computed instead of covariates per cohort entry?
The minimum mean value for binary 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.
Returns an object of type covariateData
, containing information on the covariates.