This function extracts the target cohorts, the number of subjects/entries and where the cohort was used.
getTargetTable(
connectionHandler,
schema,
cgTablePrefix = "cg_",
cTablePrefix = "c_",
ciTablePrefix = "ci_",
cmTablePrefix = "cm_",
sccsTablePrefix = "sccs_",
plpTablePrefix = "plp_",
databaseTable = "database_meta_data",
getIncidenceInclusion = TRUE,
getCharacterizationInclusion = TRUE,
getPredictionInclusion = TRUE,
getCohortMethodInclusion = TRUE,
getSccsInclusion = TRUE,
printTimes = FALSE
)Returns a data.frame with the columns:
cohortId the number id for the target cohort
cohortName the name of the cohort
subsetParent the number id of the parent cohort
subsetDefinitionId the number id of the subset
subsetDefinitionJson the json of the subset
subsetCohortIds the ids of any cohorts that are restricted to by the subset logic
numDatabase number of databases with the cohort
databaseString all the names of the databases with the cohort
databaseCount all the names of the databases with the cohort and their sizes
minSubjectCount number of subjects in databases with lowest count
maxSubjectCount number of subjects in databases with highest count
minEntryCount number of entries in databases with lowest count
maxEntryCount number of entries in databases with highest count
cohortIncidence whether the cohort was used in cohort incidence
databaseComparator whether the cohort was used in database comparator
cohortComparator whether the cohort was used in cohort comparator
dechalRechal whether the cohort was used in dechallenge rechallenge
riskFactors whether the cohort was used in risk factors
caseSeries whether the cohort was used in case series analysis
timeToEvent whether the cohort was used in time to event
prediction whether the cohort was used in prediction
cohortMethod whether the cohort was used in cohort method
selfControlledCaseSeries whether the cohort was used in self controlled case series
A connection handler that connects to the database and extracts sql queries. Create a connection handler via `ResultModelManager::ConnectionHandler$new()`.
The result database schema (e.g., 'main' for sqlite)
The prefix used for the cohort generator results tables
The prefix used for the characterization results tables
The prefix used for the cohort incidence results tables
The prefix used for the cohort method results tables
The prefix used for the cohort generator results tables
The prefix used for the patient level prediction results tables
The name of the table with the database details (default 'database_meta_data')
Whether to check useage of the cohort in incidence
Whether to check useage of the cohort in characterization
Whether to check useage of the cohort in prediction
Whether to check useage of the cohort in cohort method
Whether to check useage of the cohort in SCCS
Whether to print how long each query took
Specify the connectionHandler, the schema and the table prefixes
Other helper:
addTarColumn(),
formatBinaryCovariateName(),
getExampleConnectionDetails(),
getOutcomeTable(),
kableDark(),
printReactable(),
removeSpaces()
conDet <- getExampleConnectionDetails()
connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)
targetTable <- getTargetTable(
connectionHandler = connectionHandler,
schema = 'main'
)
Run the code above in your browser using DataLab