View source: R/StrategusModuleFunctions.R
| execute | R Documentation |
Executes Self-Controlled Cohort analyses within the OHDSI Strategus framework using the provided analysis specifications and settings.
execute(
connectionDetails,
executionSettings,
analysisSpecifications,
databaseId,
exportFolder
)
connectionDetails |
An object containing the details required to connect to the database. |
executionSettings |
A list of settings for execution, including database schemas and cohort table names. |
analysisSpecifications |
A list containing analysis settings, exposure-outcome pairs, and compute thread count. |
databaseId |
A string identifier for the target database. |
exportFolder |
Path to the folder where results and exports will be written. |
This function validates the input specifications, extracts unique exposure and outcome cohort IDs, identifies negative control pairs, and iterates over each analysis setting to run the Self-Controlled Cohort analysis. Results are exported to the specified folder. Diagnostic settings are handled per-analysis, and warnings are issued if no negative controls are found.
No return value. Results are written to the specified export folder as a side effect.
if (interactive()) {
eo1 <- createExposureOutcome(exposureId = 1124300, outcomeId = 444382)
analysis1 <- createSccAnalysis(analysisId = 1,
description = "Main",
runSelfControlledCohortArgs = createRunSelfControlledCohortArgs())
moduleSpec <- createSelfControlledCohortModuleSpecifications(
analysisSettings = list(analysis1),
exposureOutcomeList = list(eo1)
)
execute(
connectionDetails = connectionDetails,
executionSettings = list(
databaseSchema = "main",
cohortTable = "cohort",
cdmDatabaseSchema = "main"
),
analysisSpecifications = moduleSpec,
databaseId = "MyDatabase",
exportFolder = tempdir()
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.