This function is used to load the counts needed to compute the ICTPD from a database in OMOP CDM format.
getDbIctpdData(
connectionDetails,
cdmDatabaseSchema,
oracleTempSchema = NULL,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
cdmVersion = "5",
exposureOutcomePairs,
exposureDatabaseSchema = cdmDatabaseSchema,
exposureTable = "drug_era",
outcomeDatabaseSchema = cdmDatabaseSchema,
outcomeTable = "condition_era",
controlPeriodStart = -1080,
controlPeriodEnd = -361,
riskPeriodStart = 1,
riskPeriodEnd = 30,
censor = FALSE
)
An R object of type ConnectionDetails
created using
the function createConnectionDetails
in the
DatabaseConnector
package.
Name of database schema that contains OMOP CDM and vocabulary.
DEPRECATED: use `tempEmulationSchema` instead.
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.
Define the OMOP CDM version used: currently supports "5".
A data frame with at least two columns:
"exposureId" containing the drug_concept_ID or cohort_concept_id of the exposure variable
"outcomeId" containing the condition_concept_ID or cohort_concept_id of the outcome variable
The name of the database schema that is the location where the exposure data is available. If exposureTable = DRUG_ERA, exposureSchema is not used by 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.
The name of the database schema that is the location where the data used to define the outcome cohorts is available. If exposureTable = CONDITION_ERA, exposureSchema is not used by assumed to be cdmSchema. Requires read permissions to this database.
The tablename that contains the outcome cohorts. If outcomeTable <> CONDITION_OCCURRENCE, then expectation is outcomeTable has format of COHORT table: COHORT_DEFINITION_ID, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.
start of the control period - can be set between -99999 and 0, default is -1080.
end of the control period - can be set between -99999 and 0, default is -361.
start of the risk period - can be set between 0 and 99999, default is 1.
end of the risk period - can be set between 0 and 99999, default is 30.
a flag indicating wether the method should censor the observation period at the end of exposure or not. Available input is 0 or 1 with default = 0.
An object of type ictpdData
containing counts that can be used in the
calculateStatisticsIc
function.
if (FALSE) {
library(SelfControlledCohort)
connectionDetails <- createConnectionDetails(dbms = "postgresql",
user = "joe",
password = "secret",
server = "myserver")
exposureOutcomePairs <- data.frame(outcomeId = c(196794, 196794, 312648),
exposurId = c(1501700, 1545958, 1551803))
ictpdData <- getDbIctpdData(connectionDetails,
cdmDatabaseSchema = "cdm_schema.dbo",
exposureOutcomePairs = exposureOutcomePairs)
ictpdResults <- calculateStatisticsIC(ictpdData)
ictpdResults
}