Executes Self-Controlled Cohort analyses within the OHDSI Strategus framework using the provided analysis specifications and settings.

execute(
  connectionDetails,
  executionSettings,
  analysisSpecifications,
  databaseId,
  exportFolder
)

Arguments

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.

Value

No return value. Results are written to the specified export folder as a side effect.

Details

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.

Examples

if (FALSE) { # \dontrun{
execute(
  connectionDetails = connectionDetails,
  executionSettings = list(
    databaseSchema = "main",
    cohortTable = "cohort",
    cdmDatabaseSchema = "main"
  ),
  analysisSpecifications = moduleSpec,
  databaseId = "MyDatabase",
  exportFolder = "./strategus_results"
)
} # }