Skip Navigation
Healthcare Cost and Utilization Project logo
Comorbidity Software, Version 2.0
The Comorbidity Software is one of the HCUP tools that can be applied to HCUP and other similar databases. These tools are created by AHRQ through a Federal-State-Industry partnership.
snowflake icon
  Home Databases Tools & Software Reports Technical Assistance
 
Comorbidity Software, Version 2.0

The Comorbidity Software is one in a family of databases and software tools developed as part of the Healthcare Cost and Utilization Project (HCUP), a Federal-State-Industry partnership sponsored by the Agency for Healthcare Research and Quality. HCUP databases, tools, and software inform decision making at the national, State, and community levels.

Contents:

Comorbidity software assigns variables that identify comorbidities in hospital discharge records using the diagnosis coding of ICD-9-CM (International Classification of Diseases, Ninth Edition, Clinical Modifications). This document describes the software that creates the comorbidity measures reported by Elixhauser et al. ("Comorbidity Measures for Use with Administrative Data." Medical Care, 1998;36:8-27).

Select to download software.

The comorbidity software consists of two SAS computer programs for PCs. Although these programs are written in SAS, they are being distributed in ASCII so that they can be readily adapted to other programming languages.

The first program, Creation of Format Library for Comorbidity Groups, creates a SAS format library that maps diagnosis codes into comorbidity indicators. Additional formats are created to exclude conditions that may be complications or that may be related to the principal diagnosis.

The second SAS program, Creation of Comorbidity Variables, applies these formats to a data set containing administrative data.

This documentation describes three topics:
  • Data elements required for the programs.
  • The SAS programs.
  • How to use the SAS programs on an IBM-compatible PC.
Return to Contents
 

The input data file must contain certain elements that are coded in specific ways. These elements are required for the assignment of the comorbidity flags. The flags are 0/1 indicators that note whether individual records include each comorbidity.

The input data set must have the following two variables:
  1. Diagnosis-related groups (DRGs).
  2. Diagnostic codes (ICD-9-CMs).
The required elements and coding are detailed further below.

Required Elements of Input File
Element Type Length Label and Uniform Coding
DRG Num 3 DRG in effect on discharge date, assigned by the DRG Grouper algorithm of the Health Care Financing Administration (HCFA)
DX1 Char 5 Principal diagnosis, annnn (blanks indicate missing)
DX2-DXn Char 5 Secondary diagnoses 2-n, where n varies by data set
NDX Num 3 Number of diagnoses on this discharge. (Note: A macro variable defines this element; it is currently set as 2.) NDX should always be equal or less than the macro variable called NUMDX.

Select for Text Version. (PDF file, 10 KB)
Return to Contents
 

Creation of Format Library for Comorbidity Groups
The format program defines a format library that contains the diagnosis screens necessary for the comorbidity analysis. It will be used by Program 2, the comorbidity analysis program.
  • Input: None
  • Output: Permanent SAS format library called \FMTLIB\formats.sc2.
  • Changes: The code points to a directory called FMTLIB on the c: drive for the format library output file. If you use another directory or drive, this code must be changed. Initially, this directory should be defined.
Return to Contents
 

Creation of Comorbidity Variables

The analysis program assigns to the inpatient records 0/1 indicators for the comorbidity variables of interest. This program assumes that the input data file conforms to specific variables names, attributes, and coding conventions, as described above.
  • Input: SAS inpatient data (CORE) conforming to HCUP coding conventions (described above), and SAS format library (FMTLIB), created from the included format program.
  • Output: SAS data set (ANALYSIS) containing inpatient records with their comorbidity indicators. The contents of the ANALYSIS file and the means for the comorbidity variables are output as hard copy. The output file is called ANALYSIS; if your file name differs, the DATA statement needs to be changed.
  • Changes: The code points to a directory called DATA on the c: drive for the input and output files. If you use another directory or drive, this code must be changed. Initially, the DATA directory needs to be defined. The macro variable (NUMDX) that defines the number of diagnoses on your data file needs to be defined (change the "2" to the appropriate number).
The macro variable (CORE) that defines the input file (SASname) needs to be defined; change the XXXXXX to the appropriate name.

There is an options statement that defines page and line size preferences; the settings currently are linesize=159 and pagesize=56. These settings can be changed, depending upon whether you prefer portrait or landscape style output.
Return to Contents
 

ICD-9-CM and DRG coding changes through September 30, 2004, are incorporated into this software. Changes to the Comorbidity Software for FY2004, Version 2.0 are summarized in Table 1. (PDF file, 39 KB)
Return to Contents
 

Thirty comorbidity variables are created using the comorbidity software, based on the format library. The library contains formats for the ICD-9-CM codes and DRG screens. Construction of these variables is summarized in Table 2. (PDF file, 24 KB)

The original table appeared in the paper by Elixhauser et al (1998). This table has been updated to reflect the ICD-9-CM and DRG updates in the software.
Return to Contents
 

Web Browser Download: Your browser may support loading the files from this Web page. To download the files from this page, click on the following links with the right mouse button and select "Save Link As" (Netscape) or "Save Target As" (Internet Explorer). After saving a file, find the file by using Windows® Explorer (Windows® 95/98/NT/2000/XP) or File Manager (Windows® 3.x) and then open it by double-clicking on the file name. Though they are written in SAS, both files are being distributed in ASCII so they can be readily adapted to other programming languages.
Return to Contents
 

Questions regarding the CCS may be directed to HCUP User Support through the following channels:
Return to Contents
 

Additional information is available on the AHRQ Web site.
If you have comments, suggestions, and/or questions, please contact hcup@ahrq.gov.
Are you having problems viewing or printing pages on this Web site?
Internet Citation: HCUP Comorbidity Software. Healthcare Cost and Utilization Project (HCUP). August 2004.
Agency for Healthcare Research and Quality, Rockville, MD. www.hcup-us.ahrq.gov/toolssoftware/comorbidity/comorbidity.jsp.
Last modified 8/3/04