
Create a cohort of groups of the Charlson Comorbidity Index (CCI)
Source:R/charlson.R
charlsonCohort.RdUsage
charlsonCohort(
cdm,
categories,
name,
ageAdjusted = TRUE,
conceptSet = getIndexCodelist("charlson"),
subsetCohort = NULL,
subsetCohortId = NULL
)Arguments
- cdm
A
cdm_referenceobject.- categories
A named list of numeric vectors, each containing the lower and upper bounds of a score interval. Upper and lower bounds are both included. The name will be used to name the resultant cohort.
- name
Name of the new cohort table created in the cdm object.
- ageAdjusted
Logical; whether to include age adjustment in the Charlson Comorbidity Index.
- conceptSet
A named concept set supplied as a
codelist,codelist_with_details,concept_set_expression, or named list of concept IDs. It must containmyocardial_infarction,congestive_heart_failure,peripheral_vascular_disease,cerebrovascular_disease,dementia,chronic_pulmonary_disease,connective_tissue_disease,peptic_ulcer_disease,mild_liver_disease,diabetes_without_complication,hemiplegia,severe_chronic_kidney_disease,diabetes_with_complication,any_malignancy,moderate_or_severe_liver_disease,metastatic_solid_tumor,aidsas concepts. By default, internal codelists are used.- subsetCohort
A character refering to a cohort table containing individuals for whom cohorts will be generated. Only individuals in this table will appear in the generated cohort. If
NULLno subsetting will be performed.- subsetCohortId
Specifies cohort IDs from the
subsetCohorttable to include. If none are provided, all cohorts from the subsetCohort are included.
Details
CCI is based on Charlson et al. (1987) (doi:10.1016/0021-9681(87)90171-8 ) and Charlson et al. (1994) (doi:10.1016/0895-4356(94)90129-5 ) (age-adjusted) version.
Examples
if (FALSE) { # \dontrun{
library(omock)
library(duckdb)
library(OmopIndices)
library(dplyr)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
# Using the internal concept sets:
cdm$my_cohort <- charlsonCohort(
cdm = cdm,
categories = list(
"none" = c(0, 0),
"mild" = c(1, 2),
"moderate" = c(3, 4),
"severe" = c(5, Inf)
),
name = "my_cohort"
)
cdm$my_cohort
settings(cdm$my_cohort)
} # }