getTargetCounts: Extract the target cohort counts result

View source: R/CharacterzationQueries.R

getTargetCountsR Documentation

Extract the target cohort counts result

Description

This function extracts target cohort counts across databases in the results for specified target.

Usage

getTargetCounts(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  characterizationTargetIds = NULL,
  databaseIds = NULL,
  includeNames = TRUE
)

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

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

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

characterizationTargetIds

The characterization target cohort ids of interest

databaseIds

(optional) A vector of database IDs to restrict to

includeNames

whether to add the database names and cohort names

Details

Specify the connectionHandler, the schema and the characterization target IDs

Value

Returns a data.frame with the columns:

  • settingId the setting id

  • databaseId the unique identifier of the database

  • characterizationTargetId the target cohort unique identifier

  • N the number of people in the cohort

See Also

Other Characterization: characterizationCompareBinary(), characterizationCompareContinuous(), getAggregateBinaryRiskFactors(), getAggregateContinuousRiskFactors(), getBinaryCaseSeries(), getBinaryRiskFactors(), getBinaryTargetBaseline(), getCaseCounts(), getCharacterizationCaseSettings(), getCharacterizationDemographics(), getCharacterizationTargetSettings(), getContinuousCaseSeries(), getContinuousRiskFactors(), getContinuousTargetBaseline(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceRates(), getIncidenceTargetSettings(), getNonCaseCounts(), getOutcomesUsedInCharacterization(), getOutcomesUsedInIncidence(), getTargetsUsedInCharacterization(), getTargetsUsedInIncidence(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions(), viewIncidenceRate()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cc <- getTargetCounts(
connectionHandler = connectionHandler, 
schema = 'main'
)


OhdsiReportGenerator documentation built on Nov. 14, 2026, 1:09 a.m.