Learn R Programming

icd (version 2.2)

icd-package: icd: Tools for Working with ICD-9 and ICD-10 Codes, and Finding Comorbidities

Description

Calculate comorbidities, Charlson scores, perform fast and accurate validation, conversion, manipulation, filtering and comparison of ICD-9 and ICD-10 codes. Common ambiguities and code formats are handled. This package enables a work flow from raw lists of ICD codes in hospital billing databases to comorbidities. ICD-9 and ICD-10 comorbidity mappings from Quan (Deyo and Elixhauser versions), Elixhauser and AHRQ included. This package replaces 'icd9', which should be uninstalled.

Arguments

Details

Comorbidities

icd_comorbid determines comorbidities for a set of patients with one or more ICD-9 codes each. icd_charlson calculates Charlson score (Comorbidity Index). If you already calculated the comorbidities, you can use icd_charlson_from_comorbid.

  • AHRQ comorbidity mapping is provided, and a function to read the raw SAS code from AHRQ into R data structures. The data is available by lazy-loading in icd9_map_ahrq. AHRQ releases new mappings annually.

  • Quan revised both Deyo/Charlson and Elixhauser ICD-9 to comorbidity mappings. These are presented as: icd9_map_quan_deyo (which is also derived from the original SAS code used in his publication, referenced in the data documentation), icd10_map_quan_deyo, icd9_map_quan_elix, and icd10_map_quan_elix which was transcribed directly from the same paper.

  • The original Elixhauser mapping is provided, with codes transcribed from the original publication. See icd9_map_elix.

Validation

icd_is_valid checks whether ICD-9 codes are syntactically valid (although not necessarily genuine ICD-9 diagnoses). In contrast, icd_is_defined checks whether ICD-9 codes correspond to diagnoses in the current ICD-9-CM definition from CMS.

Conversion

There are many functions to convert ICD-9 codes or their components between different formats and structures. The most commonly used are: icd_decimal_to_short, icd_short_to_decimal to convert, e.g., 002.3 to 0023 and back again. See convert for other options.

Manipulation

You can find children of a higher-level ICD-9 code with icd_children and find a common parent to a set of children (or arbitrary list of ICD-9 codes) with icd_condense. icd_sort sorts in hierarchical, then numerical order, so 100.0 comes before 100.00, for example. icd_wide_to_long and icd_long_to_wide convert the two most common data structures containing patient disease data. This is more sophisticated and tailored to the problem than base reshaping or extension packages, although these could no doubt be used.

Explanation, or decoding

Use icd_explain to convert a list of codes into human-readable descriptions. This function can optionally reduce the codes to a their top-level groups if all the child members of a group are present. icd_diff_comorbid allows summary of the differences between comorbidity mappings, e.g. to find what has changed from year-to-year or between revisions by different authors. icd9cm_hierarchy is a data.frame containing the full ICD-9 classification for each diagnosis. icd9_chapters contains definitions of chapters, sub-chapters and three-digit groups.

References

http://www.hcup-us.ahrq.gov/toolssoftware/comorbidity/comorbidity.jsp

See Also

Useful links: