The Procedure Class classification for ICD-9 and ICD-10 codes is a procedure categorization scheme that can employ in many types of projects to analyze data.

icdPrToProcedureClass(
  prDataFile,
  idColName,
  icdColName,
  dateColName,
  icdVerColName = NULL,
  icd10usingDate = NULL,
  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).

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

This function 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: prCCS

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 procedure class classification

icdPrToProcedureClass(samplePrFile, ID, ICD, Date, icdVerColName = NULL, "2015-10-01", TRUE)
#> $groupedDT
#>        Short ID     ICD       Date PROCEDURE_CLASS_NAME
#>   1:    5681  B    5681 2008-01-14    Major Therapeutic
#>   2:    9774  A    9774 2009-01-11    Minor Therapeutic
#>   3:    4499  B   44.99 2009-05-10    Major Therapeutic
#>   4:    0759  C   07.59 2009-01-21    Major Therapeutic
#>   5:    0205  B    0205 2008-07-06    Major Therapeutic
#>  ---                                                   
#> 166: 00UH4KZ  B 00UH4KZ 2019-08-04    Major Therapeutic
#> 167: 001U074  A 001U074 2020-10-04    Major Therapeutic
#> 168: 02160AQ  C 02160AQ 2021-12-01    Major Therapeutic
#> 169: 02134KC  A 02134KC 2020-01-30    Major Therapeutic
#> 170: 00WU0YZ  B 00WU0YZ 2020-06-08    Major Therapeutic
#> 
#> $Error
#> NULL
#>