Charlson score is calculated in the basis of the Quan revision of Deyo's ICD-9 mapping. (Peptic ulcer disease no longer warrants a point.) Quan published an updated set of scores, but it seems most people use the original scores for easier comparison between studies, even though Quan's were more predictive.
charlson( x, visit_name = NULL, scoring_system = c("original", "charlson", "quan"), return_df = FALSE, stringsAsFactors = getOption("stringsAsFactors"), ... ) # S3 method for data.frame charlson( x, visit_name = NULL, scoring_system = c("original", "charlson", "quan"), return_df = FALSE, stringsAsFactors = getOption("stringsAsFactors"), ... )
x | data frame containing a column of visit or patient identifiers, and
a column of ICD-9 codes. It may have other columns which will be ignored.
By default, the first column is the patient identifier and is not counted.
If |
---|---|
visit_name | The name of the column in the data frame which contains the
patient or visit identifier. Typically this is the visit identifier, since
patients come leave and enter hospital with different ICD-9 codes. It is a
character vector of length one. If left empty, or |
scoring_system | One of |
return_df | single logical value, if |
stringsAsFactors | single logical, passed on when constructing
data.frame if |
... | further arguments to pass on to |
When used, hierarchy is applied per Quan, “The following comorbid conditions were mutually exclusive: diabetes with chronic complications and diabetes without chronic complications; mild liver disease and moderate or severe liver disease; and any malignancy and metastatic solid tumor.” The Quan scoring weights come from the 2011 paper. The comorbidity weights were recalculated using updated discharge data, and some changes, such as Myocardial Infarction decreasing from 1 to 0, may reflect improved outcomes due to advances in treatment since the original weights were determined in 1984.
data.frame
: Charlson scores from data frame of visits and ICD-9
codes. ICD-10 Charlson can be calculated simply by getting the Charlson
(e.g. Quan Deyo) comorbidities, then calling
charlson_from_comorbid
.
mydf <- data.frame( visit_name = c("a", "b", "c"), icd9 = c("441", "412.93", "042") ) charlson(mydf)#> a b c #> 1 1 6#> MI CHF PVD Stroke Dementia Pulmonary Rheumatic PUD LiverMild DM #> a FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> b TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> c FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> DMcx Paralysis Renal Cancer LiverSevere Mets HIV #> a FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> b FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> c FALSE FALSE FALSE FALSE FALSE FALSE TRUE# can specify short_code directly instead of guessing charlson(mydf, short_code = FALSE, return_df = TRUE)#> visit_name Charlson #> 1 a 1 #> 2 b 1 #> 3 c 6#> a b c #> 1 1 6