Learn R Programming

icd (version 3.3)

icd-package: icd: Comorbidity Calculations and Tools for ICD-9 and ICD-10 Codes

Description

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

Arguments

Details

Comorbidities

comorbid determines comorbidities for a set of patients with one or more ICD codes each. All the comorbidity functions attempt to guess which are your identifier and ICD code fields, and these can also be specified exactly.

  • The AHRQ comorbidity mappings from ICD-9 and ICD-10 are provided as icd9_map_ahrq and icd10_map_ahrq. The easiest way to use them is by calling the function comorbid_ahrq directly with your icd_long_data format patient data.

  • Quan revised both Deyo/Charlson and Elixhauser ICD-9 and ICD-10 to comorbidity mappings. These are presented as: icd9_map_quan_deyo, icd10_map_quan_deyo, icd9_map_quan_elix, and icd10_map_quan_elix. Like the AHRQ mappings, these are all carefully extracted from the original publications or source code. These mappings can be used on patient data by calling comorbid_quan_deyo and comorbid_quan_elix

  • There is no canonical Charlson ICD-9 or ICD-10 mapping, so comorbid_charlson uses the thoroughly researched and widely cited comorbid_quan_deyo method by default.

  • The original Elixhauser mappings are provided by the lists icd9_map_elix and icd10_map_elix, and Elixhauser comorbidities can be calculated directly from patient data using comorbid_elix.

  • AHRQ publishes Hierarchical Condition Codes (HCC) which are essentially comorbidity maps with very many comorbidities, complicated by a single- or multi-level system. These categories can be computed using comorbid_hcc.

  • AHRQ also publishes Clinical Classification Software (CCS) which provides another set of disease groups, and this SAS code is implemented in 'icd' by comorbid_ccs

Risk scoring systems

charlson calculates Charlson scores (Charlson Comorbidity Indices) directly from your patient data. If you already calculated the Charlson comorbidities, it is more efficient to use charlson_from_comorbid. Similarly, van_walraven calculates Van Walraven scores (based on the Elixhauser comorbidities, instead of Charlson), and van_walraven_from_comorbid if you already calculated Elixhauser comorbidities

Validation

is_valid checks whether ICD-9 codes are syntactically valid (although not necessarily genuine ICD-9 diagnoses). In contrast, 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: decimal_to_short, short_to_decimal to convert, e.g., 002.3 to 0023 and back again. See convert for other options. Conversion between ICD-9, ICD-10, and ICD-11 codes is not yet supported.

Manipulation

You can find children of a higher-level ICD-9 code with children and find a common parent to a set of children (or arbitrary list of ICD-9 codes) with condense. sort_icd sorts in hierarchical, then numerical order, so '100.0' comes before '100.00', for example.

wide_to_long and 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 packages like dplyr, although these could no doubt be used.

Explanation and decoding

Use explain_code 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. 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.

See Also

Useful links: