Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
174cc3c
extend codes for neuromusc, the G80 code misses G801 and G802 G809
dewittpe Apr 16, 2025
693dc60
add missing codes
dewittpe Apr 16, 2025
dd1b47c
fix M433 in congeni genetic and add 99687 for gi transplant
dewittpe May 6, 2025
a08d687
update .gitignore
dewittpe May 6, 2025
bab68b7
update test for icd10 with extended codes
dewittpe May 6, 2025
5c1ff03
update tests for ccc icd9 after extending codes
dewittpe May 6, 2025
548dc5c
update tests for the number of codes after extention
dewittpe May 6, 2025
906a7d9
update NEWS.md
dewittpe May 6, 2025
23bcd91
version bump
dewittpe May 6, 2025
8d9f349
correct spelling
dewittpe May 6, 2025
2a36138
add Language: en-us to DESCRIPTION
dewittpe May 6, 2025
9d98ee9
add inst/WORDLIST
dewittpe May 6, 2025
8694e96
spelling correction
dewittpe May 6, 2025
de938c2
update WORDLIST
dewittpe May 6, 2025
d399f92
add ICD9_ICD10_comparability_file_documentation.pdf which is referenc…
dewittpe May 6, 2025
8a502b0
add copy of 2017 ICD-10-CM and GEM files
dewittpe May 6, 2025
773064f
add copy of the 2018 ICD 10 CM and GEM files
dewittpe May 6, 2025
466e539
clean up urls
dewittpe May 6, 2025
a856cd2
clean up urls
dewittpe May 6, 2025
c4a1396
replace webarchive links with cms.gov links
dewittpe May 13, 2025
bb8b542
remove redundant code
dewittpe May 13, 2025
3996c50
add missing 996.86 to dx_gi
dewittpe May 13, 2025
2e64f9a
update test_get_codes
dewittpe May 13, 2025
9aba3e5
clean up G80.x codes for neuro
dewittpe May 13, 2025
4a9d309
update tests for the changes in codes
dewittpe May 14, 2025
1253158
Update NEWS.md
magic-lantern May 14, 2025
0b0a9a5
Update pccc.cpp
magic-lantern May 14, 2025
0546978
Update pccc-example.Rmd
magic-lantern May 14, 2025
33a7543
Update NEWS.md
magic-lantern May 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
^cran-comments\.md$
^CRAN-RELEASE$
^\.github$
^inst/icd/2017
^inst/icd/2018
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ vignettes/*.pdf
*.swo
.Rproj.user
inst/doc
.DS_Store
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pccc
Title: Pediatric Complex Chronic Conditions
Version: 1.0.5.9000
Version: 1.0.6
Authors@R: c(
person(given = "Peter", family = "DeWitt", email = "[email protected]", role = c("aut"), comment = c(ORCID = "0000-0002-6391-0795")),
person(given = "Tell", family = "Bennett", email = "[email protected]", role = c("ctb"), comment = c(ORCID = "0000-0003-1483-4236")),
Expand All @@ -12,6 +12,7 @@ Description: An implementation of the pediatric complex chronic conditions (CCC)
Depends: R (>= 3.5.0)
License: GPL-2
Encoding: UTF-8
Language: en-us
LazyData: true
Imports:
dplyr (>= 1.0.0),
Expand Down
17 changes: 16 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Version 1.0.5.9000
# Version 1.0.6

## Bug fixes

* Code fixes -- most of these codes were flagging transplant but not the primary organ system; these were present in original publication but missing from this package
* 996.83 added to CVD - it was flagging transplant but not CVD
* 996.84 added to respiratory
* 996.81 added to renal
* 996.82, 996.86, 996.87 added to gi
* ICD10 codes added to CVD: T86.20, T86.21, T86.22
* M4330 is not a valid code, corrected to M433 (impacts congeni_genetic)
* Add Z94.0 to transplant

## Extenstions
* Update old urls and adding some links to wayback machine snapshots
* Add key files to the package for reference

## New functions:
* S3 method `as_tibble.pccc_codes` has been added to the package to replace the
Expand Down
9 changes: 6 additions & 3 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' \url{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:
#' \url{https://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html}
#' \url{https://www.cms.gov/medicare/coding-billing/icd-10-codes/icd-9-cm-diagnosis-procedure-codes-abbreviated-and-full-code-titles}
#'
#' @format A data frame with 1000 rows and 31 variables.
#' There is a patient identifier, ten diagnosis codes, ten procedure codes, and
Expand Down Expand Up @@ -51,8 +51,11 @@
#' This dataset was produced from a tool available at
#' \url{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 \url{https://www.cms.gov/Medicare/Coding/ICD10/2017-ICD-10-CM-and-GEMs.html}
#'
#' found at
#' \url{https://www.cms.gov/medicare/coding-billing/icd-10-codes/icd-10-cm-icd-10-pcs-gem-archive}
#' with a copy of the downloaded data on the package github page,
#' \url{https://github.com/CUD2V/pccc}
#'
#' @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:
Expand Down
6 changes: 3 additions & 3 deletions R/pccc-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#' For ease, a copy of the paper is included in this package. See the examples
#' below for instructions on opening this pdf from within R or outside of R.
#' You can view the publication online at
#' \url{http://bmcpediatr.biomedcentral.com/articles/10.1186/1471-2431-14-199}.
#' \doi{10.1186/1471-2431-14-199}.
#'
#' Feudtner et. al. provided a SAS macro and STATA program to implement the CCC.
#' These files are also provided for reference. See the Examples for
#' instructions on opening these files.
#'
#' Lastly, the appendix tables in the file
#' Categories_of_CCCv2_and_Corresponding_ICD.docx have also been included with
#' this package.
#' \code{system.file("pccc_references", "Categories_of_CCCv2_and_Corresponding_ICD.docx", package = "pccc")}
#' have also been included with this package.
#'
#' @examples
#' \dontrun{
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on large datasets.
This package provides R functions to generate the CCC categories. Because the R functions
are built with a C++ back-end, they are very computationally efficient.

The pccc package version 1.0.z implimented this version of the PCCC criteria.
The pccc package version 1.0.z implemented this version of the PCCC criteria.

### Version 3 of the PCCC Criteria
[Pediatric Complex Chronic Condition System Version 3](https://jamanetwork.com/journals/jamanetworkopen/fullarticle/2821158)
Expand All @@ -49,7 +49,7 @@ match the system version) will implement version 3 of the PCCC.
## Installation

### From CRAN
Relased version available on The Comprehensive R Archive Network at https://CRAN.R-project.org/package=pccc.
Released version available on The Comprehensive R Archive Network at https://CRAN.R-project.org/package=pccc.

### Developmental version

Expand Down
19 changes: 11 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Version 1.0.6

## Notes:

* change in the email address of the package mantainer. The ucdenver.edu domain
as been replaced by the cuanzchutz.edu domain

## Test environments
* local macOS 10.14.6 install R 3.6.3
* ubuntu 16.04 on travis-ci (oldrel, release, devel)
* win-builder (devel, release, oldrelease)
* r_hub
* Ubuntu Linux 16.04 LTS, R-release, GCC
* Windows Server 2008 R2 SP1, R-devel, 32/64 bit
* Fedora Linux, R-devel, clang, gfortran
* Debian Linux, R-devel, GCC ASAN/UBSAN
* local macOS R 4.5.0
*
*
*

## R CMD check results

Expand Down
34 changes: 34 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Zhong
Wenjun
Cholera due to vibrio cholerae el tor
vctrs
rlang
ORCID
testthat
Urologic
stringsAsFactors
STATA
ICD
rda
rds
Feudtner
CCCs
CMD
CMS
cvd
CVD
Dai
CCC
ccc
BMC
Dingwei
docx
dplyr
github
icd
Kalibera
MCOD
AddressSanitizer
deprecations
Deprecations
dystrophy
Binary file added inst/icd/2017/2017-GEM-DC.zip
Binary file not shown.
Binary file not shown.
Binary file added inst/icd/2017/2017-ICD-10-CM-Guidelines.pdf
Binary file not shown.
Binary file added inst/icd/2017/2017-ICD10-Addendum.zip
Binary file not shown.
Binary file added inst/icd/2017/2017-ICD10-Code-Descriptions.zip
Binary file not shown.
Binary file added inst/icd/2017/2017-ICD10-Code-Tables-Index.zip
Binary file not shown.
Binary file added inst/icd/2017/2017-ICD10-Duplicate-Code-.zip
Binary file not shown.
Binary file added inst/icd/2017/2017-ICD10-POA-Exempt.zip
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added inst/icd/2018/2018-ICD-10-Addendum.zip
Binary file not shown.
Binary file not shown.
Binary file added inst/icd/2018/2018-ICD-10-CM-Conversion-Table.zip
Binary file not shown.
Binary file added inst/icd/2018/2018-ICD-10-CM-Errata.pdf
Binary file not shown.
Binary file not shown.
Binary file added inst/icd/2018/2018-ICD-10-Code-Descriptions.zip
Binary file not shown.
Binary file added inst/icd/2018/2018-ICD-10-Table-And-Index.zip
Binary file not shown.
Binary file added inst/icd/2018/2018-POA-Exempt-Codes.zip
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 3 additions & 3 deletions man/pccc-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/pccc_icd10_dataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pccc_icd9_dataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 34 additions & 6 deletions src/pccc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,26 @@ codes::codes(int v)
"74781","74789","9960","9961","99661","99662","V421","V422","V432","V433","V450","V4581",
"V533"};

dx_fixed_cvd = {"416"};
dx_fixed_cvd = {"416",
"99683" // transplant too
};

dx_respiratory = {"32725","4160","4162","51630","51631","51637","51884","5190","2770","748","7704","V426",
"V440","V4576","V460","V461","V550"};

dx_fixed_respiratory = {"5163"};
dx_fixed_respiratory = {"5163",
"99684" // transplant too
};

dx_renal = {"34461","585","5964","59653","59654","753","99668","V420","V445","V446",
dx_renal = {"34461","585","5964","59653","59654","753","99668",
"99681", //transplant
"V420","V445","V446",
"V451","V4573","V4574","V536","V555","V556","V56"};

dx_gi = {"4530","5364","555","556","5571","5602","5647","5714","5715","5716","5717",
"5718","5719","7503","751","V427","V4283","V4284","V441","V442","V443","V444","V5350",
"5718","5719","7503","751",
"99682", "99686", "99687", // transplant
"V427","V4283","V4284","V441","V442","V443","V444","V5350",
"V5351","V5359","V551","V552","V553","V554"};

dx_hemato_immu = {"042","043","044","135","279","2820","2821","2822","2823","2824","2825",
Expand Down Expand Up @@ -126,6 +134,25 @@ codes::codes(int v)
"T85190A","T85192A","T85199A","T8579XA","Z982","Z4541","Z4542", "Q851"};

dx_fixed_neuromusc = {"G80"};
// NOTE: G80 and G80.3 are listed in pccc/inst/pccc_references/Categories_of_CCCv2_and_Corresponding_ICD.docx
// However, it appears that during some dev work the following was
// determined for PCCC V2
// G80.0 -- include
// G80.1 -- include
// G80.2 -- exclude
// G80.3 -- include
// G80.4 -- include
// G80.5 -- (not a valid ICD code)
// G80.6 -- (not a valid ICD code)
// G80.7 -- (not a valid ICD code)
// G80.8 -- include
// G80.9 -- exclude
//
// For version 3, all the G80.x codes will be included
// See Supplement 3 from
// Feinstein JA, Hall M, Davidson A, Feudtner C. Pediatric Complex Chronic
// Condition System Version 3. JAMA Netw Open. 2024;7(7):e2420579.
// doi:10.1001/jamanetworkopen.2024.20579

dx_cvd = {"I270","I271","I272","I2781","I2789","I279","I340","I348","I360","I368","I370",
"I378","I42","I43","I44","I45","I47","I48","I490","I491","I493","I494","I495","I498","I499",
Expand All @@ -134,6 +161,7 @@ codes::codes(int v)
"Z951","T82519A","T82529A","T82539A","T82599A","T82110A","T82111A","T82120A","T82121A",
"T82190A","T82191A","T8201XA","T8202XA","T8203XA","T8209XA","T82211A","T82212A","T82213A",
"T82218A","T82221A","T82222A","T82223A","T82228A","T82518A","T82528A","T82538A","T82598A",
"T8620", "T8621", "T8622",
"T826XXA","T827XXA","Z941","Z950","Z952","Z95810","Z95811","Z95812","Z95818","Z953","Z45010",
"Z45018","Z4502","Z4509","Z959"};

Expand Down Expand Up @@ -163,7 +191,7 @@ codes::codes(int v)
"E830","E831","E833","E834","E88","H498","E85","E009","E230","E232","E222","E233","E237",
"E240","E242","E243","E248","E249","E2681","E250","E258","E259","Z4681","Z794","Z9641"};

dx_congeni_genetic = {"E343","K449","M410","M412","M4130","M418","M419","M4330","M965","Q722","Q750",
dx_congeni_genetic = {"E343","K449","M410","M412","M4130","M418","M419","M433","M965","Q722","Q750",
"Q752","Q759","Q760","Q761","Q762","Q764","Q765","Q766","Q767","Q77","Q780","Q781","Q782",
"Q783","Q784","Q788","Q789","Q790","Q791","Q792","Q793","Q794","Q799","Q795","Q8740","Q8781",
"Q8789","Q897","Q899","Q909","Q913","Q914","Q917","Q928","Q93","Q950","Q969","Q97","Q98",
Expand Down Expand Up @@ -195,7 +223,7 @@ codes::codes(int v)

dx_transplant = {"T8600","T8601","T8602","T8609","T8610","T8611","T8612","T8620","T8621","T8622",
"T86810","T86811","T86819","T8640","T8641","T8642","T86890","T86891","T86899","T86850",
"T86851","T86859","T865","T8690","T8691","T8692","T8699"};
"T86851","T86859","T865","T8690","T8691","T8692","T8699","Z940"};

pc_neuromusc = {"0016070","0016071","0016072","0016073","0016074","0016075","0016076","0016077",
"0016078","001607B","00160J0","00160J1","00160J2","00160J4","00160J5","00160J6","00160J7",
Expand Down
Binary file modified tests/icd10_test_result.rds
Binary file not shown.
Binary file modified tests/icd9_test_result.rds
Binary file not shown.
9 changes: 7 additions & 2 deletions tests/test_ccc_icd10.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ccc_out <- ccc(data.frame(id = letters[1:3],
ccc_out$id <- as.factor(ccc_out$id)
rnd_test <- readRDS("random_data_test_result.rds")
rnd_test$id <- as.factor(rnd_test$id)
stopifnot(all.equal(ccc_out, rnd_test))
stopifnot(isTRUE(all.equal(ccc_out, rnd_test)))


#test_that("icd 10 data set with all parameters - result should be unchanged.", {
Expand All @@ -33,5 +33,10 @@ df <-
pc_cols = dplyr::starts_with("pc"),
icdv = 10)

stopifnot(all.equal(df, readRDS("icd10_test_result.rds")))
expected <- readRDS("icd10_test_result.rds")

stopifnot(isTRUE(all.equal(df, expected)))

################################################################################
# End of File #
################################################################################
Loading