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.

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.

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 ').

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.

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