Compute time at risk exposed and time at risk unexposed for risk window parameters. See `getSccRiskWindowStats` for example usage.
runSccRiskWindows(
connection,
cdmDatabaseSchema,
cdmVersion = 5,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
oracleTempSchema = NULL,
exposureIds = NULL,
exposureDatabaseSchema = cdmDatabaseSchema,
exposureTable = "drug_era",
firstExposureOnly = TRUE,
minAge = "",
maxAge = "",
studyStartDate = "",
studyEndDate = "",
addLengthOfExposureExposed = TRUE,
riskWindowStartExposed = 1,
riskWindowEndExposed = 30,
addLengthOfExposureUnexposed = TRUE,
riskWindowEndUnexposed = -1,
riskWindowStartUnexposed = -30,
hasFullTimeAtRisk = FALSE,
washoutPeriod = 0,
followupPeriod = 0,
riskWindowsTable = "#risk_windows",
resultsDatabaseSchema = NULL
)
DatabaseConnector connection instance
Name of database schema that contains the OMOP CDM and vocabulary.
Define the OMOP CDM version used: currently support "4" and "5".
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.
For Oracle only: the name of the database schema where you want all temporary tables to be managed. Requires create/insert permissions to this database.
A vector containing the drug_concept_ids or cohort_definition_ids of the exposures of interest. If empty, all exposures in the exposure table will be included.
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 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_concept_id, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.
If TRUE, only use first occurrence of each drug concept id for each person
Integer for minimum allowable age.
Integer for maximum allowable age.
Date for minimum allowable data for index exposure. Date format is 'yyyymmdd'.
Date for maximum allowable data for index exposure. Date format is 'yyyymmdd'.
If TRUE, use the duration from drugEraStart -> drugEraEnd as part of timeAtRisk.
Integer of days to add to drugEraStart for start of timeAtRisk (0 to include index date, 1 to start the day after).
Additional window to add to end of exposure period (if addLengthOfExposureExposed = TRUE, then add to exposure end date, else add to exposure start date).
If TRUE, use the duration from exposure start -> exposure end as part of timeAtRisk looking back before exposure start.
Integer of days to add to exposure start for end of timeAtRisk (0 to include index date, -1 to end the day before).
Additional window to add to start of exposure period (if addLengthOfExposureUnexposed = TRUE, then add to exposure end date, else add to exposure start date).
If TRUE, restrict to people who have full time-at-risk exposed and unexposed.
Integer to define required time observed before exposure start.
Integer to define required time observed after exposure start.
String: optionally store the risk windows in a (non-temporary) table.
Schema to oputput results to. Ignored if resultsTable and riskWindowsTable are temporary.