icd9cm_elixhauser_quan: Create Quan map of ICD-9-CM to Elixhauser comorbidities

Description Usage Arguments Details Value References See Also Examples

View source: R/icd9cm.R

Description

Function to make a dataframe that links ICD-9-CM codes to the Elixhauser comorbidity categories using the Quan mapping.

Usage

1

Arguments

icd9

a unique character vector of ICD-9-CM codes

Details

Uses regular expressions created from the Quan paper from 2005.

ICD-9-CM codes must have periods removed. Diagnostic codes are prefixed with 'D' while procedure codes are prefixed with 'P'. So, diagnostic code 404.03 should be "D40403".

Some ICD-9-CM codes will correspond to more than one category. For example, 404.03 (Hypertensive heart and chronic kidney disease ... stage V) is in both chf and renlfail categories.

Value

A data frame, with ICD9 codes as row names and one logical column for each comorbidity in elixhauser_list

References

1. Quan H, Sundararajan V, Halfon P, Fong A, Burnand B, Luthi J-C, Saunders LD, Beck CA, Feasby TE, Ghali WA: Coding algorithms for defining comorbidities in ICD-9-CM and ICD-10 administrative data. Medical care 2005; 43:1130-9 http://www.ncbi.nlm.nih.gov/pubmed/16224307

See Also

icd9cm_charlson_deyo, icd9cm_charlson_romano, icd9cm_charlson_quan, icd9cm_elixhauser_ahrq37

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Identify Elixhauser categories
cases <- data.frame(id=c(1,1,1,2,2,2),
  icd9cm=c("D20206","D24220","D4439","D5064","DE8788","D40403"),
  stringsAsFactors=TRUE)
cases_with_cm <- merge(cases, icd9cm_elixhauser_quan(levels(cases$icd9cm)),
  by.x="icd9cm", by.y="row.names", all.x=TRUE)

# generate crude comorbidity summary for each patient
library(plyr)
ddply(cases_with_cm, .(id),
  function(x) { data.frame(lapply(x[,3:ncol(x)], any)) })

Example output

  id   chf arrhythmia valve pulmcirc perivasc   htn htncx  para neuro chrnlung
1  1 FALSE      FALSE FALSE    FALSE     TRUE FALSE FALSE FALSE FALSE    FALSE
2  2  TRUE      FALSE FALSE    FALSE    FALSE FALSE  TRUE FALSE FALSE     TRUE
     dm  dmcx hypothy renlfail liver ulcer  aids lymph  mets tumor rheum  coag
1 FALSE FALSE   FALSE    FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
2 FALSE FALSE   FALSE     TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
  obese wghtloss lytes bldloss anemdef alcohol  drug psych depress
1 FALSE    FALSE FALSE   FALSE   FALSE   FALSE FALSE FALSE   FALSE
2 FALSE    FALSE FALSE   FALSE   FALSE   FALSE FALSE FALSE   FALSE

medicalrisk documentation built on March 26, 2020, 6:31 p.m.