Learn R Programming

icd9 (version 1.3.1)

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

Description

Obsolete: 'icd9' is replaced by CRAN package 'icd'. Calculate comorbidities, Charlson scores, perform fast and accurate validation, conversion, manipulation, filtering and comparison of ICD-9-CM (clinical modification) codes. ICD-9 codes appear numeric but leading and trailing zeroes, and both decimal and non-decimal "short" format codes exist. The package enables a work flow from raw lists of ICD-9 codes from hospital billing databases to comorbidities. ICD-9 to comorbidity mappings from Quan (Deyo and Elixhauser versions), Elixhauser and AHRQ included. Any other mapping of codes, such as ICD-10, to comorbidities can be used.

Arguments

Details

Comorbidities
icd9Comorbid determines co-morbidities for a set of patients with one or more ICD-9 codes each. icd9Charlson calculates Charlson score (Comorbidity Index).

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

  • Quan revised both Deyo/Charlson and Elixhauser ICD-9 to comorbidity mappings. These are presented as: link{quanDeyoComorbid} (which is also derived from the original SAS code used in his publication, referenced in the data documentation), and quanElixComorbid which was transcribed directly from the same paper.
  • The original Elixhauser mapping is provided, with codes transcribed from the original publication. See elixComorbid.
  • Validation
    icd9IsValid checks whether ICD-9 codes are syntactically valid (although not necessarily genuine ICD-9 diagnoses). In contrast, icd9IsReal 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: icd9DecimalToShort, icd9ShortToDecimal 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 icd9Children and find a common parent to a set of children (or arbitrary list of ICD-9 codes) with icd9Condense. icd9Sort sorts in hierarchical, then numerical order, so 100.0 comes before 100.00, for example. icd9WideToLong and icd9LongToWide convert the two most common data structures containing patient disease data. This is more sophisticated than standard R or Hadleyverse reshaping.

    Explanation, or decoding
    Use icd9Explain 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. icd9DiffComorbid 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. icd9Hierarchy is a data.frame containing the full ICD-9 classification for each diagnosis. icd9Chapters contains definitions of chapters, sub-chapters and three-digit groups.

    References

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

    See Also

    rClinicalCodes comorbidities