ccc: Complex Chronic Conditions (CCC)

Description Usage Arguments Details Value References See Also Examples

View source: R/ccc.R

Description

Generate CCC and CCC subcategory flags and the number of categories.

Usage

1
ccc(data, id, dx_cols = NULL, pc_cols = NULL, icdv)

Arguments

data

a data.frame containing a patient id and all the ICD-9-CM or ICD-10-CM codes. The data.frame passed to the function should be in wide format.

id

bare name of the column containing the patient id

dx_cols, pc_cols

column names with the diagnostic codes and procedure codes respectively. These argument are passed to select.

icdv

ICD version 9 or 10

Details

It is recommended that you view the codes defining the CCC via get_codes and make sure that the ICD codes in your data set are formatted in the same way. The ICD codes used for CCC are character strings must be formatted as follows:

See 'vignette("pccc-overview")' for more details.

Value

A data.frame with a column for the subject id and integer (0 or 1) columns for each each of the categories.

References

See pccc-package for published paper on the topic of identifying Complex Chronic Conditions

See Also

get_codes to view the ICD codes used to define the CCC. select for more examples and details on how to identify and select the diagnostic and procedure code columns.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
eg_data <- data.frame(id = letters,
                      dx1 = c(NA, NA, sample(get_codes(10)[["hemato_immu", "dx"]], 24)),
                      dx2 = c("A", sample(get_codes(10)[["gi", "dx"]], 25)),
                      dx3 = LETTERS,
                      pc1 = c("B", sample(get_codes(10)[["cvd", "pc"]], 25)),
                      pc2 = LETTERS,
                      other_col = LETTERS)

ccc(eg_data, 
    id,
    dx_cols = dplyr::starts_with("dx"),
    pc_cols = dplyr::starts_with("pc"),
    icdv = 10)

pccc documentation built on July 1, 2020, 11:41 p.m.