National Cancer Institute Home at the National Institutes of Health | www.cancer.gov

SEER-Medicare: Calculation of Comorbidity Weights

These macros are provided to assist investigators with their analysis. NCI does not accept responsibility for the completeness or accuracy of the codes and weights used in the macros. Investigators may modify the macros if they have differing diagnosis codes or condition weights. The macros are currently being re-evaluated by NCI.

The first decision that an investigator must make is whether to use claims only from the hospital file (MEDPAR) or whether also to include the diagnoses on claims submitted by physicians (carrier data), as described in Klabunde et al. The rationale for including diagnoses from the physician claims is that many more people see a physician than are hospitalized, thus increasing the possibility of identifying more comorbid conditions. If the MEDPAR data are the only file being used, then there is no need to use the first SAS macro and investigators may skip to the second macro.

  1. remove.ruleout.dxcodes.macro.txt
    This macro is only needed if both physician and hospital claims are being used to identify comorbid conditions. This macro requires that for physician and outpatient claims, a patient's diagnoses must appear on at least two different claims that are more than 30 days apart. The reason for this is that the diagnoses on the physician and outpatient claims have not been validated and it is possible that physicians may have recorded a diagnosis as being present, when the correct coding would be "rule out" the condition. Conditions that do not appear on two different claims are considered to be "rule out" diagnoses, and are not counted as comorbid conditions. This is necessary to prevent over-estimation of the comorbidity when using physician or outpatient claims.
  2. charlson.comorbidity.macro.txt
    This macro calculates Charlson comorbidity weights from the claims. The SAS macro considers the ICD-9 diagnosis codes, ICD-9 procedure codes, and HCPCS procedure codes on the claims. Researchers using hospital data with physician or outpatient data need to use the file produced from the first macro.

Building an Input File for the Macros

Regardless of which files an investigator decides to use, the files should be subset to include a limited number of variables as described below. All ICD-9-CM diagnosis codes on these records should be 5 characters long and ICD-9-CM procedure codes should be 4 characters long. Before invoking the SAS macros, decimal points or blanks occurring within the number should be removed from the code (ex. diagnosis code '123.4' becomes '1234 ').

Variables to retain for the macros:

  • MEDPAR data - retain REGCASE, admission date, diagnosis codes 1-10, surgery codes 1-10 and length of stay. Set filetype=M.
  • Carrier data - retain REGCASE, claim from date, HCPCS, diagnosis codes 1-9 (eight of the diagnoses are from the header of the claim and one is the line item diagnosis). The carrier data can have more than one claim for the same date of service and all claims for each date should be included. Set filetype=N.
  • Outpatient data - retain REGCASE, claim from date, HCPCS, diagnosis codes 1-10, ICD procedure codes 1-10. Set filetype=O.

The final SAS file which combines data from any of the above sources must include the variables used in the Macro call. For each record a flag (IDXPRI) needs to be created to flag records that fall within the window of analysis. For example, if the comorbidity score for the 12 months prior to diagnosis is to be calculated, then records with claim dates falling within that window should have IDXPRI set to "P". If however the window is to be the month of diagnosis, then records with the claim date within the month of diagnosis should have IDXPRI set to "I". Records not in the analysis window should have IDXPRI left blank, or should be excluded from the final SAS file.

These variables are needed for the Comorbidity macro:

PATID Patient ID
IDXPRI Event Window indicator, "P"=Prior, "I"=Index
DAYS Length of stay for Hospital visits, only for MEDPAR records
DXVARSTR Diagnosis array, such as DX1-DX10. Note: DX10 is blank for NCH/carrier data
NDXVAR Number of variables in Diagnosis array, usually 10
SXVARSTR Procedure array, such as surgery codes from MEDPAR and procedure codes from Outpatient. Note: These are blank for NCH/carrier data
NSXVAR Number of variables in Procedure array, usually 10
HCPCS Outpatient and NCH/Carrier procedure codes in CPT-4. Note: This is blank for MEDPAR records
FILETYPE M-MEDPAR, N-NCH/Carrier, O-Outpatient

These variables are needed for the Ruleout macro:

PATID Patient ID
CLMDTE Admission date from Medpar, claim from date from NCH/carrier and Outpatient (in SAS date format)
START Start of comorbidity window, such as 12 months prior to Diagnosis Date (in SAS date format)
FINISH End of comorbidity window, such as 1 month prior to Diagnosis Date (in SAS date format)
DXVARSTR Diagnosis array, such as DX1-DX10. Note: DX10 is blank for NCH/carrier data
NDXVAR Number of variables in Diagnosis array, usually 10
HCPCS Outpatient and NCH/Carrier procedure codes in CPT-4. Note: This is blank for MEDPAR records
FILETYPE M-MEDPAR, N-NCH/Carrier, O-Outpatient

References

  1. Charlson ME, Pompei P, Ales KL, MacKenzie CR. A new method of classifying prognostic comorbidity in longitudinal studies: development and validation. J Chronic Dis 1987;40(5):373-83. [View Abstract]
  2. Deyo RA, Cherkin DC, Ciol MA. Adapting a clinical comorbidity index for use with ICD-9-CM administrative databases. J Clin Epidemiol 1992 Jun;45(6):613-9. [View Abstract]
  3. Romano PS, Roos LL, Jollis JG. Adapting a clinical comorbidity index for use with ICD-9-CM administrative data: differing perspectives. J Clin Epidemiol 1993 Oct;46(10):1075-9; discussion 1081-90. [Look up in PubMed]
  4. Klabunde CN, Potosky AL, Legler JM, Warren JL. Development of a comorbidity index using physician claims data. J Clin Epidemiol 2000 Dec;53(12):1258-67. [View Abstract]

Last Modified: 18 Oct 2013