Pediatric Complex Chronic Conditions

knitr::opts_chunk$set(echo = TRUE)
n <- 10000
dat <- data.frame(id = n + seq(n),
                  icd_dx1 = sample(icd10cm2016$code, n, replace = TRUE),
                  icd_dx2 = sample(icd10cm2016$code, n, replace = TRUE),
                  icd_pcs1 = sample(icd10_pcs_2018$pcs, n, replace = TRUE),
                  icd_pcs2 = sample(icd10_pcs_2018$pcs, n, replace = TRUE)

Pediatric Complex Chronic Conditions


The adult comorbidities defined by authors such as Charlson, Quan and Elixhuaser are not suitable for pediatric research. Feudtner and others produced comorbidity definitions suitable for infants and children, with mappings defined for both ICD-9 and ICD-10 codes. These are now included in the icd package for R, which enables fast calculation of comorbidities for PCCC and other ICD code to comorbidity maps.

Calculating PCCC comorbidities.

The PCCC comorbidities may be derived from both diagnostic and procedure codes. The following simulated data has both:


The data is in 'wide' format. Currently icd requires it be in 'long' format, which can be achieved as follows:

dx <- wide_to_long(dat[1:3])
pcs <- wide_to_long(dat[c(1, 4:5)], icd_name = "pcs", icd_regex = "icd_pcs")

Now the PCCC comorbidity classes can be computed and summarized in a plot:

pccc_dx <- comorbid_pccc_dx(dx)
pccc_pcs <- icd10_comorbid_pccc_pcs(pcs, 
                                    visit_name = "id", icd_name = "pcs")
res <- pccc_dx | pccc_pcs
barplot(sort(colSums(res), decreasing = TRUE), 
        ylim = c(0, 70),
        ylab = "count", las = 2)

Try the icd package in your browser

Any scripts or data that you put into this service are public.

icd documentation built on Aug. 19, 2018, 1:05 a.m.