Extract a complete set of cohorts used in the prediction results
Source:R/PredictionQueries.R
getPredictionCohorts.Rd
This function extracts the target and outcome cohorts used to develop any model in the results
Usage
getPredictionCohorts(
connectionHandler,
schema,
plpTablePrefix = "plp_",
cgTablePrefix = "cg_"
)
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)
- plpTablePrefix
The prefix used for the patient level prediction results tables
- cgTablePrefix
The prefix used for the cohort generator results tables
Value
Returns a data.frame with the columns:
cohortId the cohort definition ID
cohortName the name of the cohort
type whether the cohort was used as a target or outcome cohort
Details
Specify the connectionHandler, the resultDatabaseSettings and any targetIds or outcomeIds to restrict models to
Examples
conDet <- getExampleConnectionDetails()
connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)
#> Connecting using SQLite driver
predCohorts <- getPredictionCohorts(
connectionHandler = connectionHandler,
schema = 'main'
)