The CCS classification for ICD-9 and ICD-10 codes is a procedure categorization scheme that can employ in many types of projects analyzing data on procedures

icdPrToCCS(
  prDataFile,
  idColName,
  icdColName,
  dateColName,
  icdVerColName = NULL,
  icd10usingDate = NULL,
  isDescription = TRUE
)

icdPrToCCSLvl(
  prDataFile,
  idColName,
  icdColName,
  dateColName,
  icdVerColName = NULL,
  icd10usingDate = NULL,
  CCSLevel = 1,
  isDescription = TRUE
)

Arguments

prDataFile

A data frame object of clinical procedure data with at least 3 columns: ID, ICD, and Date. As for date column, the data format should be YYYY/MM/DD or YYYY-MM-DD.

idColName

Column name of ID column in prDataFile. Data type of this argumant should be string without quotation marks.

icdColName

Column name of ICD column in prDataFile. Data type of this argumant should be string without quotation marks.

dateColName

Column name of date column in prDataFile (with date in YYYY/MM/DD or YYYY-MM-DD format). Data type of this argumant should be string without quotation marks.

icdVerColName

(Optional) Column name of ICD-9/10 version recorded in prDataFile. Data format in this column should be numeric 9L or 10L.

icd10usingDate

The date that ICD-10 was started to be used in prDataFile dataset. The data format should be YYYY/MM/DD or YYYY-MM-DD. Necessary if icdVerColName is null.

isDescription

Binary. If true, category description of classification methods will be used in the group column. If false, category name will be used. By default, it is set to be True (standard category description).

CCSLevel

Numeric. Used for multi-level CCS. By default, it is set to 1. There is 3 multi-level CCS (1~3) for ICD-9, and 2 multi-level CCS (1 and 2) for ICD-10.

Value

Two new data.tables. 1) groupedDT: Based on prDataFile with two new columns for uniform format procedure codes and classified standard categories. 2) Error: Potential error codes from prUniform.

Details

These CCS functions collapse ICD codes into a smaller number of clinically meaningful categories that are more useful for presenting descriptive statistics than individual ICD procedure codes are.

See also

see other code classification: PC (icdPrToProcedureClass).

Examples

# sample file for example

head(samplePrFile)
#>    ID   ICD       Date
#> 1:  B  5681 2008-01-14
#> 2:  A  9774 2009-01-11
#> 3:  B 44.99 2009-05-10
#> 4:  C 07.59 2009-01-21
#> 5:  B  0205 2008-07-06
#> 6:  B  8812 2007-06-27

# Group procedure codes into single level of CCS classification

icdPrToCCS(samplePrFile, ID, ICD, Date, icdVerColName = NULL, "2015-10-01", TRUE)
#> $groupedDT
#>        Short ID     ICD       Date
#>   1:    5681  B    5681 2008-01-14
#>   2:    9774  A    9774 2009-01-11
#>   3:    4499  B   44.99 2009-05-10
#>   4:    0759  C   07.59 2009-01-21
#>   5:    0205  B    0205 2008-07-06
#>  ---                              
#> 166: 00UH4KZ  B 00UH4KZ 2019-08-04
#> 167: 001U074  A 001U074 2020-10-04
#> 168: 02160AQ  C 02160AQ 2021-12-01
#> 169: 02134KC  A 02134KC 2020-01-30
#> 170: 00WU0YZ  B 00WU0YZ 2020-06-08
#>                                                  CCS_CATEGORY_DESCRIPTION
#>   1:                     Other OR therapeutic procedures of urinary tract
#>   2:                   Other non-OR therapeutic procedures; female organs
#>   3:                             Other OR upper GI therapeutic procedures
#>   4:                                     Therapeutic endocrine procedures
#>   5:                       Other OR therapeutic nervous system procedures
#>  ---                                                                     
#> 166:                       Other OR therapeutic nervous system procedures
#> 167: Insertion; replacement; or removal of extracranial ventricular shunt
#> 168:                                            Other OR heart procedures
#> 169:                                  Coronary artery bypass graft (CABG)
#> 170:                       Other OR therapeutic nervous system procedures
#> 
#> $Error
#> NULL
#> 

# Group procedure codes into multiple levels of CCS classification

icdPrToCCSLvl(samplePrFile, ID, ICD, Date, icdVerColName = NULL, "2015-10-01", 2, TRUE)
#> $groupedDT
#>        Short ID     ICD       Date
#>   1:    5681  B    5681 2008-01-14
#>   2:    9774  A    9774 2009-01-11
#>   3:    4499  B   44.99 2009-05-10
#>   4:    0759  C   07.59 2009-01-21
#>   5:    0205  B    0205 2008-07-06
#>  ---                              
#> 166: 00UH4KZ  B 00UH4KZ 2019-08-04
#> 167: 001U074  A 001U074 2020-10-04
#> 168: 02160AQ  C 02160AQ 2021-12-01
#> 169: 02134KC  A 02134KC 2020-01-30
#> 170: 00WU0YZ  B 00WU0YZ 2020-06-08
#>                                                           CCS_LVL_2_LABEL
#>   1:                     Other OR therapeutic procedures of urinary tract
#>   2:                   Other non-OR therapeutic procedures; female organs
#>   3:                             Other OR upper GI therapeutic procedures
#>   4:                               Other therapeutic endocrine procedures
#>   5:                       Other OR therapeutic nervous system procedures
#>  ---                                                                     
#> 166:                       Other OR therapeutic nervous system procedures
#> 167: Insertion; replacement; or removal of extracranial ventricular shunt
#> 168:                                            Other OR heart procedures
#> 169:                                  Coronary artery bypass graft (CABG)
#> 170:                       Other OR therapeutic nervous system procedures
#> 
#> $Error
#> NULL
#>