Skip to contents

This function extracts the specific cohort method table.

Usage

getSccsTable(
  connectionHandler,
  schema,
  table = c("attrition", "time_trend", "event_dep_observation", "age_spanning",
    "calendar_time_spanning", "spline")[1],
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  indicationIds = NULL,
  outcomeIds = NULL,
  analysisIds = NULL,
  databaseIds = NULL,
  exposureOutcomeIds = NULL,
  covariateIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via `ResultModelManager::ConnectionHandler$new()`.

schema

The result database schema (e.g., 'main' for sqlite)

table

The result table to extract

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

indicationIds

The indications that the target was nested to

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

analysisIds

the analysis IDs to restrict to

databaseIds

the database IDs to restrict to

exposureOutcomeIds

the exposureOutcomeIds to restrict to

covariateIds

the covariateIds to restrict to

Value

Returns a data.frame with the cohort method requested table

Details

Specify the connectionHandler, the schema and optionally the target/outcome/analysis/database IDs

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)
#> Connecting using SQLite driver

sccsTable <- getSccsTable(
  connectionHandler = connectionHandler, 
  schema = 'main',
  table = 'attrition'
)