Skip to contents

A function to extract the failed dechallenge-rechallenge cases

Usage

getDechallengeRechallengeFails(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  targetId = NULL,
  outcomeId = NULL,
  databaseId = NULL,
  dechallengeStopInterval = NULL,
  dechallengeEvaluationWindow = 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)

cTablePrefix

The prefix used for the characterization results tables

targetId

An integer corresponding to the target cohort ID

outcomeId

Am integer corresponding to the outcome cohort ID

databaseId

The unique identifier for the database of interest

dechallengeStopInterval

(optional) The maximum number of days between the outcome start and target end for an outcome to be flagged

dechallengeEvaluationWindow

(optional) The maximum number of days after the target restarts to see whether the outcome restarts

Value

A data.frame each failed dechallenge rechallenge exposures and outcomes

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs and database id

Examples

conDet <- getExampleConnectionDetails()

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

conCohort <- getDechallengeRechallengeFails(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetId = 1, 
  outcomeId = 3,
  databaseId = 'eunomia'
)