R/GetExposureData.R
getDbExposureData.Rd
If additional exposure data or covariate data is required, this function will send the information on the cases and controls back to the server.
Note: For PDW and RedShift, where uploading data can be excrutiatingly slow, you can use bulk loading
by preparing the environment as described in the insertTable
function
in the DatabaseConnection package, and setting tempEmulationSchema
to a schema where you have write
privileges (bulk import can only upload to permanent tables).
A data frame as generated by the selectControls
function.
An R object of typeconnectionDetails
created using the
function createConnectionDetails
in the
DatabaseConnector
package.
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 is the location where the exposure data used to define the exposure cohorts is available. If exposureTable = DRUG_ERA, exposureDatabaseSchema is not used but assumed to be cdmSchema. Requires read permissions to this database.
The tablename that contains the exposure cohorts. If exposureTable <> drug_era, then expectation is exposureTable has format of COHORT table: cohort_definition_id, subject_id, cohort_start_date, cohort_end_date.
A list of identifiers to define the exposures of interest. If exposureTable = drug_era, exposureIds should be concept_id. If exposureTable <> drug_era, exposureIds is used to select the cohort_definition_id in the cohort-like table. If no exposureIds are provided, all drugs or cohorts in the exposureTable are included as exposures.
Needed when constructing covariates using FeatureExtraction: 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'.
Either an object of type covariateSettings
as created using the
createCovariateSettings
function in the
FeatureExtraction
package, or an object of type SimpleCovariateSettings
as created using the createSimpleCovariateSettings
function.
If NULL then no covariate data is retrieved.
An object of type caseData
as generated using the
getDbCaseData
function. If caseData is provided and contains
the exposure data (see getExposures in the getDbCaseData
function,
and if no covariates need to constructed (covariateSettings = NULL) or only simple
covariates need to be constructed, then the no connection to the database is used
to create the exposure data. This may be much more efficient in some situations.