Readme.txt

Description of 'RSI Calculation for Web Use Rev 1.sps', Version 1.0 .

Oct. 25, 2010.

This document describes a package of routines that calculate the RSI indices from ICD-9-CM codes.  The ICD-9-CM codes should be those associated with a hosptal stay.

The code is written in SPSS and is provided in both SPSS syntax format (*.sps) and text format (*.txt).

The data files are in both SPSS format (*.sav) and comma-delimited (*.csv).

The SPSS syntax must be run in SPSS Version 15 or greater.


The data files and variables within them are:

1. File Name:   'sample data rev2.sav'.
   Description: A prototype input data file, in which each row represents a single patient stay and contains all the ICD-9-CM codes from that stay.
   Variables:
      patient_id                     (float)                Unique Case Identifier
      principal_procedure_ICD9CM     (5-character string)   Principal Procedure Code (ICD-9-CM) in format Pxxxx
      secondary_procedure_1_ICD9CM   (5-character string)   Secondary Procedure Code 1 (ICD-9-CM) in format Pxxxx
      secondary_procedure_2_ICD9CM   (5-character string)   Secondary Procedure Code 2(ICD-9-CM) in format Pxxxx
      secondary_procedure_3_ICD9CM   (5-character string)   Secondary Procedure Code 3 (ICD-9-CM) in format Pxxxx
      secondary_procedure_4_ICD9CM   (5-character string)   Secondary Procedure Code 4 (ICD-9-CM) in format Pxxxx
      secondary_procedure_5_ICD9CM   (5-character string)   Secondary Procedure Code 5 (ICD-9-CM) in format Pxxxx
      secondary_procedure_6_ICD9CM   (5-character string)   Secondary Procedure Code 6 (ICD-9-CM) in format Pxxxx
      secondary_procedure_7_ICD9CM   (5-character string)   Secondary Procedure Code 7 (ICD-9-CM) in format Pxxxx
      secondary_procedure_8_ICD9CM   (5-character string)   Secondary Procedure Code 8 (ICD-9-CM) in format Pxxxx
      secondary_procedure_9_ICD9CM   (5-character string)   Secondary Procedure Code 9 (ICD-9-CM) in format Pxxxx
      principal_diagnosis_ICD9CM     (6-character string)   Principal Diagnosis Code (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_1_ICD9CM   (6-character string)   Secondary Diagnosis Code 1 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_2_ICD9CM   (6-character string)   Secondary Diagnosis Code 2 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_3_ICD9CM   (6-character string)   Secondary Diagnosis Code 3 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_4_ICD9CM   (6-character string)   Secondary Diagnosis Code 4 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_5_ICD9CM   (6-character string)   Secondary Diagnosis Code 5 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_6_ICD9CM   (6-character string)   Secondary Diagnosis Code 6 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_7_ICD9CM   (6-character string)   Secondary Diagnosis Code 7 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_8_ICD9CM   (6-character string)   Secondary Diagnosis Code 8 (ICD-9-CM) in format Dxxxxx
      secondary_diagnosis_9_ICD9CM   (6-character string)   Secondary Diagnosis Code 9 (ICD-9-CM) in format Dxxxxx
   Note: Each ICD-9-CM code has a single-character prefix, which is D for diagnosis codes and P for procedure codes.
         Leading zeroes are preserved and decimals are not used.  For example, diagnosis code 123.45 must appear
         as D12345 and procedure code 3.2 must appear as P032.


2. File Name:   'sample results rev2.sav'.
   Description: A prototype output data file, in which each row represents a single patient stay and contains all the ICD-9-CM codes from that stay.
                This file is generated by running the routine !riskbuild in the file 'RSI Calculation for Web Use Rev 2.sps'.
   Variables:
      patient_id                      float                     Unique case identifier
      principal_diagnosis             6 character string        Principal diagnosis
      principal_diagnosis_label       64 character string       Principal diagnosis label
      principal_diagnosis_label_long  256 character string      Principal diagnosis label (long format)
      principal_procedure             6 character string        Principal procedure
      principal_procedure_label       64 character string       Principal procedure label
      principal_procedure_label_long  256 character string      Principal procedure label (long format)
      RSI_LOS                         float                     RSI_LOS
      RSI_INHOSP                      float                     RSI_INHOSP
      RSI_30Day                       float                     RSI_30Day
      RSI_1YR                         float                     RSI_1YR
      RSI_LOS_ce                      float                     RSI_LOS - excluding risk associated with CCS complication codes
      RSI_INHOSP_ce                   float                     RSI_INHOSP - excluding risk associated with CCS complication codes
      RSI_30Day_ce                    float                     RSI30Day - excluding risk associated with CCS complication codes
      RSI_1YR_ce                      float                     RSI_1YR - excluding risk associated with CCS complication codes


3. File Names:
    'All Proc - Step 4 - 1YRPOD - May-20-10.sav' .
    'All Proc - Step 4 - 30DLOS - May-20-10.sav' .
    'All Proc - Step 4 - 30DPOD - May-20-10.sav' .
    'All Proc - Step 4 - INHOSP - May-20-10.sav' .
   Description: Model coefficient files containing the model coefficients required to compute each of the RSI indices.
   Variables:
     dp_code_cox  6 character string  covariate, coded as an ICD-9-CM Code group (usually represents a set of codes
                                      collapsed using the Hierarchical Coding Algorithm).
     MEANBETA     float               covariate mean
     beta         float               covariate coefficient
     PopBeta      float               The summation of the product of the covariate means and the covariate coefficients.

    Note: the covariate mean is not used for the Inhospital Mortality RSI, since this is a logistic model.  The variable PopBeta is thus zero.


4. File name: 'DP - ICD-9CM Code Labels v19 - v27 with CCS.sav'
   Description: A file mapping ICD-9-CM codes to Clinical Classifications Software (CCS) codes.
   Variables:
     dp_code_tmp     6 character string        ICD-9-CM Code
     label          96 character string        ICD-9-CM Code Label (short)
     CCS_code_tmp    6 character string        CCS Code
     CCS_label_tmp 360 character string        CCS Code Label
     LONG_LABEL    666 character string        ICD-9-CM Code Label (long)

   Note: Variables dp_code_tmp and CCS_code_tmp have a single-character prefix, which is D for diagnosis codes and P for procedure codes.
         Leading zeroes are preserved and decimals are not used.  For example, ICD-9-CM diagnosis code 123.45 must appear as D12345
         and procedure code 3.2 must appear as P032.



The following files must be in the temporary folder specified in the "tempdir" argument to the routine !riskbuild:
   'All Proc - Step 4 - 1YRPOD - May-20-10.sav' .
   'All Proc - Step 4 - 30DLOS - May-20-10.sav' .
   'All Proc - Step 4 - 30DPOD - May-20-10.sav' .
   'All Proc - Step 4 - INHOSP - May-20-10.sav' .
   'DP - ICD-9CM Code Labels v19 - v27 with CCS.sav' .
   'sample data rev2.sav' .


The output file will be created in the temporary folder specified in the "tempdir" argument to the routine !riskbuild
and will be named 'sample data rev2.sav'.

The names of the ICD-9-CM variables must be passed to the !riskbuild routine as shown in the
argument INCODES.


An example call is shown below:

!riskbuild
 incodes    = (principal_procedure_ICD9CM secondary_procedure_1_ICD9CM secondary_procedure_2_ICD9CM 
              secondary_procedure_3_ICD9CM secondary_procedure_4_ICD9CM secondary_procedure_5_ICD9CM
              secondary_procedure_6_ICD9CM secondary_procedure_7_ICD9CM secondary_procedure_8_ICD9CM 
              secondary_procedure_9_ICD9CM principal_diagnosis_ICD9CM secondary_diagnosis_1_ICD9CM 
              secondary_diagnosis_2_ICD9CM secondary_diagnosis_3_ICD9CM secondary_diagnosis_4_ICD9CM
              secondary_diagnosis_5_ICD9CM secondary_diagnosis_6_ICD9CM secondary_diagnosis_7_ICD9CM 
              secondary_diagnosis_8_ICD9CM secondary_diagnosis_9_ICD9CM)
 inputfile   = (sample data rev2)
 outputfile  = (sample results rev2)
 tempdir     = (c:\spss\temp\).

