dxCCS: Code classification for CCS

dxCCSR Documentation

Code classification for CCS

Description

These CCS functions (icdDxToCCS and icdDxToCCSLvl) collapse ICD codes into a smaller number of clinically meaningful categories that are more useful for presenting descriptive statistics than individual ICD diagnostic codes are. CCS classification for ICD-9 and ICD-10 codes is a diagnostic categorization scheme that can employ in many types of projects analyzing data on diagnoses.

Usage

icdDxToCCS(
  dxDataFile,
  idColName,
  icdColName,
  dateColName,
  icdVerColName = NULL,
  icd10usingDate = NULL,
  isDescription = TRUE
)

icdDxToCCSLvl(
  dxDataFile,
  idColName,
  icdColName,
  dateColName,
  icdVerColName = NULL,
  icd10usingDate = NULL,
  CCSLevel = 1,
  isDescription = TRUE
)

Arguments

dxDataFile

A data frame object of clinical diagnostic 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 dxDataFile. Data type of this argumant should be string without quotation marks.

icdColName

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

dateColName

Column name of date column in dxDataFile, and the type of date column should be a date format in R or a string format with date information in YYYY/MM/DD or YYYY-MM-DD. Data type of this argumant should be string without quotation marks.

icdVerColName

(Optional) Column name if there is a columns to record ICD-9/10 version used in dxDataFile. In this column, data format should be numeric 9L or 10L to indicate which ICD version is used for each cell. See examples below to get more information.

icd10usingDate

The date that ICD-10 was started to be used in dxDataFile 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 4 multi-level CCS (1~4) for ICD-9, and 2 multi-level CCS (1 and 2) for ICD-10.

Details

Notice: CCS stopped updating since 2019, replacing by Clinical Classifications Software Refined (CCSR). dxCCSR (icdDxToCCSR) function is also provided.

Value

Three new data.tables. 1) groupedDT: Based on dxDataFile with two new columns for uniform format diagnostic codes and classified categories. 2) summarised_groupedDT: Summarized the groupedDT dataset and sorted by memberID. 3) Error: Potential error codes from standardization step: dxUniform (icdDxShortToDecimal and icdDxDecimalToShort).

See Also

Other code classification functions: dxCCSR (icdDxToCCSR), dxPheWAS (icdDxToPheWAS), dxCustom (icdDxToCustom and icdDxToCustomGrep), dxComorbid (icdDxToComorbid).

Examples

# sample file for example

head(sampleDxFile)

# Group diagnostic codes into single level of CCS classification

icdDxToCCS(sampleDxFile, ID, ICD, Date, icd10usingDate =  "2015-10-01", isDescription = TRUE)

# Group diagnostic codes into multiple levels of CCS classification

icdDxToCCSLvl(sampleDxFile, ID, ICD, Date, icdVerColName = NULL, "2015-10-01", 2, TRUE)

DHLab-CGU/emr documentation built on Sept. 2, 2023, 9:16 p.m.