Package 'pccc'

Title: Pediatric Complex Chronic Conditions
Description: An implementation of the pediatric complex chronic conditions (CCC) classification system using R and C++.
Authors: Peter DeWitt [aut] , Tell Bennett [ctb] , James Feinstein [aut] , Seth Russell [aut, cre]
Maintainer: Seth Russell <[email protected]>
License: GPL-2
Version: 1.0.5.9000
Built: 2024-11-04 06:20:34 UTC
Source: https://github.com/cud2v/pccc

Help Index


Complex Chronic Conditions (CCC)

Description

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

Usage

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:

  • *Do not* use decimal points or other separators

  • ICD 9 codes: Codes less than 10 should be left padded with 2 zeros. Codes less than 100 should be left padded with 1 zero.

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

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)

Multiple Cause of Death (MCOD) file extract

Description

The Center for Disease Control has made publicly available death certificate data. This data set is a subset of the 2006 MCOD file for decedents aged <= 21 showing just the underlying cause of death diagnosis code in ICD-9-CM and ICD-10.

Usage

comparability

Format

A data frame with 65037 rows and 3 variables.

id

Sequentially assigned patient identifier

icd9

Underlying Cause of Death ICD 9 CM diagnosis code

icd10

Underlying Cause of Death ICD 10 diagnosis code

See Also

vignette("pccc-example") for more details about the MCOD source file.


Get (view) Diagnostic and Procedure Codes

Description

View the ICD, version 9 or 10, for the Complex Chronic Conditions (CCC) categories.

Usage

get_codes(icdv)

Arguments

icdv

and integer value specifying ICD version. Accepted values are 9 or 10.

Details

The CCC categories for diagnostic and procedure codes are:

category dx dx_fixed pc pc_fixed
neuromuscul X X X
cvd X X X
respiratory X X X
renal X X
gi X X
hemato_immu X X
metabolic X X X
congeni_genetic X
malignancy X X
neonatal X
tech_dep X X
transplant X X

The ICD codes were taken from the SAS macro provided by the reference paper.

Value

A matrix of character vectors. Rows are the categories and columns for diagnostic and procedure codes.

References

Feudtner C, et al. Pediatric complex chronic conditions classification system version 2: updated for ICD-10 and complex medical technology dependence and transplantation, BMC Pediatrics, 2014, 14:199, DOI: 10.1186/1471-2431-14-199

Examples

# All ICD 9 codes for CCC
get_codes(9)

# All ICD 10 codes for CCC
get_codes(10)

# Get all the codes for ICD 9 related to malignancy
get_codes(9)["malignancy", ]

Randomly Generated ICD 10 Sample Data Set

Description

This dataset was produced from a tool available at https://github.com/magic-lantern/icd_file_generator. ICD codes were taken from CMS. The code source, for both the diagnosis and produced codes can be found at https://www.cms.gov/Medicare/Coding/ICD10/2017-ICD-10-CM-and-GEMs.html

Usage

pccc_icd10_dataset

Format

A data frame with 1000 rows and 31 variables. There is a patient identifier, ten diagnosis codes, ten procedure codes, and ten "other data" values, specifically:

id

Sequentially assigned patient identifier

dx1

a ICD 10 diagnosis code

dx2

a ICD 10 diagnosis code

dx3

a ICD 10 diagnosis code

dx4

a ICD 10 diagnosis code

dx5

a ICD 10 diagnosis code

dx6

a ICD 10 diagnosis code

dx7

a ICD 10 diagnosis code

dx8

a ICD 10 diagnosis code

dx9

a ICD 10 diagnosis code

dx10

a ICD 10 diagnosis code

pc1

a ICD 10 procedure codes

pc2

a ICD 10 procedure codes

pc3

a ICD 10 procedure codes

pc4

a ICD 10 procedure codes

pc5

a ICD 10 procedure codes

pc6

a ICD 10 procedure codes

pc7

a ICD 10 procedure codes

pc8

a ICD 10 procedure codes

pc9

a ICD 10 procedure codes

pc10

a ICD 10 procedure codes

g1

Random data to simulate other data often present in export of patient data with 20% of values missing.

g2

Random data to simulate other data often present in export of patient data with 20% of values missing.

g3

Random data to simulate other data often present in export of patient data with 20% of values missing.

g4

Random data to simulate other data often present in export of patient data with 20% of values missing.

g5

Random data to simulate other data often present in export of patient data with 20% of values missing.

g6

Random data to simulate other data often present in export of patient data with 20% of values missing.

g7

Random data to simulate other data often present in export of patient data with 20% of values missing.

g8

Random data to simulate other data often present in export of patient data with 20% of values missing.

g9

Random data to simulate other data often present in export of patient data with 20% of values missing.

g10

Random data to simulate other data often present in export of patient data with 20% of values missing.


Randomly Generated ICD 9 Sample Data Set

Description

This dataset was produced from a tool available at https://github.com/magic-lantern/icd_file_generator. ICD codes were taken from CMS. The ICD 9 diagnosis and procedure codes were generated with 20 missing values. Code source: https://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html

Usage

pccc_icd9_dataset

Format

A data frame with 1000 rows and 31 variables. There is a patient identifier, ten diagnosis codes, ten procedure codes, and ten "other data" values, specifically:

id

Sequentially assigned patient identifier

dx1

a ICD 9 diagnosis code

dx2

a ICD 9 diagnosis code

dx3

a ICD 9 diagnosis code

dx4

a ICD 9 diagnosis code

dx5

a ICD 9 diagnosis code

dx6

a ICD 9 diagnosis code

dx7

a ICD 9 diagnosis code

dx8

a ICD 9 diagnosis code

dx9

a ICD 9 diagnosis code

dx10

a ICD 9 diagnosis code

pc1

a ICD 9 procedure codes

pc2

a ICD 9 procedure codes

pc3

a ICD 9 procedure codes

pc4

a ICD 9 procedure codes

pc5

a ICD 9 procedure codes

pc6

a ICD 9 procedure codes

pc7

a ICD 9 procedure codes

pc8

a ICD 9 procedure codes

pc9

a ICD 9 procedure codes

pc10

a ICD 9 procedure codes

g1

Random data to simulate other data often present in export of patient data with 20% of values missing.

g2

Random data to simulate other data often present in export of patient data with 20% of values missing.

g3

Random data to simulate other data often present in export of patient data with 20% of values missing.

g4

Random data to simulate other data often present in export of patient data with 20% of values missing.

g5

Random data to simulate other data often present in export of patient data with 20% of values missing.

g6

Random data to simulate other data often present in export of patient data with 20% of values missing.

g7

Random data to simulate other data often present in export of patient data with 20% of values missing.

g8

Random data to simulate other data often present in export of patient data with 20% of values missing.

g9

Random data to simulate other data often present in export of patient data with 20% of values missing.

g10

Random data to simulate other data often present in export of patient data with 20% of values missing.


Test Helper

Description

Tool to help access internal variables to use in testthat scripts, or anytime access via ::: would be needed.

Usage

test_helper(var)

Arguments

var

bare name of the internal variable to be accessed.

Value

Object from internal PCCC name space (if it exists)