From 80f05d860b3e42447e7c8416e2ea48acf64858d4 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 6 Apr 2022 15:30:36 +0200
Subject: [PATCH 01/17] Rebuild README
---
README.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/README.md b/README.md
index cc0fc33..95d3cbb 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,9 @@ For instance, we could simulate ICD-10 codes:
``` r
# load the comorbidity package
library(comorbidity)
+## This is {comorbidity} version 1.0.2.
+## A lot has changed since the last release on CRAN, please check-out breaking changes here:
+## -> https://ellessenne.github.io/comorbidity/articles/C-changes.html
# set a seed for reproducibility
set.seed(1)
# simulate 50 ICD-10 codes for 5 individuals
From b4c11d6b75388c7955ae27067d09e9310ea8e558 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 6 Apr 2022 15:53:17 +0200
Subject: [PATCH 02/17] Tidied up NEWS, recompiled docs
---
NEWS.md | 2 +-
docs/articles/A-introduction.html | 3 +++
docs/articles/C-changes.html | 3 +++
docs/index.html | 3 +++
docs/news/index.html | 10 +++++-----
docs/pkgdown.yml | 2 +-
docs/search.json | 2 +-
7 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index cc7801d..7de9163 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,6 +1,6 @@
# comorbidity 1.0.2
-* The `copd` comorbidity for the Charlson index has been renamed to `cpd`, and the `ami` comorbidity for the Charlson index has been renamed to `mi` (#53, thanks @DrYan1102). Please be aware that this might break some old code if you were selecting comorbidities by name.
+* The `copd` and `ami` comorbidities for the Charlson index have been renamed to `cpd` and `mi`, respectively (#53, thanks @DrYan1102). Please be aware that this might break some old code if you were selecting comorbidities by name.
* New dataset: ICD10-CM, 2022 version, named `icd10cm_2022`.
diff --git a/docs/articles/A-introduction.html b/docs/articles/A-introduction.html
index cd1d1f7..05ac128 100644
--- a/docs/articles/A-introduction.html
+++ b/docs/articles/A-introduction.html
@@ -92,6 +92,9 @@
library(comorbidity)
+#> This is {comorbidity} version 1.0.2.
+#> A lot has changed since the last release on CRAN, please check-out breaking changes here:
+#> -> https://ellessenne.github.io/comorbidity/articles/C-changes.htmlset.seed(1)df<-data.frame(
diff --git a/docs/articles/C-changes.html b/docs/articles/C-changes.html
index 173e657..83a83be 100644
--- a/docs/articles/C-changes.html
+++ b/docs/articles/C-changes.html
@@ -96,6 +96,9 @@
2022-04-06
follows:
library(comorbidity)
+#> This is {comorbidity} version 1.0.2.
+#> A lot has changed since the last release on CRAN, please check-out breaking changes here:
+#> -> https://ellessenne.github.io/comorbidity/articles/C-changes.htmlset.seed(2837465)
diff --git a/docs/index.html b/docs/index.html
index 60dd85b..72da9e9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -114,6 +114,9 @@
Simulating ICD-10 codes
# load the comorbidity packagelibrary(comorbidity)
+## This is {comorbidity} version 1.0.2.
+## A lot has changed since the last release on CRAN, please check-out breaking changes here:
+## -> https://ellessenne.github.io/comorbidity/articles/C-changes.html# set a seed for reproducibilityset.seed(1)# simulate 50 ICD-10 codes for 5 individuals
diff --git a/docs/news/index.html b/docs/news/index.html
index 448536f..4129bc6 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -54,11 +54,11 @@
comorbidity 1.0.2
-
The copd comorbidity for the Charlson index has been
-renamed to cpd, and the ami comorbidity for
-the Charlson index has been renamed to mi (#53, thanks
-@DrYan1102). Please be aware that this might break some old code if you
-were selecting comorbidities by name.
+
The copd and ami comorbidities for the
+Charlson index have been renamed to cpd and
+mi, respectively (#53, thanks @DrYan1102). Please be aware
+that this might break some old code if you were selecting comorbidities
+by name.
New dataset: ICD10-CM, 2022 version, named
icd10cm_2022.
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index f8bd5f6..fe5440a 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -5,7 +5,7 @@ articles:
A-introduction: A-introduction.html
B-comorbidity-scores: B-comorbidity-scores.html
C-changes: C-changes.html
-last_built: 2022-04-06T12:55Z
+last_built: 2022-04-06T13:47Z
urls:
reference: https://ellessenne.github.io/comorbidity/reference
article: https://ellessenne.github.io/comorbidity/articles
diff --git a/docs/search.json b/docs/search.json
index b26bc83..8dfc87b 100644
--- a/docs/search.json
+++ b/docs/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"interest fostering open welcoming environment, contributors maintainers pledge making participation project community harassment-free experience everyone, regardless age, body size, disability, ethnicity, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes creating positive environment include: Using welcoming inclusive language respectful differing viewpoints experiences Gracefully accepting constructive criticism Focusing best community Showing empathy towards community members Examples unacceptable behavior participants include: use sexualized language imagery unwelcome sexual attention advances Trolling, insulting/derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical electronic address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"our-responsibilities","dir":"","previous_headings":"","what":"Our Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Project maintainers responsible clarifying standards acceptable behavior expected take appropriate fair corrective action response instances unacceptable behavior. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, ban temporarily permanently contributor behaviors deem inappropriate, threatening, offensive, harmful.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within project spaces public spaces individual representing project community. Examples representing project community include using official project e-mail address, posting via official social media account, acting appointed representative online offline event. Representation project may defined clarified project maintainers.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported contacting project team [INSERT EMAIL ADDRESS]. complaints reviewed investigated result response deemed necessary appropriate circumstances. project team obligated maintain confidentiality regard reporter incident. details specific enforcement policies may posted separately. Project maintainers follow enforce Code Conduct good faith may face temporary permanent repercussions determined members project’s leadership.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 1.4, available https://www.contributor-covenant.org/version/1/4/code--conduct.html","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing","title":"Contributing","text":"want contribute project make better, help welcome. small, simple changes fixing typos can edit file directly GitHub clicking Edit button opening . complicated changes, manually create pull request (PR) forking repository. See next section information. submit non-trivial pull request (e.g. just fixing typo), may add name Authors@R field contributor (ctb) R package DESCRIPTION file wish.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONTRIBUTING.html","id":"pull-request-workflow","dir":"","previous_headings":"","what":"Pull Request Workflow","title":"Contributing","text":"Create personal fork project Github, clone fork local machine; Create new branch work ; Implement/fix feature, comment code; Follow code style project, including indentation; Run tests using devtools: devtools::test(); Write adapt tests needed; Add change documentation needed. Please run roxygen2, include changes .Rd files pull request - re-roxygenise documentation ; Push branch fork Github; fork open pull request correct branch. step--step workflow adapted https://github.com/MarcDiethelm/contributing. Working first Pull Request? can learn free series Contribute Open Source Project GitHub.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing","text":"contributing project agree adhere Contributors Code Conduct: please read CONDUCT.md proposing change.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/A-introduction.html","id":"mapping-comorbidities","dir":"Articles","previous_headings":"","what":"Mapping Comorbidities","title":"Introduction","text":"comorbidity() function can used apply mapping algorithms dataset. , instance, use Quan et al. (2005) version Charlson Comorbidity Index: resulting data frame row per subject, column IDs, column condition included given score (e.g. 17 conditions Charlson score). different columns also labelled compatibility RStudio viewer, see e.g. View(charlson_df) running code computer. see supported mapping algorithms, please see vignette:","code":"charlson_df <- comorbidity( x = df, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE ) str(charlson_df) #> Classes 'comorbidity' and 'data.frame': 100 obs. of 18 variables: #> $ id : int 1 2 3 4 5 6 7 8 9 10 ... #> $ mi : int 0 0 0 0 0 0 0 0 0 0 ... #> $ chf : int 0 1 1 0 0 1 1 0 1 1 ... #> $ pvd : int 0 0 0 0 0 0 0 0 0 0 ... #> $ cevd : int 0 0 0 0 0 0 0 0 0 0 ... #> $ dementia: int 0 0 0 0 0 0 0 0 0 0 ... #> $ cpd : int 1 1 1 1 0 0 1 1 1 1 ... #> $ rheumd : int 0 0 0 0 0 0 0 0 0 0 ... #> $ pud : int 0 0 0 0 0 0 0 0 0 0 ... #> $ mld : int 0 0 0 0 0 0 0 0 0 0 ... #> $ diab : int 0 0 0 0 0 0 0 0 0 0 ... #> $ diabwc : int 1 0 1 1 1 1 1 1 1 1 ... #> $ hp : int 0 0 0 0 0 0 0 0 0 0 ... #> $ rend : int 0 0 0 0 0 0 0 0 0 0 ... #> $ canc : int 1 1 1 1 1 1 1 1 1 1 ... #> $ msld : int 0 0 0 0 0 0 0 0 0 0 ... #> $ metacanc: int 0 0 0 0 0 0 0 0 0 0 ... #> $ aids : int 0 0 0 0 0 0 0 0 0 0 ... #> - attr(*, \"variable.labels\")= chr [1:18] \"ID\" \"Myocardial infarction\" \"Congestive heart failure\" \"Peripheral vascular disease\" ... #> - attr(*, \"map\")= chr \"charlson_icd10_quan\" length(unique(df$id)) == nrow(charlson_df) #> [1] TRUE vignette(\"02-comorbidityscores\", package = \"comorbidity\")"},{"path":"https://ellessenne.github.io/comorbidity/articles/A-introduction.html","id":"comorbidity-scores","dir":"Articles","previous_headings":"","what":"Comorbidity Scores","title":"Introduction","text":"calculating data frame comorbid conditions, can used calculate comorbidity scores using score() function. Say want calculate Charlson comorbidity score, weighted using Quan et al. (2011) weights: returns single value per subject: pure combination conditions required (e.g. unweighted score), pass NULL value weights argument score() function: , available weighting systems/algorithms described vignette mentioned .","code":"quan_cci <- score(x = charlson_df, weights = \"quan\", assign0 = FALSE) table(quan_cci) #> quan_cci #> 2 3 4 5 6 #> 7 18 20 30 25 length(quan_cci) == nrow(charlson_df) #> [1] TRUE unw_cci <- score(x = charlson_df, weights = NULL, assign0 = FALSE) table(unw_cci) #> unw_cci #> 1 2 3 4 #> 7 25 43 25"},{"path":"https://ellessenne.github.io/comorbidity/articles/A-introduction.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Introduction","text":"Charlson et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. DOI: 10.1016/0021-9681(87)90171-8 Quan H et al. Coding algorithms defining comorbidities ICD-9-CM ICD-10 administrative data. Medical Care 2005; 43(11):1130-1139. DOI: 10.1097/01.mlr.0000182534.19832.83 Quan H et al. Updating validating Charlson Comorbidity Index score risk adjustment hospital discharge abstracts using data 6 countries. American Journal Epidemiology 2011;173(6):676-82. DOI: 10.1093/aje/kwq433","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/B-comorbidity-scores.html","id":"supported-mapping-algorithms","dir":"Articles","previous_headings":"","what":"Supported Mapping Algorithms","title":"Supported Comorbidity Mappings and Scores","text":"{comorbidity} package can apply comorbidity mappings corresponding Charlson Elixhauser comorbidity scores. ICD-9 ICD-10 coding systems supported, algorithms described paper Quan et al. (2005). resulting mapping algorithms denoted charlson_icd9_quan charlson_icd10_quan Charlson score (based ICD-9 ICD-10 systems, respectively), elixhauser_icd9_quan elixhauser_icd10_quan Elixhauser score. Furthermore, Swedish (Ludvigsson et al., 2021) Australian (Sundararajan et al., 2004) modifications Charlson score implemented well, identified charlson_icd10_se charlson_icd10_am respectively.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/B-comorbidity-scores.html","id":"supported-weighting-algorithms","dir":"Articles","previous_headings":"","what":"Supported Weighting Algorithms","title":"Supported Comorbidity Mappings and Scores","text":"Different weighting algorithms proposed combine different conditions single measure, Charlson Elixhauser index. Currently, following weighting algorithms supported Charlson score: original weights Charlson et al. (1987), denoted charlson; Updated weights Quan et al. (2011), denoted quan. , Elixhauser score: Weights proposed van Walraven et al. (2009), denoted vw; Swiss weights modification Sharma et al. (2021), denoted swiss.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/B-comorbidity-scores.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Supported Comorbidity Mappings and Scores","text":"Charlson et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. DOI: 10.1016/0021-9681(87)90171-8 Elixhauser et al. Comorbidity measures use administrative data. Medical Care 1998; 36(1):8-27. DOI: 10.1097/00005650-199801000-00004 Ludvigsson JF et al. Adaptation Charlson Comorbidity Index register-based research Sweden. Clinical Epidemiology 2021; 13:21–41. DOI: 10.2147/clep.s282475 Quan H et al. Coding algorithms defining comorbidities ICD-9-CM ICD-10 administrative data. Medical Care 2005; 43(11):1130-1139. DOI: 10.1097/01.mlr.0000182534.19832.83 Quan H et al. Updating validating Charlson Comorbidity Index score risk adjustment hospital discharge abstracts using data 6 countries. American Journal Epidemiology 2011;173(6):676-82. DOI: 10.1093/aje/kwq433 Sharma N et al. Comparing Charlson Elixhauser comorbidity indices different weightings predict -hospital mortality: analysis national inpatient data. BMC Health Services Research 2021; 21(1). DOI: 10.1186/s12913-020-05999-5 Sundararajan V et al. New ICD-10 version Charlson comorbidity index predicted -hospital mortality. Journal Clinical Epidemiology 2004; 57(12):1288-1294. DOI: 10.1016/j.jclinepi.2004.03.012 van Walraven C, Austin PC, Jennings , Quan H Forster AJ. modification Elixhauser comorbidity measures point system hospital death using administrative data. Medical Care 2009; 47(6):626-633. DOI: 10.1097/MLR.0b013e31819432e5","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"comorbidity-mapping-and-scoring-are-now-distinct-functions","dir":"Articles","previous_headings":"","what":"Comorbidity Mapping and Scoring are Now Distinct Functions","title":"Updating to {comorbidity} 1.0.0","text":"previous release {comorbidity}, comorbidity mapping scoring algorithms applied jointly single function call: Now, first need apply mapping algorithm: …yields results shown . , need calculate comorbidity scores, can use score() function: yields unweighted scores (e.g. equivalent score column ). need weighted scores (e.g. wscore column , assumes old Charlson score weights 1987), can pass name supported scoring algorithm: , results score() function equivalent obtained using previously-released version.","code":"comorbidity(x = sim_data, id = \"id\", code = \"code\", score = \"charlson\", icd = \"icd10\", assign0 = FALSE) #> id ami chf pvd cevd dementia copd rheumd pud mld diab diabwc hp rend canc #> 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 #> 2 2 0 0 0 0 0 0 0 0 0 1 1 0 0 1 #> 3 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 #> 4 4 0 0 0 1 0 0 0 0 0 0 0 0 0 1 #> 5 5 0 0 0 0 0 0 0 0 0 1 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 0 0 0 0 0 0 0 0 0 0 0 0 1 1 #> 8 8 0 0 0 1 0 0 1 0 0 1 1 0 0 1 #> 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 1 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 #> msld metacanc aids score index wscore windex #> 1 0 0 0 2 1-2 4 3-4 #> 2 0 0 0 3 3-4 5 >=5 #> 3 0 0 0 1 1-2 1 1-2 #> 4 0 0 0 2 1-2 3 3-4 #> 5 0 0 0 1 1-2 1 1-2 #> 6 0 0 0 0 0 0 0 #> 7 0 0 0 2 1-2 4 3-4 #> 8 0 0 0 5 >=5 7 >=5 #> 9 0 0 0 1 1-2 2 1-2 #> 10 0 0 0 1 1-2 2 1-2 com <- comorbidity(x = sim_data, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) com #> id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld #> 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 #> 2 2 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 #> 3 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 #> 4 4 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 #> 5 5 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 #> 8 8 0 0 0 1 0 0 1 0 0 1 1 0 0 1 0 #> 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> metacanc aids #> 1 0 0 #> 2 0 0 #> 3 0 0 #> 4 0 0 #> 5 0 0 #> 6 0 0 #> 7 0 0 #> 8 0 0 #> 9 0 0 #> 10 0 0 score(com, assign0 = FALSE, weights = NULL) #> [1] 2 3 1 2 1 0 2 5 1 1 #> attr(,\"map\") #> [1] \"charlson_icd10_quan\" score(com, assign0 = FALSE, weights = \"charlson\") #> [1] 4 5 1 3 1 0 4 7 2 2 #> attr(,\"map\") #> [1] \"charlson_icd10_quan\" #> attr(,\"weights\") #> [1] \"charlson\""},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"supported-mapping-and-scoring-algorithms","dir":"Articles","previous_headings":"","what":"Supported Mapping and Scoring Algorithms","title":"Updating to {comorbidity} 1.0.0","text":"new version includes updated comorbidity mapping scoring algorithms. Furthermore, designed way simplify addition new scores future. currently supported comorbidity mapping algorithms described following vignette: Alternatively, new function provided display supported algorithms R console: picked auto-magically internal data structures, always --date.","code":"vignette(\"02-comorbidityscores\", package = \"comorbidity\") available_algorithms() #> Supported comorbidity mapping algorithms: #> * charlson_icd9_quan #> * charlson_icd10_quan #> * charlson_icd10_se #> * charlson_icd10_am #> * elixhauser_icd9_quan #> * elixhauser_icd10_quan #> #> Supported scoring weights algorithms: #> * For charlson_icd9_quan: charlson, quan #> * For charlson_icd10_quan: charlson, quan #> * For charlson_icd10_se: charlson, quan #> * For charlson_icd10_am: charlson, quan #> * For elixhauser_icd9_quan: vw, swiss #> * For elixhauser_icd10_quan: vw, swiss"},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"computational-speed","dir":"Articles","previous_headings":"","what":"Computational Speed","title":"Updating to {comorbidity} 1.0.0","text":"internal re-writing package API allowed optimising code speed efficiency. managed estimate, using simulated data, main comorbidity mapping function (e.g. comorbidity()) approximately twice fast version 0.5.3, across variety sample sizes: main computational bottleneck, applying scoring algorithm fast general.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"reverting-to-previous-release","dir":"Articles","previous_headings":"","what":"Reverting to previous release","title":"Updating to {comorbidity} 1.0.0","text":"understand new release might break workflows, apologies . feedback, please feel free e-mail maintainer package open issue GitHub, latter strongly suggested. Finally, required, can revert previous release installing GitHub:","code":"library(remotes) remotes::install_github(\"ellessenne/comorbidity@0.5.3\")"},{"path":"https://ellessenne.github.io/comorbidity/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Alessandro Gasparini. Author, maintainer. Hojjat Salmasian. Contributor. ICD-9-CM scores Jonathan Williman. Contributor. Sing Yi Chia. Contributor. Edmund Teo. Contributor.","code":""},{"path":"https://ellessenne.github.io/comorbidity/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Gasparini, (2018). comorbidity: R package computing comorbidity scores. Journal Open Source Software, 3(23), 648, https://doi.org/10.21105/joss.00648","code":"@Article{, author = {Alessandro Gasparini}, title = {comorbidity: An R package for computing comorbidity scores}, journal = {Journal of Open Source Software}, year = {2018}, volume = {3}, issue = {23}, pages = {648}, doi = {10.21105/joss.00648}, url = {https://doi.org/10.21105/joss.00648}, }"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"the-comorbidity-package-computing-comorbidity-scores-","dir":"","previous_headings":"","what":"Computing Comorbidity Scores","title":"Computing Comorbidity Scores","text":"Last updated: 2022-04-06 comorbidity R package computing comorbidity scores weighted Charlson score Elixhauser comorbidity score; ICD-10 ICD-9 coding systems supported.","code":""},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Computing Comorbidity Scores","text":"comorbidity CRAN. can install usual : Alternatively, can install development version GitHub :","code":"install.packages(\"comorbidity\") # install.packages(\"remotes\") remotes::install_github(\"ellessenne/comorbidity\")"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"simulating-icd-10-codes","dir":"","previous_headings":"","what":"Simulating ICD-10 codes","title":"Computing Comorbidity Scores","text":"comorbidity packages includes function named sample_diag() allows simulating ICD diagnostic codes straightforward way. instance, simulate ICD-10 codes: also possible simulate two different versions ICD-10 coding system. default simulate ICD-10 codes 2011 version: Alternatively, use 2009 version:","code":"# load the comorbidity package library(comorbidity) # set a seed for reproducibility set.seed(1) # simulate 50 ICD-10 codes for 5 individuals x <- data.frame( id = sample(1:5, size = 50, replace = TRUE), code = sample_diag(n = 50) ) x <- x[order(x$id, x$code), ] print(head(x, n = 15), row.names = FALSE) ## id code ## 1 B02 ## 1 B582 ## 1 I749 ## 1 J450 ## 1 L893 ## 1 Q113 ## 1 Q26 ## 1 Q978 ## 1 T224 ## 1 V101 ## 1 V244 ## 1 V46 ## 2 A665 ## 2 C843 ## 2 D838 set.seed(1) x1 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30) ) set.seed(1) x2 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD10_2011\") ) # should return TRUE all.equal(x1, x2) ## [1] TRUE set.seed(1) x1 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD10_2009\") ) set.seed(1) x2 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD10_2011\") ) # should not return TRUE all.equal(x1, x2) ## [1] \"Component \\\"code\\\": 30 string mismatches\""},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"simulating-icd-9-codes","dir":"","previous_headings":"","what":"Simulating ICD-9 codes","title":"Computing Comorbidity Scores","text":"ICD-9 codes can easily simulated :","code":"set.seed(2) x9 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD9_2015\") ) x9 <- x9[order(x9$id, x9$code), ] print(head(x9, n = 15), row.names = FALSE) ## id code ## 1 01130 ## 1 01780 ## 1 30151 ## 1 3073 ## 1 36907 ## 1 37845 ## 1 64212 ## 1 66704 ## 1 72633 ## 1 9689 ## 1 V289 ## 2 0502 ## 2 09169 ## 2 20046 ## 2 25082"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"computing-comorbidity-scores","dir":"","previous_headings":"","what":"Computing comorbidity scores","title":"Computing Comorbidity Scores","text":"main function comorbidity package named comorbidity(), can used compute supported comorbidity score; scores can specified setting score argument, required. Say 3 individuals total 30 ICD-10 diagnostic codes: compute Charlson comorbidity domains: set assign0 argument FALSE apply hierarchy comorbidity codes, described ?comorbidity::comorbidity. Alternatively, compute Elixhauser score: Weighted unweighted comorbidity scores can obtained using score() function: Code Elixhauser score omitted, works analogously. Conversely, say 5 individuals total 100 ICD-9 diagnostic codes: Charlson Elixhauser comorbidity codes can easily computed : Scores:","code":"set.seed(1) x <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30) ) charlson <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) charlson ## id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld metacanc aids ## 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 ## 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 ## 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 elixhauser <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd10_quan\", assign0 = FALSE) elixhauser ## id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf ld pud aids lymph ## 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ## 2 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 3 3 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ## metacanc solidtum rheumd coag obes wloss fed blane dane alcohol drug psycho depre ## 1 0 1 0 0 0 0 0 0 0 0 0 0 0 ## 2 0 1 0 0 0 0 0 0 0 0 0 0 0 ## 3 0 0 0 0 0 0 0 0 0 0 0 0 0 unw_cci <- score(charlson, weights = NULL, assign0 = FALSE) unw_cci ## [1] 2 1 0 ## attr(,\"map\") ## [1] \"charlson_icd10_quan\" quan_cci <- score(charlson, weights = \"quan\", assign0 = FALSE) quan_cci ## [1] 6 2 0 ## attr(,\"map\") ## [1] \"charlson_icd10_quan\" ## attr(,\"weights\") ## [1] \"quan\" all.equal(unw_cci, quan_cci) ## [1] \"Attributes: < Length mismatch: comparison on first 1 components >\" ## [2] \"Mean relative difference: 1.666667\" set.seed(3) x <- data.frame( id = sample(1:5, size = 100, replace = TRUE), code = sample_diag(n = 100, version = \"ICD9_2015\") ) charlson9 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd9_quan\", assign0 = FALSE) charlson9 ## id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld metacanc aids ## 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 ## 2 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 3 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ## 4 4 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 ## 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 elixhauser9 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd9_quan\", assign0 = FALSE) elixhauser9 ## id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf ld pud aids lymph ## 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 2 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ## 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 4 4 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## metacanc solidtum rheumd coag obes wloss fed blane dane alcohol drug psycho depre ## 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 2 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 3 0 0 0 0 0 0 0 0 0 0 0 1 0 ## 4 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 5 0 0 1 0 0 0 0 0 0 0 0 0 0 unw_eci <- score(elixhauser9, weights = NULL, assign0 = FALSE) vw_eci <- score(elixhauser9, weights = \"vw\", assign0 = FALSE) all.equal(unw_eci, vw_eci) ## [1] \"Attributes: < Length mismatch: comparison on first 1 components >\" ## [2] \"Mean relative difference: 2\""},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Computing Comorbidity Scores","text":"find comorbidity useful, please cite publications:","code":"citation(\"comorbidity\") ## ## To cite the comorbidity package in publications, please use: ## ## Gasparini, (2018). comorbidity: An R package for computing comorbidity scores. Journal ## of Open Source Software, 3(23), 648, https://doi.org/10.21105/joss.00648 ## ## A BibTeX entry for LaTeX users is ## ## @Article{, ## author = {Alessandro Gasparini}, ## title = {comorbidity: An R package for computing comorbidity scores}, ## journal = {Journal of Open Source Software}, ## year = {2018}, ## volume = {3}, ## issue = {23}, ## pages = {648}, ## doi = {10.21105/joss.00648}, ## url = {https://doi.org/10.21105/joss.00648}, ## }"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Computing Comorbidity Scores","text":"details comorbidity mapping scoring algorithm available within package can found two accompanying vignettes, can accessed CRAN directly R session:","code":"vignette(\"01-introduction\", package = \"comorbidity\") vignette(\"02-comorbidity-scores\", package = \"comorbidity\")"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"copyright","dir":"","previous_headings":"","what":"Copyright","title":"Computing Comorbidity Scores","text":"icon hex sticker made monkik www.flaticon.com, licensed Creative Commons 3.0.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":null,"dir":"Reference","previous_headings":"","what":"Australian mortality data, 2010 — australia10","title":"Australian mortality data, 2010 — australia10","text":"dataset containing Australian mortality data, obtained Stata 17.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Australian mortality data, 2010 — australia10","text":"","code":"australia10"},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Australian mortality data, 2010 — australia10","text":"data frame 3,322 rows 3 variables: cause ICD-10 code representing cause death sex Gender deaths Number deaths","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Australian mortality data, 2010 — australia10","text":"R code used download process dataset Stata available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/available_algorithms.html","id":null,"dir":"Reference","previous_headings":"","what":"Display Currently Supported Algorithms — available_algorithms","title":"Display Currently Supported Algorithms — available_algorithms","text":"function prints (currently) supported implemented comorbidity mapping, one , supported scoring weighting algorithm.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/available_algorithms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display Currently Supported Algorithms — available_algorithms","text":"","code":"available_algorithms()"},{"path":"https://ellessenne.github.io/comorbidity/reference/available_algorithms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display Currently Supported Algorithms — available_algorithms","text":"","code":"available_algorithms() #> Supported comorbidity mapping algorithms: #> \t* charlson_icd9_quan #> \t* charlson_icd10_quan #> \t* charlson_icd10_se #> \t* charlson_icd10_am #> \t* elixhauser_icd9_quan #> \t* elixhauser_icd10_quan #> #> Supported scoring weights algorithms: #> \t* For charlson_icd9_quan: charlson, quan #> \t* For charlson_icd10_quan: charlson, quan #> \t* For charlson_icd10_se: charlson, quan #> \t* For charlson_icd10_am: charlson, quan #> \t* For elixhauser_icd9_quan: vw, swiss #> \t* For elixhauser_icd10_quan: vw, swiss"},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Computing Comorbidity Scores — comorbidity-package","title":"Computing Comorbidity Scores — comorbidity-package","text":"Computing comorbidity scores weighted Charlson score (Charlson, 1987 doi: 10.1016/0021-9681(87)90171-8 ) Elixhauser comorbidity score (Elixhauser, 1998 doi: 10.1097/00005650-199801000-00004 ) using ICD-9-CM ICD-10 codes (Quan, 2005 doi: 10.1097/01.mlr.0000182534.19832.83 ).","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Computing Comorbidity Scores — comorbidity-package","text":"Alessandro Gasparini (alessandro.gasparini@ki.se)","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":null,"dir":"Reference","previous_headings":"","what":"Comorbidity mapping. — comorbidity","title":"Comorbidity mapping. — comorbidity","text":"Maps comorbidity conditions using algorithms Charlson Elixhauser comorbidity scores.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Comorbidity mapping. — comorbidity","text":"","code":"comorbidity(x, id, code, map, assign0, labelled = TRUE, tidy.codes = TRUE)"},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Comorbidity mapping. — comorbidity","text":"x tidy data.frame (data.table; tibbles supported ) one column containing individual ID column containing diagnostic codes. Extra columns ID codes discarded. Column names must syntactically valid names, otherwise forced calling make.names() function. id Column x containing individual ID. code Column x containing diagnostic codes. Codes must upper case punctuation order properly recognised. map mapping algorithm used (values case-insensitive). Possible values Charlson score either ICD-10 ICD-9-CM codes (charlson_icd10_quan, charlson_icd9_quan) Elixhauser score, using either ICD-10 ICD-9-CM (elixhauser_icd10_quan, elixhauser_icd9_quan). mapping based paper Quan et al. (2011). also possible obtain Swedish (charlson_icd10_se) Australian (charlson_icd10_am) modification Charlson score using ICD-10 codes. assign0 Apply hierarchy comorbidities: comorbidity present patient different degrees severity, milder form assigned value 0. , type comorbidity counted patient. comorbidities affected argument : \"Mild liver disease\" (mld) \"Moderate/severe liver disease\" (msld) Charlson score; \"Diabetes\" (diab) \"Diabetes complications\" (diabwc) Charlson score; \"Cancer\" (canc) \"Metastatic solid tumour\" (metacanc) Charlson score; \"Hypertension, uncomplicated\" (hypunc) \"Hypertension, complicated\" (hypc) Elixhauser score; \"Diabetes, uncomplicated\" (diabunc) \"Diabetes, complicated\" (diabc) Elixhauser score; \"Solid tumour\" (solidtum) \"Metastatic cancer\" (metacanc) Elixhauser score. labelled Attach labels comorbidity, compatible RStudio viewer via utils::View() function. Defaults TRUE. tidy.codes Tidy diagnostic codes? TRUE, codes converted upper case non-alphanumeric characters removed using regular expression [^[:alnum:]]. Defaults TRUE.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Comorbidity mapping. — comorbidity","text":"data frame id, columns relative comorbidity domain, comorbidity score, weighted comorbidity score, categorisations scores, one row per individual. Charlson score, following variables included dataset: id variable defined user; mi, myocardial infarction; chf, congestive heart failure; pvd, peripheral vascular disease; cevd, cerebrovascular disease; dementia, dementia; cpd, chronic pulmonary disease; rheumd, rheumatoid disease; pud, peptic ulcer disease; mld, mild liver disease; diab, diabetes without complications; diabwc, diabetes complications; hp, hemiplegia paraplegia; rend, renal disease; canc, cancer (malignancy); msld, moderate severe liver disease; metacanc, metastatic solid tumour; aids, AIDS/HIV. Please note combine \"chronic obstructive pulmonary disease\" \"chronic pulmonary disease\" Swedish version Charlson index, comparability (compatibility) definitions/implementations. Conversely, Elixhauser score dataset contains following variables: id variable defined user; chf, congestive heart failure; carit, cardiac arrhythmias; valv, valvular disease; pcd, pulmonary circulation disorders; pvd, peripheral vascular disorders; hypunc, hypertension, uncomplicated; hypc, hypertension, complicated; para, paralysis; ond, neurological disorders; cpd, chronic pulmonary disease; diabunc, diabetes, uncomplicated; diabc, diabetes, complicated; hypothy, hypothyroidism; rf, renal failure; ld, liver disease; pud, peptic ulcer disease, excluding bleeding; aids, AIDS/HIV; lymph, lymphoma; metacanc, metastatic cancer; solidtum, solid tumour, without metastasis; rheumd, rheumatoid arthritis/collaged vascular disease; coag, coagulopathy; obes, obesity; wloss, weight loss; fed, fluid electrolyte disorders; blane, blood loss anaemia; dane, deficiency anaemia; alcohol, alcohol abuse; drug, drug abuse; psycho, psychoses; depre, depression; Labels presented user using RStudio viewer (e.g. via utils::View() function) convenience.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Comorbidity mapping. — comorbidity","text":"ICD-10 ICD-9-CM coding Charlson Elixhauser scores based work Quan et al. (2005). ICD-10 ICD-9 codes must upper case alphanumeric characters order properly recognised; set tidy.codes = TRUE properly tidy codes automatically. message printed R console non-alphanumeric characters found.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Comorbidity mapping. — comorbidity","text":"Quan H, Sundararajan V, Halfon P, Fong , Burnand B, Luthi JC, et al. Coding algorithms defining comorbidities ICD-9-CM ICD-10 administrative data. Medical Care 2005; 43(11):1130-1139. Charlson , Pompei P, Ales KL, et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. Ludvigsson JF, Appelros P, Askling J et al. Adaptation Charlson Comorbidity Index register-based research Sweden. Clinical Epidemiology 2021; 13:21-41. Sundararajan V, Henderson T, Perry C, Muggivan , Quan H, Ghali WA. New ICD-10 version Charlson comorbidity index predicted -hospital mortality. Journal Clinical Epidemiology 2004; 57(12):1288-1294.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Comorbidity mapping. — comorbidity","text":"","code":"set.seed(1) x <- data.frame( id = sample(1:15, size = 200, replace = TRUE), code = sample_diag(200), stringsAsFactors = FALSE ) # Charlson score based on ICD-10 diagnostic codes: comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) #> id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld #> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 #> 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 9 9 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 13 13 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 #> 14 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> metacanc aids #> 1 0 0 #> 2 0 1 #> 3 0 0 #> 4 0 0 #> 5 0 0 #> 6 0 0 #> 7 0 0 #> 8 0 0 #> 9 0 0 #> 10 0 0 #> 11 0 0 #> 12 0 0 #> 13 0 0 #> 14 0 0 #> 15 0 0 # Elixhauser score based on ICD-10 diagnostic codes: comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd10_quan\", assign0 = FALSE) #> id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf #> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 2 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 #> 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 1 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 12 12 0 0 0 0 0 0 0 0 1 0 0 0 0 0 #> 13 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 14 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> ld pud aids lymph metacanc solidtum rheumd coag obes wloss fed blane dane #> 1 0 0 0 0 0 1 0 0 0 0 0 0 0 #> 2 0 0 1 0 0 0 0 0 0 0 0 0 0 #> 3 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 4 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 5 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 6 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 1 0 0 0 0 1 0 0 0 0 0 0 0 #> 8 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 9 0 0 0 0 0 1 1 0 0 0 0 0 0 #> 10 0 0 0 0 0 1 0 0 0 0 0 0 0 #> 11 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 12 0 0 0 0 0 0 0 1 0 0 0 0 0 #> 13 0 1 0 0 0 1 0 0 0 0 0 0 0 #> 14 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 15 0 0 0 0 0 1 0 0 0 0 0 0 0 #> alcohol drug psycho depre #> 1 0 0 0 0 #> 2 0 0 0 0 #> 3 0 0 0 0 #> 4 0 0 0 0 #> 5 0 0 0 0 #> 6 0 0 0 0 #> 7 1 0 0 0 #> 8 0 0 0 0 #> 9 0 0 0 0 #> 10 0 0 0 0 #> 11 0 0 0 0 #> 12 0 1 1 0 #> 13 0 0 0 0 #> 14 0 0 0 0 #> 15 0 0 0 0"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"dataset containing 2009 version ICD-10 codes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"","code":"icd10_2009"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"data frame 10,817 rows 4 variables: Code ICD-10 diagnostic code Code.clean ICD-10 diagnostic code, removing punctuation ICD.title Code description, plain English. Status Additional information, available.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"CDC Website: https://goo.gl/6e2mvb","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"dataset containing 2011 version ICD-10 codes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"","code":"icd10_2011"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"data frame 10,856 rows 4 variables: Code ICD-10 diagnostic code Code.clean ICD-10 diagnostic code, removing punctuation ICD.title Code description, plain English. Status Additional information, available.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"CDC Website: https://goo.gl/rcTJJ2","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"dataset containing 2017 version ICD10-CM coding system.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"","code":"icd10cm_2017"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"data frame 71,486 rows 2 variables: Code ICD-10-CM diagnostic code Description Description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"dataset containing 2018 version ICD10-CM coding system.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"","code":"icd10cm_2018"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"data frame 71,704 rows 2 variables: Code ICD-10-CM diagnostic code Description Description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"dataset containing 2022 version ICD10-CM coding system.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"","code":"icd10cm_2022"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"data frame 72,750 rows 2 variables: Code ICD-10-CM diagnostic code Description Description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"dataset containing version ICD-9 codes effective October 1, 2014.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"","code":"icd9_2015"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"data frame 14,567 rows 3 variables: Code ICD-9 diagnostic code Long_description Long description code Short_description Short description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"CMS.gov Website: https://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"R code used download process dataset CMS.gov website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":null,"dir":"Reference","previous_headings":"","what":"Adult same-day discharges, 2010 — nhds2010","title":"Adult same-day discharges, 2010 — nhds2010","text":"dataset containing adult -day discharges 2010, obtained Stata 17.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adult same-day discharges, 2010 — nhds2010","text":"","code":"nhds2010"},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Adult same-day discharges, 2010 — nhds2010","text":"data frame 2,210 rows 15 variables: ageu Units age age Age sex Sex race Race month Discharge month status Discharge status region Region atype Type admission dx1 Diagnosis 1, ICD9-CM dx2 Diagnosis 2, ICD9-CM dx3 Diagnosis 3, ICD9-CM, imported incorrectly dx3corr Diagnosis 3, ICD9-CM, corrected pr1 Procedure 1 wgt Frequency weight recid Order record (raw data)","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Adult same-day discharges, 2010 — nhds2010","text":"R code used download process dataset Stata available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"simple function simulate ICD-10 ICD-9 diagnostic codes random.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"","code":"sample_diag(n = 1, version = \"ICD10_2011\")"},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"n Number ICD codes simulate. version version ICD coding scheme use. Possible choices ICD10_2009, ICD10_2011, ICD9_2015; defaults ICD10_2011. See icd10_2009, icd10_2011, icd9_2015 information different schemes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"vector n ICD diagnostic codes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"","code":"# Simulate 10 ICD-10 codes sample_diag(10) #> [1] \"D682\" \"R454\" \"G308\" \"R90\" \"N350\" \"S064\" \"V435\" \"V795\" \"M356\" \"R073\" # Simulate a tidy dataset with 15 individuals and 200 rows set.seed(1) x <- data.frame( id = sample(1:15, size = 200, replace = TRUE), code = sample_diag(n = 200), stringsAsFactors = FALSE ) head(x) #> id code #> 1 9 P23 #> 2 4 B942 #> 3 7 K764 #> 4 1 I950 #> 5 2 V549 #> 6 13 N90"},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute (weighted) comorbidity scores — score","title":"Compute (weighted) comorbidity scores — score","text":"Compute (weighted) comorbidity scores","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute (weighted) comorbidity scores — score","text":"","code":"score(x, weights = NULL, assign0)"},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute (weighted) comorbidity scores — score","text":"x object class comorbidty returned call comorbidity() function. weights weighting system used. depend mapping algorithm. Possible values Charlson index : charlson, original weights Charlson et al. (1987); quan, revised weights Quan et al. (2011). Possible values Elixhauser score : vw, weights van Walraven et al. (2009); swiss, Swiss Elixhauser weights Sharma et al. (2021). Defaults NULL, case unweighted score used. assign0 Apply hierarchy comorbidities: comorbidity present patient different degrees severity, milder form assigned value 0 calculating score. , type comorbidity counted patient. comorbidities affected argument : \"Mild liver disease\" (mld) \"Moderate/severe liver disease\" (msld) Charlson score; \"Diabetes\" (diab) \"Diabetes complications\" (diabwc) Charlson score; \"Cancer\" (canc) \"Metastatic solid tumour\" (metacanc) Charlson score; \"Hypertension, uncomplicated\" (hypunc) \"Hypertension, complicated\" (hypc) Elixhauser score; \"Diabetes, uncomplicated\" (diabunc) \"Diabetes, complicated\" (diabc) Elixhauser score; \"Solid tumour\" (solidtum) \"Metastatic cancer\" (metacanc) Elixhauser score.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute (weighted) comorbidity scores — score","text":"numeric vector (weighted) comorbidity score subject input dataset.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Compute (weighted) comorbidity scores — score","text":"Charlson , Pompei P, Ales KL, et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. Quan H, Li B, Couris CM, et al. Updating validating Charlson Comorbidity Index Score risk adjustment hospital discharge abstracts using data 6 countries. American Journal Epidemiology 2011; 173(6):676-682. van Walraven C, Austin PC, Jennings , Quan H Forster AJ. modification Elixhauser comorbidity measures point system hospital death using administrative data. Medical Care 2009; 47(6):626-633. Sharma N, Schwendimann R, Endrich O, et al. Comparing Charlson Elixhauser comorbidity indices different weightings predict -hospital mortality: analysis national inpatient data. BMC Health Services Research 2021; 21(13).","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute (weighted) comorbidity scores — score","text":"","code":"set.seed(1) x <- data.frame( id = sample(1:15, size = 200, replace = TRUE), code = sample_diag(200), stringsAsFactors = FALSE ) # Charlson score based on ICD-10 diagnostic codes: x1 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) score(x = x1, weights = \"charlson\", assign0 = FALSE) #> [1] 2 6 0 2 0 0 4 0 3 2 0 0 3 0 2 #> attr(,\"map\") #> [1] \"charlson_icd10_quan\" #> attr(,\"weights\") #> [1] \"charlson\" # Elixhauser score based on ICD-10 diagnostic codes: x2 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd10_quan\", assign0 = FALSE) score(x = x2, weights = \"vw\", assign0 = FALSE) #> [1] 4 -1 0 0 0 0 22 0 4 4 0 2 4 0 4 #> attr(,\"map\") #> [1] \"elixhauser_icd10_quan\" #> attr(,\"weights\") #> [1] \"vw\""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-102","dir":"Changelog","previous_headings":"","what":"comorbidity 1.0.2","title":"comorbidity 1.0.2","text":"copd comorbidity Charlson index renamed cpd, ami comorbidity Charlson index renamed mi (#53, thanks @DrYan1102). Please aware might break old code selecting comorbidities name. New dataset: ICD10-CM, 2022 version, named icd10cm_2022.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-101","dir":"Changelog","previous_headings":"","what":"comorbidity 1.0.1","title":"comorbidity 1.0.1","text":"startup message pointing changes API now appears less often (40% probability). Fixed bug causing comorbidities assigned value one missing data code column (#50), thanks @Chris-M-P reporting .","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-100","dir":"Changelog","previous_headings":"","what":"comorbidity 1.0.0","title":"comorbidity 1.0.0","text":"CRAN release: 2022-01-17 comorbidity version 1.0.0 release substantially modifies updates package API. lot improvements terms performance, supported algorithms, user-facing functions; see e.g. thread GitHub. Specific user-facing changes, including examples new API, discussed detail : https://ellessenne.github.io/comorbidity/articles/C-changes.html required, can revert previous release installing GitHub: remotes::install_github(\"ellessenne/comorbidity@0.5.3\"). startup message pointing changes API now displayed 50% probability attaching package removed future releases. New contributors: Sing Yi Chia Edmund Teo.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-053","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.3","title":"comorbidity 0.5.3","text":"CRAN release: 2020-01-09 comorbidity now accepts data.table objects input (#23); comorbidity can deal non-syntactically valid names (#25); Fixed coding typo vignette (#10, #26); Reduced number random tests, R CMD check taking long platforms getting killed CRAN (reported Kurt Hornik).","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-052","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.2","title":"comorbidity 0.5.2","text":"CRAN release: 2019-10-20 Fixed another bug introduced switch data.table occurred input dataset extra columns id code.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-051","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.1","title":"comorbidity 0.5.1","text":"CRAN release: 2019-10-16 melt generic data.table deprecated; dependency reshape2 now removed; Fixed bugs introduced switching data.table comorbidity 0.5.0: column names id code expecting specific names, now fixed behaves expected.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-050","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.0","title":"comorbidity 0.5.0","text":"CRAN release: 2019-08-20 comorbidity now 10+ times faster, thanks Jonathan Williman contributing code based data.table package; Fixed typo vignette regarding weighting algorithm AHRQ Elixhauser comorbidity score (#14, thanks @cornflakegrl); Added pkgdown website: https://ellessenne.github.io/comorbidity.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-041","dir":"Changelog","previous_headings":"","what":"comorbidity 0.4.1","title":"comorbidity 0.4.1","text":"CRAN release: 2019-06-27 Fixed bug regex patterns (#10, thanks @francisco003 reporting @salmasian pull request).","code":""},{"path":[]},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"BREAKING CHANGES","title":"comorbidity 0.4.0","text":"Modified behaviour assign0 argument discussion Anders Alexandersson Issue #9: now default, forcing user decide whether apply hierarchy comorbidity codes . make algorithm transparent end user, allowing informed choice. See ?comorbidity::comorbidity vignette(\"comorbidityscores\", package = \"comorbidity\") details hierarchy applied.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-030","dir":"Changelog","previous_headings":"","what":"comorbidity 0.3.0","title":"comorbidity 0.3.0","text":"CRAN release: 2019-03-22","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"BREAKING CHANGES","title":"comorbidity 0.3.0","text":"comorbidity now returns two Elixhauser scores, one computed using algorithm van Walraven et al. (2009) second one computed using AHRQ algorithm (Moore et al., 2017). Thanks Yumiko Abe-Jones feedback discussion regarding weighted Elixhauser scores. information can found package vignette: vignette(\"comorbidityscores\", package = \"comorbidity\").","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-021","dir":"Changelog","previous_headings":"","what":"comorbidity 0.2.1","title":"comorbidity 0.2.1","text":"Fixed bug weighting algorithm Elixhauser comorbidity score; assign0 argument comorbidity now defaults FALSE; assign0 now explains details hierarchy comorbidities applied; added reference package vignette comorbidity scores weighting algorithms explained detail.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-020","dir":"Changelog","previous_headings":"","what":"comorbidity 0.2.0","title":"comorbidity 0.2.0","text":"CRAN release: 2018-10-08 comorbidity faster, conservative estimated speed->60%; Lots internal housekeeping; Fixed broken GitHub links R script used generate datasets bundled comorbidity.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"BREAKING CHANGES","title":"comorbidity 0.2.0","text":"score argument comorbidity split score icd. instance, command comorbidity(x = x, id = \"id\", code = \"code\", score = \"charlson_icd10\") modified r comorbidity(x = x, id = \"id\", code = \"code\", score = \"charlson\", icd = \"icd10\"). default value icd icd10, ICD-10 codes, possible values icd10 icd9.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-013","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.3","title":"comorbidity 0.1.3","text":"Added nhds2010 australia10 datasets, imported Stata version 15. Bug fix: * Fixed bug regex ICD10 Charlson score; * Fixed bug regex ICD10 Elixhauser score.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-012","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.2","title":"comorbidity 0.1.2","text":"Added ICD10-CM data (version 2017 2018).","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-011","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.1","title":"comorbidity 0.1.1","text":"CRAN release: 2018-03-30 Documented variables missing among returned comorbidity() (@corinne-riddell, #5); Added CITATION file: citation(\"comorbidity\") now returns properly formatted entry.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-010","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.0","title":"comorbidity 0.1.0","text":"CRAN release: 2018-03-07 Added support ICD-9-CM version Charlson Elixhauser scores Added vignette information scores computed comorbidity sample_diag_icd10() function renamed back sample_diag(), now can simulate ICD-9-CM codes ","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-003","dir":"Changelog","previous_headings":"","what":"comorbidity 0.0.3","title":"comorbidity 0.0.3","text":"CRAN release: 2018-01-08 Added datasets icd10_2009 icd10_2011 ICD-10 codes, 2009 2011 versions (respectively) sample_diag now sample_diag_icd10 simulates proper ICD-10 codes Added Elixhauser comorbidity score Renamed package comorbidity now can compute just Charlson score Added formal testing: codes Charlson score properly identified Added formal testing: codes Elixhauser score properly identified","code":""}]
+[{"path":[]},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"interest fostering open welcoming environment, contributors maintainers pledge making participation project community harassment-free experience everyone, regardless age, body size, disability, ethnicity, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes creating positive environment include: Using welcoming inclusive language respectful differing viewpoints experiences Gracefully accepting constructive criticism Focusing best community Showing empathy towards community members Examples unacceptable behavior participants include: use sexualized language imagery unwelcome sexual attention advances Trolling, insulting/derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical electronic address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"our-responsibilities","dir":"","previous_headings":"","what":"Our Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Project maintainers responsible clarifying standards acceptable behavior expected take appropriate fair corrective action response instances unacceptable behavior. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, ban temporarily permanently contributor behaviors deem inappropriate, threatening, offensive, harmful.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within project spaces public spaces individual representing project community. Examples representing project community include using official project e-mail address, posting via official social media account, acting appointed representative online offline event. Representation project may defined clarified project maintainers.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported contacting project team [INSERT EMAIL ADDRESS]. complaints reviewed investigated result response deemed necessary appropriate circumstances. project team obligated maintain confidentiality regard reporter incident. details specific enforcement policies may posted separately. Project maintainers follow enforce Code Conduct good faith may face temporary permanent repercussions determined members project’s leadership.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 1.4, available https://www.contributor-covenant.org/version/1/4/code--conduct.html","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing","title":"Contributing","text":"want contribute project make better, help welcome. small, simple changes fixing typos can edit file directly GitHub clicking Edit button opening . complicated changes, manually create pull request (PR) forking repository. See next section information. submit non-trivial pull request (e.g. just fixing typo), may add name Authors@R field contributor (ctb) R package DESCRIPTION file wish.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONTRIBUTING.html","id":"pull-request-workflow","dir":"","previous_headings":"","what":"Pull Request Workflow","title":"Contributing","text":"Create personal fork project Github, clone fork local machine; Create new branch work ; Implement/fix feature, comment code; Follow code style project, including indentation; Run tests using devtools: devtools::test(); Write adapt tests needed; Add change documentation needed. Please run roxygen2, include changes .Rd files pull request - re-roxygenise documentation ; Push branch fork Github; fork open pull request correct branch. step--step workflow adapted https://github.com/MarcDiethelm/contributing. Working first Pull Request? can learn free series Contribute Open Source Project GitHub.","code":""},{"path":"https://ellessenne.github.io/comorbidity/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing","text":"contributing project agree adhere Contributors Code Conduct: please read CONDUCT.md proposing change.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/A-introduction.html","id":"mapping-comorbidities","dir":"Articles","previous_headings":"","what":"Mapping Comorbidities","title":"Introduction","text":"comorbidity() function can used apply mapping algorithms dataset. , instance, use Quan et al. (2005) version Charlson Comorbidity Index: resulting data frame row per subject, column IDs, column condition included given score (e.g. 17 conditions Charlson score). different columns also labelled compatibility RStudio viewer, see e.g. View(charlson_df) running code computer. see supported mapping algorithms, please see vignette:","code":"charlson_df <- comorbidity( x = df, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE ) str(charlson_df) #> Classes 'comorbidity' and 'data.frame': 100 obs. of 18 variables: #> $ id : int 1 2 3 4 5 6 7 8 9 10 ... #> $ mi : int 0 0 0 0 0 0 0 0 0 0 ... #> $ chf : int 0 1 1 0 0 1 1 0 1 1 ... #> $ pvd : int 0 0 0 0 0 0 0 0 0 0 ... #> $ cevd : int 0 0 0 0 0 0 0 0 0 0 ... #> $ dementia: int 0 0 0 0 0 0 0 0 0 0 ... #> $ cpd : int 1 1 1 1 0 0 1 1 1 1 ... #> $ rheumd : int 0 0 0 0 0 0 0 0 0 0 ... #> $ pud : int 0 0 0 0 0 0 0 0 0 0 ... #> $ mld : int 0 0 0 0 0 0 0 0 0 0 ... #> $ diab : int 0 0 0 0 0 0 0 0 0 0 ... #> $ diabwc : int 1 0 1 1 1 1 1 1 1 1 ... #> $ hp : int 0 0 0 0 0 0 0 0 0 0 ... #> $ rend : int 0 0 0 0 0 0 0 0 0 0 ... #> $ canc : int 1 1 1 1 1 1 1 1 1 1 ... #> $ msld : int 0 0 0 0 0 0 0 0 0 0 ... #> $ metacanc: int 0 0 0 0 0 0 0 0 0 0 ... #> $ aids : int 0 0 0 0 0 0 0 0 0 0 ... #> - attr(*, \"variable.labels\")= chr [1:18] \"ID\" \"Myocardial infarction\" \"Congestive heart failure\" \"Peripheral vascular disease\" ... #> - attr(*, \"map\")= chr \"charlson_icd10_quan\" length(unique(df$id)) == nrow(charlson_df) #> [1] TRUE vignette(\"02-comorbidityscores\", package = \"comorbidity\")"},{"path":"https://ellessenne.github.io/comorbidity/articles/A-introduction.html","id":"comorbidity-scores","dir":"Articles","previous_headings":"","what":"Comorbidity Scores","title":"Introduction","text":"calculating data frame comorbid conditions, can used calculate comorbidity scores using score() function. Say want calculate Charlson comorbidity score, weighted using Quan et al. (2011) weights: returns single value per subject: pure combination conditions required (e.g. unweighted score), pass NULL value weights argument score() function: , available weighting systems/algorithms described vignette mentioned .","code":"quan_cci <- score(x = charlson_df, weights = \"quan\", assign0 = FALSE) table(quan_cci) #> quan_cci #> 2 3 4 5 6 #> 7 18 20 30 25 length(quan_cci) == nrow(charlson_df) #> [1] TRUE unw_cci <- score(x = charlson_df, weights = NULL, assign0 = FALSE) table(unw_cci) #> unw_cci #> 1 2 3 4 #> 7 25 43 25"},{"path":"https://ellessenne.github.io/comorbidity/articles/A-introduction.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Introduction","text":"Charlson et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. DOI: 10.1016/0021-9681(87)90171-8 Quan H et al. Coding algorithms defining comorbidities ICD-9-CM ICD-10 administrative data. Medical Care 2005; 43(11):1130-1139. DOI: 10.1097/01.mlr.0000182534.19832.83 Quan H et al. Updating validating Charlson Comorbidity Index score risk adjustment hospital discharge abstracts using data 6 countries. American Journal Epidemiology 2011;173(6):676-82. DOI: 10.1093/aje/kwq433","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/B-comorbidity-scores.html","id":"supported-mapping-algorithms","dir":"Articles","previous_headings":"","what":"Supported Mapping Algorithms","title":"Supported Comorbidity Mappings and Scores","text":"{comorbidity} package can apply comorbidity mappings corresponding Charlson Elixhauser comorbidity scores. ICD-9 ICD-10 coding systems supported, algorithms described paper Quan et al. (2005). resulting mapping algorithms denoted charlson_icd9_quan charlson_icd10_quan Charlson score (based ICD-9 ICD-10 systems, respectively), elixhauser_icd9_quan elixhauser_icd10_quan Elixhauser score. Furthermore, Swedish (Ludvigsson et al., 2021) Australian (Sundararajan et al., 2004) modifications Charlson score implemented well, identified charlson_icd10_se charlson_icd10_am respectively.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/B-comorbidity-scores.html","id":"supported-weighting-algorithms","dir":"Articles","previous_headings":"","what":"Supported Weighting Algorithms","title":"Supported Comorbidity Mappings and Scores","text":"Different weighting algorithms proposed combine different conditions single measure, Charlson Elixhauser index. Currently, following weighting algorithms supported Charlson score: original weights Charlson et al. (1987), denoted charlson; Updated weights Quan et al. (2011), denoted quan. , Elixhauser score: Weights proposed van Walraven et al. (2009), denoted vw; Swiss weights modification Sharma et al. (2021), denoted swiss.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/B-comorbidity-scores.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Supported Comorbidity Mappings and Scores","text":"Charlson et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. DOI: 10.1016/0021-9681(87)90171-8 Elixhauser et al. Comorbidity measures use administrative data. Medical Care 1998; 36(1):8-27. DOI: 10.1097/00005650-199801000-00004 Ludvigsson JF et al. Adaptation Charlson Comorbidity Index register-based research Sweden. Clinical Epidemiology 2021; 13:21–41. DOI: 10.2147/clep.s282475 Quan H et al. Coding algorithms defining comorbidities ICD-9-CM ICD-10 administrative data. Medical Care 2005; 43(11):1130-1139. DOI: 10.1097/01.mlr.0000182534.19832.83 Quan H et al. Updating validating Charlson Comorbidity Index score risk adjustment hospital discharge abstracts using data 6 countries. American Journal Epidemiology 2011;173(6):676-82. DOI: 10.1093/aje/kwq433 Sharma N et al. Comparing Charlson Elixhauser comorbidity indices different weightings predict -hospital mortality: analysis national inpatient data. BMC Health Services Research 2021; 21(1). DOI: 10.1186/s12913-020-05999-5 Sundararajan V et al. New ICD-10 version Charlson comorbidity index predicted -hospital mortality. Journal Clinical Epidemiology 2004; 57(12):1288-1294. DOI: 10.1016/j.jclinepi.2004.03.012 van Walraven C, Austin PC, Jennings , Quan H Forster AJ. modification Elixhauser comorbidity measures point system hospital death using administrative data. Medical Care 2009; 47(6):626-633. DOI: 10.1097/MLR.0b013e31819432e5","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"comorbidity-mapping-and-scoring-are-now-distinct-functions","dir":"Articles","previous_headings":"","what":"Comorbidity Mapping and Scoring are Now Distinct Functions","title":"Updating to {comorbidity} 1.0.0","text":"previous release {comorbidity}, comorbidity mapping scoring algorithms applied jointly single function call: Now, first need apply mapping algorithm: …yields results shown . , need calculate comorbidity scores, can use score() function: yields unweighted scores (e.g. equivalent score column ). need weighted scores (e.g. wscore column , assumes old Charlson score weights 1987), can pass name supported scoring algorithm: , results score() function equivalent obtained using previously-released version.","code":"comorbidity(x = sim_data, id = \"id\", code = \"code\", score = \"charlson\", icd = \"icd10\", assign0 = FALSE) #> id ami chf pvd cevd dementia copd rheumd pud mld diab diabwc hp rend canc #> 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 #> 2 2 0 0 0 0 0 0 0 0 0 1 1 0 0 1 #> 3 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 #> 4 4 0 0 0 1 0 0 0 0 0 0 0 0 0 1 #> 5 5 0 0 0 0 0 0 0 0 0 1 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 0 0 0 0 0 0 0 0 0 0 0 0 1 1 #> 8 8 0 0 0 1 0 0 1 0 0 1 1 0 0 1 #> 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 1 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 #> msld metacanc aids score index wscore windex #> 1 0 0 0 2 1-2 4 3-4 #> 2 0 0 0 3 3-4 5 >=5 #> 3 0 0 0 1 1-2 1 1-2 #> 4 0 0 0 2 1-2 3 3-4 #> 5 0 0 0 1 1-2 1 1-2 #> 6 0 0 0 0 0 0 0 #> 7 0 0 0 2 1-2 4 3-4 #> 8 0 0 0 5 >=5 7 >=5 #> 9 0 0 0 1 1-2 2 1-2 #> 10 0 0 0 1 1-2 2 1-2 com <- comorbidity(x = sim_data, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) com #> id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld #> 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 #> 2 2 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 #> 3 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 #> 4 4 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 #> 5 5 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 #> 8 8 0 0 0 1 0 0 1 0 0 1 1 0 0 1 0 #> 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> metacanc aids #> 1 0 0 #> 2 0 0 #> 3 0 0 #> 4 0 0 #> 5 0 0 #> 6 0 0 #> 7 0 0 #> 8 0 0 #> 9 0 0 #> 10 0 0 score(com, assign0 = FALSE, weights = NULL) #> [1] 2 3 1 2 1 0 2 5 1 1 #> attr(,\"map\") #> [1] \"charlson_icd10_quan\" score(com, assign0 = FALSE, weights = \"charlson\") #> [1] 4 5 1 3 1 0 4 7 2 2 #> attr(,\"map\") #> [1] \"charlson_icd10_quan\" #> attr(,\"weights\") #> [1] \"charlson\""},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"supported-mapping-and-scoring-algorithms","dir":"Articles","previous_headings":"","what":"Supported Mapping and Scoring Algorithms","title":"Updating to {comorbidity} 1.0.0","text":"new version includes updated comorbidity mapping scoring algorithms. Furthermore, designed way simplify addition new scores future. currently supported comorbidity mapping algorithms described following vignette: Alternatively, new function provided display supported algorithms R console: picked auto-magically internal data structures, always --date.","code":"vignette(\"02-comorbidityscores\", package = \"comorbidity\") available_algorithms() #> Supported comorbidity mapping algorithms: #> * charlson_icd9_quan #> * charlson_icd10_quan #> * charlson_icd10_se #> * charlson_icd10_am #> * elixhauser_icd9_quan #> * elixhauser_icd10_quan #> #> Supported scoring weights algorithms: #> * For charlson_icd9_quan: charlson, quan #> * For charlson_icd10_quan: charlson, quan #> * For charlson_icd10_se: charlson, quan #> * For charlson_icd10_am: charlson, quan #> * For elixhauser_icd9_quan: vw, swiss #> * For elixhauser_icd10_quan: vw, swiss"},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"computational-speed","dir":"Articles","previous_headings":"","what":"Computational Speed","title":"Updating to {comorbidity} 1.0.0","text":"internal re-writing package API allowed optimising code speed efficiency. managed estimate, using simulated data, main comorbidity mapping function (e.g. comorbidity()) approximately twice fast version 0.5.3, across variety sample sizes: main computational bottleneck, applying scoring algorithm fast general.","code":""},{"path":"https://ellessenne.github.io/comorbidity/articles/C-changes.html","id":"reverting-to-previous-release","dir":"Articles","previous_headings":"","what":"Reverting to previous release","title":"Updating to {comorbidity} 1.0.0","text":"understand new release might break workflows, apologies . feedback, please feel free e-mail maintainer package open issue GitHub, latter strongly suggested. Finally, required, can revert previous release installing GitHub:","code":"library(remotes) remotes::install_github(\"ellessenne/comorbidity@0.5.3\")"},{"path":"https://ellessenne.github.io/comorbidity/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Alessandro Gasparini. Author, maintainer. Hojjat Salmasian. Contributor. ICD-9-CM scores Jonathan Williman. Contributor. Sing Yi Chia. Contributor. Edmund Teo. Contributor.","code":""},{"path":"https://ellessenne.github.io/comorbidity/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Gasparini, (2018). comorbidity: R package computing comorbidity scores. Journal Open Source Software, 3(23), 648, https://doi.org/10.21105/joss.00648","code":"@Article{, author = {Alessandro Gasparini}, title = {comorbidity: An R package for computing comorbidity scores}, journal = {Journal of Open Source Software}, year = {2018}, volume = {3}, issue = {23}, pages = {648}, doi = {10.21105/joss.00648}, url = {https://doi.org/10.21105/joss.00648}, }"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"the-comorbidity-package-computing-comorbidity-scores-","dir":"","previous_headings":"","what":"Computing Comorbidity Scores","title":"Computing Comorbidity Scores","text":"Last updated: 2022-04-06 comorbidity R package computing comorbidity scores weighted Charlson score Elixhauser comorbidity score; ICD-10 ICD-9 coding systems supported.","code":""},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Computing Comorbidity Scores","text":"comorbidity CRAN. can install usual : Alternatively, can install development version GitHub :","code":"install.packages(\"comorbidity\") # install.packages(\"remotes\") remotes::install_github(\"ellessenne/comorbidity\")"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"simulating-icd-10-codes","dir":"","previous_headings":"","what":"Simulating ICD-10 codes","title":"Computing Comorbidity Scores","text":"comorbidity packages includes function named sample_diag() allows simulating ICD diagnostic codes straightforward way. instance, simulate ICD-10 codes: also possible simulate two different versions ICD-10 coding system. default simulate ICD-10 codes 2011 version: Alternatively, use 2009 version:","code":"# load the comorbidity package library(comorbidity) ## This is {comorbidity} version 1.0.2. ## A lot has changed since the last release on CRAN, please check-out breaking changes here: ## -> https://ellessenne.github.io/comorbidity/articles/C-changes.html # set a seed for reproducibility set.seed(1) # simulate 50 ICD-10 codes for 5 individuals x <- data.frame( id = sample(1:5, size = 50, replace = TRUE), code = sample_diag(n = 50) ) x <- x[order(x$id, x$code), ] print(head(x, n = 15), row.names = FALSE) ## id code ## 1 B02 ## 1 B582 ## 1 I749 ## 1 J450 ## 1 L893 ## 1 Q113 ## 1 Q26 ## 1 Q978 ## 1 T224 ## 1 V101 ## 1 V244 ## 1 V46 ## 2 A665 ## 2 C843 ## 2 D838 set.seed(1) x1 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30) ) set.seed(1) x2 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD10_2011\") ) # should return TRUE all.equal(x1, x2) ## [1] TRUE set.seed(1) x1 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD10_2009\") ) set.seed(1) x2 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD10_2011\") ) # should not return TRUE all.equal(x1, x2) ## [1] \"Component \\\"code\\\": 30 string mismatches\""},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"simulating-icd-9-codes","dir":"","previous_headings":"","what":"Simulating ICD-9 codes","title":"Computing Comorbidity Scores","text":"ICD-9 codes can easily simulated :","code":"set.seed(2) x9 <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30, version = \"ICD9_2015\") ) x9 <- x9[order(x9$id, x9$code), ] print(head(x9, n = 15), row.names = FALSE) ## id code ## 1 01130 ## 1 01780 ## 1 30151 ## 1 3073 ## 1 36907 ## 1 37845 ## 1 64212 ## 1 66704 ## 1 72633 ## 1 9689 ## 1 V289 ## 2 0502 ## 2 09169 ## 2 20046 ## 2 25082"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"computing-comorbidity-scores","dir":"","previous_headings":"","what":"Computing comorbidity scores","title":"Computing Comorbidity Scores","text":"main function comorbidity package named comorbidity(), can used compute supported comorbidity score; scores can specified setting score argument, required. Say 3 individuals total 30 ICD-10 diagnostic codes: compute Charlson comorbidity domains: set assign0 argument FALSE apply hierarchy comorbidity codes, described ?comorbidity::comorbidity. Alternatively, compute Elixhauser score: Weighted unweighted comorbidity scores can obtained using score() function: Code Elixhauser score omitted, works analogously. Conversely, say 5 individuals total 100 ICD-9 diagnostic codes: Charlson Elixhauser comorbidity codes can easily computed : Scores:","code":"set.seed(1) x <- data.frame( id = sample(1:3, size = 30, replace = TRUE), code = sample_diag(n = 30) ) charlson <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) charlson ## id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld metacanc aids ## 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 ## 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 ## 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 elixhauser <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd10_quan\", assign0 = FALSE) elixhauser ## id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf ld pud aids lymph ## 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ## 2 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 3 3 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ## metacanc solidtum rheumd coag obes wloss fed blane dane alcohol drug psycho depre ## 1 0 1 0 0 0 0 0 0 0 0 0 0 0 ## 2 0 1 0 0 0 0 0 0 0 0 0 0 0 ## 3 0 0 0 0 0 0 0 0 0 0 0 0 0 unw_cci <- score(charlson, weights = NULL, assign0 = FALSE) unw_cci ## [1] 2 1 0 ## attr(,\"map\") ## [1] \"charlson_icd10_quan\" quan_cci <- score(charlson, weights = \"quan\", assign0 = FALSE) quan_cci ## [1] 6 2 0 ## attr(,\"map\") ## [1] \"charlson_icd10_quan\" ## attr(,\"weights\") ## [1] \"quan\" all.equal(unw_cci, quan_cci) ## [1] \"Attributes: < Length mismatch: comparison on first 1 components >\" ## [2] \"Mean relative difference: 1.666667\" set.seed(3) x <- data.frame( id = sample(1:5, size = 100, replace = TRUE), code = sample_diag(n = 100, version = \"ICD9_2015\") ) charlson9 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd9_quan\", assign0 = FALSE) charlson9 ## id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld metacanc aids ## 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 ## 2 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 3 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ## 4 4 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 ## 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 elixhauser9 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd9_quan\", assign0 = FALSE) elixhauser9 ## id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf ld pud aids lymph ## 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 2 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ## 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 4 4 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## metacanc solidtum rheumd coag obes wloss fed blane dane alcohol drug psycho depre ## 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 2 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 3 0 0 0 0 0 0 0 0 0 0 0 1 0 ## 4 0 0 0 0 0 0 0 0 0 0 0 0 0 ## 5 0 0 1 0 0 0 0 0 0 0 0 0 0 unw_eci <- score(elixhauser9, weights = NULL, assign0 = FALSE) vw_eci <- score(elixhauser9, weights = \"vw\", assign0 = FALSE) all.equal(unw_eci, vw_eci) ## [1] \"Attributes: < Length mismatch: comparison on first 1 components >\" ## [2] \"Mean relative difference: 2\""},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Computing Comorbidity Scores","text":"find comorbidity useful, please cite publications:","code":"citation(\"comorbidity\") ## ## To cite the comorbidity package in publications, please use: ## ## Gasparini, (2018). comorbidity: An R package for computing comorbidity scores. Journal ## of Open Source Software, 3(23), 648, https://doi.org/10.21105/joss.00648 ## ## A BibTeX entry for LaTeX users is ## ## @Article{, ## author = {Alessandro Gasparini}, ## title = {comorbidity: An R package for computing comorbidity scores}, ## journal = {Journal of Open Source Software}, ## year = {2018}, ## volume = {3}, ## issue = {23}, ## pages = {648}, ## doi = {10.21105/joss.00648}, ## url = {https://doi.org/10.21105/joss.00648}, ## }"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Computing Comorbidity Scores","text":"details comorbidity mapping scoring algorithm available within package can found two accompanying vignettes, can accessed CRAN directly R session:","code":"vignette(\"01-introduction\", package = \"comorbidity\") vignette(\"02-comorbidity-scores\", package = \"comorbidity\")"},{"path":"https://ellessenne.github.io/comorbidity/index.html","id":"copyright","dir":"","previous_headings":"","what":"Copyright","title":"Computing Comorbidity Scores","text":"icon hex sticker made monkik www.flaticon.com, licensed Creative Commons 3.0.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":null,"dir":"Reference","previous_headings":"","what":"Australian mortality data, 2010 — australia10","title":"Australian mortality data, 2010 — australia10","text":"dataset containing Australian mortality data, obtained Stata 17.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Australian mortality data, 2010 — australia10","text":"","code":"australia10"},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Australian mortality data, 2010 — australia10","text":"data frame 3,322 rows 3 variables: cause ICD-10 code representing cause death sex Gender deaths Number deaths","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/australia10.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Australian mortality data, 2010 — australia10","text":"R code used download process dataset Stata available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/available_algorithms.html","id":null,"dir":"Reference","previous_headings":"","what":"Display Currently Supported Algorithms — available_algorithms","title":"Display Currently Supported Algorithms — available_algorithms","text":"function prints (currently) supported implemented comorbidity mapping, one , supported scoring weighting algorithm.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/available_algorithms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display Currently Supported Algorithms — available_algorithms","text":"","code":"available_algorithms()"},{"path":"https://ellessenne.github.io/comorbidity/reference/available_algorithms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display Currently Supported Algorithms — available_algorithms","text":"","code":"available_algorithms() #> Supported comorbidity mapping algorithms: #> \t* charlson_icd9_quan #> \t* charlson_icd10_quan #> \t* charlson_icd10_se #> \t* charlson_icd10_am #> \t* elixhauser_icd9_quan #> \t* elixhauser_icd10_quan #> #> Supported scoring weights algorithms: #> \t* For charlson_icd9_quan: charlson, quan #> \t* For charlson_icd10_quan: charlson, quan #> \t* For charlson_icd10_se: charlson, quan #> \t* For charlson_icd10_am: charlson, quan #> \t* For elixhauser_icd9_quan: vw, swiss #> \t* For elixhauser_icd10_quan: vw, swiss"},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Computing Comorbidity Scores — comorbidity-package","title":"Computing Comorbidity Scores — comorbidity-package","text":"Computing comorbidity scores weighted Charlson score (Charlson, 1987 doi: 10.1016/0021-9681(87)90171-8 ) Elixhauser comorbidity score (Elixhauser, 1998 doi: 10.1097/00005650-199801000-00004 ) using ICD-9-CM ICD-10 codes (Quan, 2005 doi: 10.1097/01.mlr.0000182534.19832.83 ).","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Computing Comorbidity Scores — comorbidity-package","text":"Alessandro Gasparini (alessandro.gasparini@ki.se)","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":null,"dir":"Reference","previous_headings":"","what":"Comorbidity mapping. — comorbidity","title":"Comorbidity mapping. — comorbidity","text":"Maps comorbidity conditions using algorithms Charlson Elixhauser comorbidity scores.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Comorbidity mapping. — comorbidity","text":"","code":"comorbidity(x, id, code, map, assign0, labelled = TRUE, tidy.codes = TRUE)"},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Comorbidity mapping. — comorbidity","text":"x tidy data.frame (data.table; tibbles supported ) one column containing individual ID column containing diagnostic codes. Extra columns ID codes discarded. Column names must syntactically valid names, otherwise forced calling make.names() function. id Column x containing individual ID. code Column x containing diagnostic codes. Codes must upper case punctuation order properly recognised. map mapping algorithm used (values case-insensitive). Possible values Charlson score either ICD-10 ICD-9-CM codes (charlson_icd10_quan, charlson_icd9_quan) Elixhauser score, using either ICD-10 ICD-9-CM (elixhauser_icd10_quan, elixhauser_icd9_quan). mapping based paper Quan et al. (2011). also possible obtain Swedish (charlson_icd10_se) Australian (charlson_icd10_am) modification Charlson score using ICD-10 codes. assign0 Apply hierarchy comorbidities: comorbidity present patient different degrees severity, milder form assigned value 0. , type comorbidity counted patient. comorbidities affected argument : \"Mild liver disease\" (mld) \"Moderate/severe liver disease\" (msld) Charlson score; \"Diabetes\" (diab) \"Diabetes complications\" (diabwc) Charlson score; \"Cancer\" (canc) \"Metastatic solid tumour\" (metacanc) Charlson score; \"Hypertension, uncomplicated\" (hypunc) \"Hypertension, complicated\" (hypc) Elixhauser score; \"Diabetes, uncomplicated\" (diabunc) \"Diabetes, complicated\" (diabc) Elixhauser score; \"Solid tumour\" (solidtum) \"Metastatic cancer\" (metacanc) Elixhauser score. labelled Attach labels comorbidity, compatible RStudio viewer via utils::View() function. Defaults TRUE. tidy.codes Tidy diagnostic codes? TRUE, codes converted upper case non-alphanumeric characters removed using regular expression [^[:alnum:]]. Defaults TRUE.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Comorbidity mapping. — comorbidity","text":"data frame id, columns relative comorbidity domain, comorbidity score, weighted comorbidity score, categorisations scores, one row per individual. Charlson score, following variables included dataset: id variable defined user; mi, myocardial infarction; chf, congestive heart failure; pvd, peripheral vascular disease; cevd, cerebrovascular disease; dementia, dementia; cpd, chronic pulmonary disease; rheumd, rheumatoid disease; pud, peptic ulcer disease; mld, mild liver disease; diab, diabetes without complications; diabwc, diabetes complications; hp, hemiplegia paraplegia; rend, renal disease; canc, cancer (malignancy); msld, moderate severe liver disease; metacanc, metastatic solid tumour; aids, AIDS/HIV. Please note combine \"chronic obstructive pulmonary disease\" \"chronic pulmonary disease\" Swedish version Charlson index, comparability (compatibility) definitions/implementations. Conversely, Elixhauser score dataset contains following variables: id variable defined user; chf, congestive heart failure; carit, cardiac arrhythmias; valv, valvular disease; pcd, pulmonary circulation disorders; pvd, peripheral vascular disorders; hypunc, hypertension, uncomplicated; hypc, hypertension, complicated; para, paralysis; ond, neurological disorders; cpd, chronic pulmonary disease; diabunc, diabetes, uncomplicated; diabc, diabetes, complicated; hypothy, hypothyroidism; rf, renal failure; ld, liver disease; pud, peptic ulcer disease, excluding bleeding; aids, AIDS/HIV; lymph, lymphoma; metacanc, metastatic cancer; solidtum, solid tumour, without metastasis; rheumd, rheumatoid arthritis/collaged vascular disease; coag, coagulopathy; obes, obesity; wloss, weight loss; fed, fluid electrolyte disorders; blane, blood loss anaemia; dane, deficiency anaemia; alcohol, alcohol abuse; drug, drug abuse; psycho, psychoses; depre, depression; Labels presented user using RStudio viewer (e.g. via utils::View() function) convenience.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Comorbidity mapping. — comorbidity","text":"ICD-10 ICD-9-CM coding Charlson Elixhauser scores based work Quan et al. (2005). ICD-10 ICD-9 codes must upper case alphanumeric characters order properly recognised; set tidy.codes = TRUE properly tidy codes automatically. message printed R console non-alphanumeric characters found.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Comorbidity mapping. — comorbidity","text":"Quan H, Sundararajan V, Halfon P, Fong , Burnand B, Luthi JC, et al. Coding algorithms defining comorbidities ICD-9-CM ICD-10 administrative data. Medical Care 2005; 43(11):1130-1139. Charlson , Pompei P, Ales KL, et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. Ludvigsson JF, Appelros P, Askling J et al. Adaptation Charlson Comorbidity Index register-based research Sweden. Clinical Epidemiology 2021; 13:21-41. Sundararajan V, Henderson T, Perry C, Muggivan , Quan H, Ghali WA. New ICD-10 version Charlson comorbidity index predicted -hospital mortality. Journal Clinical Epidemiology 2004; 57(12):1288-1294.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/comorbidity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Comorbidity mapping. — comorbidity","text":"","code":"set.seed(1) x <- data.frame( id = sample(1:15, size = 200, replace = TRUE), code = sample_diag(200), stringsAsFactors = FALSE ) # Charlson score based on ICD-10 diagnostic codes: comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) #> id mi chf pvd cevd dementia cpd rheumd pud mld diab diabwc hp rend canc msld #> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 #> 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 9 9 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 13 13 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 #> 14 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> metacanc aids #> 1 0 0 #> 2 0 1 #> 3 0 0 #> 4 0 0 #> 5 0 0 #> 6 0 0 #> 7 0 0 #> 8 0 0 #> 9 0 0 #> 10 0 0 #> 11 0 0 #> 12 0 0 #> 13 0 0 #> 14 0 0 #> 15 0 0 # Elixhauser score based on ICD-10 diagnostic codes: comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd10_quan\", assign0 = FALSE) #> id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf #> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 #> 2 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 #> 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 7 1 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 12 12 0 0 0 0 0 0 0 0 1 0 0 0 0 0 #> 13 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 14 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> ld pud aids lymph metacanc solidtum rheumd coag obes wloss fed blane dane #> 1 0 0 0 0 0 1 0 0 0 0 0 0 0 #> 2 0 0 1 0 0 0 0 0 0 0 0 0 0 #> 3 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 4 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 5 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 6 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 7 1 0 0 0 0 1 0 0 0 0 0 0 0 #> 8 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 9 0 0 0 0 0 1 1 0 0 0 0 0 0 #> 10 0 0 0 0 0 1 0 0 0 0 0 0 0 #> 11 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 12 0 0 0 0 0 0 0 1 0 0 0 0 0 #> 13 0 1 0 0 0 1 0 0 0 0 0 0 0 #> 14 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 15 0 0 0 0 0 1 0 0 0 0 0 0 0 #> alcohol drug psycho depre #> 1 0 0 0 0 #> 2 0 0 0 0 #> 3 0 0 0 0 #> 4 0 0 0 0 #> 5 0 0 0 0 #> 6 0 0 0 0 #> 7 1 0 0 0 #> 8 0 0 0 0 #> 9 0 0 0 0 #> 10 0 0 0 0 #> 11 0 0 0 0 #> 12 0 1 1 0 #> 13 0 0 0 0 #> 14 0 0 0 0 #> 15 0 0 0 0"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"dataset containing 2009 version ICD-10 codes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"","code":"icd10_2009"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"data frame 10,817 rows 4 variables: Code ICD-10 diagnostic code Code.clean ICD-10 diagnostic code, removing punctuation ICD.title Code description, plain English. Status Additional information, available.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"CDC Website: https://goo.gl/6e2mvb","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2009.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10 Diagnostic Codes, 2009 Version — icd10_2009","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"dataset containing 2011 version ICD-10 codes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"","code":"icd10_2011"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"data frame 10,856 rows 4 variables: Code ICD-10 diagnostic code Code.clean ICD-10 diagnostic code, removing punctuation ICD.title Code description, plain English. Status Additional information, available.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"CDC Website: https://goo.gl/rcTJJ2","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10_2011.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10 Diagnostic Codes, 2011 Version — icd10_2011","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"dataset containing 2017 version ICD10-CM coding system.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"","code":"icd10cm_2017"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"data frame 71,486 rows 2 variables: Code ICD-10-CM diagnostic code Description Description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10-CM Diagnostic Codes, 2017 Version — icd10cm_2017","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"dataset containing 2018 version ICD10-CM coding system.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"","code":"icd10cm_2018"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"data frame 71,704 rows 2 variables: Code ICD-10-CM diagnostic code Description Description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10-CM Diagnostic Codes, 2018 Version — icd10cm_2018","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"dataset containing 2022 version ICD10-CM coding system.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"","code":"icd10cm_2022"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"data frame 72,750 rows 2 variables: Code ICD-10-CM diagnostic code Description Description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd10cm_2022.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-10-CM Diagnostic Codes, 2022 Version — icd10cm_2022","text":"R code used download process dataset CDC website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":null,"dir":"Reference","previous_headings":"","what":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"dataset containing version ICD-9 codes effective October 1, 2014.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"","code":"icd9_2015"},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"data frame 14,567 rows 3 variables: Code ICD-9 diagnostic code Long_description Long description code Short_description Short description code","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"CMS.gov Website: https://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/icd9_2015.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"ICD-9 Diagnostic Codes, 2015 Version (v32) — icd9_2015","text":"R code used download process dataset CMS.gov website available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":null,"dir":"Reference","previous_headings":"","what":"Adult same-day discharges, 2010 — nhds2010","title":"Adult same-day discharges, 2010 — nhds2010","text":"dataset containing adult -day discharges 2010, obtained Stata 17.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adult same-day discharges, 2010 — nhds2010","text":"","code":"nhds2010"},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Adult same-day discharges, 2010 — nhds2010","text":"data frame 2,210 rows 15 variables: ageu Units age age Age sex Sex race Race month Discharge month status Discharge status region Region atype Type admission dx1 Diagnosis 1, ICD9-CM dx2 Diagnosis 2, ICD9-CM dx3 Diagnosis 3, ICD9-CM, imported incorrectly dx3corr Diagnosis 3, ICD9-CM, corrected pr1 Procedure 1 wgt Frequency weight recid Order record (raw data)","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/nhds2010.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Adult same-day discharges, 2010 — nhds2010","text":"R code used download process dataset Stata available .","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"simple function simulate ICD-10 ICD-9 diagnostic codes random.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"","code":"sample_diag(n = 1, version = \"ICD10_2011\")"},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"n Number ICD codes simulate. version version ICD coding scheme use. Possible choices ICD10_2009, ICD10_2011, ICD9_2015; defaults ICD10_2011. See icd10_2009, icd10_2011, icd9_2015 information different schemes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"vector n ICD diagnostic codes.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/sample_diag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulate ICD-10 and ICD-9 diagnostic codes — sample_diag","text":"","code":"# Simulate 10 ICD-10 codes sample_diag(10) #> [1] \"D682\" \"R454\" \"G308\" \"R90\" \"N350\" \"S064\" \"V435\" \"V795\" \"M356\" \"R073\" # Simulate a tidy dataset with 15 individuals and 200 rows set.seed(1) x <- data.frame( id = sample(1:15, size = 200, replace = TRUE), code = sample_diag(n = 200), stringsAsFactors = FALSE ) head(x) #> id code #> 1 9 P23 #> 2 4 B942 #> 3 7 K764 #> 4 1 I950 #> 5 2 V549 #> 6 13 N90"},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute (weighted) comorbidity scores — score","title":"Compute (weighted) comorbidity scores — score","text":"Compute (weighted) comorbidity scores","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute (weighted) comorbidity scores — score","text":"","code":"score(x, weights = NULL, assign0)"},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute (weighted) comorbidity scores — score","text":"x object class comorbidty returned call comorbidity() function. weights weighting system used. depend mapping algorithm. Possible values Charlson index : charlson, original weights Charlson et al. (1987); quan, revised weights Quan et al. (2011). Possible values Elixhauser score : vw, weights van Walraven et al. (2009); swiss, Swiss Elixhauser weights Sharma et al. (2021). Defaults NULL, case unweighted score used. assign0 Apply hierarchy comorbidities: comorbidity present patient different degrees severity, milder form assigned value 0 calculating score. , type comorbidity counted patient. comorbidities affected argument : \"Mild liver disease\" (mld) \"Moderate/severe liver disease\" (msld) Charlson score; \"Diabetes\" (diab) \"Diabetes complications\" (diabwc) Charlson score; \"Cancer\" (canc) \"Metastatic solid tumour\" (metacanc) Charlson score; \"Hypertension, uncomplicated\" (hypunc) \"Hypertension, complicated\" (hypc) Elixhauser score; \"Diabetes, uncomplicated\" (diabunc) \"Diabetes, complicated\" (diabc) Elixhauser score; \"Solid tumour\" (solidtum) \"Metastatic cancer\" (metacanc) Elixhauser score.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute (weighted) comorbidity scores — score","text":"numeric vector (weighted) comorbidity score subject input dataset.","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Compute (weighted) comorbidity scores — score","text":"Charlson , Pompei P, Ales KL, et al. new method classifying prognostic comorbidity longitudinal studies: development validation. Journal Chronic Diseases 1987; 40:373-383. Quan H, Li B, Couris CM, et al. Updating validating Charlson Comorbidity Index Score risk adjustment hospital discharge abstracts using data 6 countries. American Journal Epidemiology 2011; 173(6):676-682. van Walraven C, Austin PC, Jennings , Quan H Forster AJ. modification Elixhauser comorbidity measures point system hospital death using administrative data. Medical Care 2009; 47(6):626-633. Sharma N, Schwendimann R, Endrich O, et al. Comparing Charlson Elixhauser comorbidity indices different weightings predict -hospital mortality: analysis national inpatient data. BMC Health Services Research 2021; 21(13).","code":""},{"path":"https://ellessenne.github.io/comorbidity/reference/score.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute (weighted) comorbidity scores — score","text":"","code":"set.seed(1) x <- data.frame( id = sample(1:15, size = 200, replace = TRUE), code = sample_diag(200), stringsAsFactors = FALSE ) # Charlson score based on ICD-10 diagnostic codes: x1 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"charlson_icd10_quan\", assign0 = FALSE) score(x = x1, weights = \"charlson\", assign0 = FALSE) #> [1] 2 6 0 2 0 0 4 0 3 2 0 0 3 0 2 #> attr(,\"map\") #> [1] \"charlson_icd10_quan\" #> attr(,\"weights\") #> [1] \"charlson\" # Elixhauser score based on ICD-10 diagnostic codes: x2 <- comorbidity(x = x, id = \"id\", code = \"code\", map = \"elixhauser_icd10_quan\", assign0 = FALSE) score(x = x2, weights = \"vw\", assign0 = FALSE) #> [1] 4 -1 0 0 0 0 22 0 4 4 0 2 4 0 4 #> attr(,\"map\") #> [1] \"elixhauser_icd10_quan\" #> attr(,\"weights\") #> [1] \"vw\""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-102","dir":"Changelog","previous_headings":"","what":"comorbidity 1.0.2","title":"comorbidity 1.0.2","text":"copd ami comorbidities Charlson index renamed cpd mi, respectively (#53, thanks @DrYan1102). Please aware might break old code selecting comorbidities name. New dataset: ICD10-CM, 2022 version, named icd10cm_2022.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-101","dir":"Changelog","previous_headings":"","what":"comorbidity 1.0.1","title":"comorbidity 1.0.1","text":"startup message pointing changes API now appears less often (40% probability). Fixed bug causing comorbidities assigned value one missing data code column (#50), thanks @Chris-M-P reporting .","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-100","dir":"Changelog","previous_headings":"","what":"comorbidity 1.0.0","title":"comorbidity 1.0.0","text":"CRAN release: 2022-01-17 comorbidity version 1.0.0 release substantially modifies updates package API. lot improvements terms performance, supported algorithms, user-facing functions; see e.g. thread GitHub. Specific user-facing changes, including examples new API, discussed detail : https://ellessenne.github.io/comorbidity/articles/C-changes.html required, can revert previous release installing GitHub: remotes::install_github(\"ellessenne/comorbidity@0.5.3\"). startup message pointing changes API now displayed 50% probability attaching package removed future releases. New contributors: Sing Yi Chia Edmund Teo.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-053","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.3","title":"comorbidity 0.5.3","text":"CRAN release: 2020-01-09 comorbidity now accepts data.table objects input (#23); comorbidity can deal non-syntactically valid names (#25); Fixed coding typo vignette (#10, #26); Reduced number random tests, R CMD check taking long platforms getting killed CRAN (reported Kurt Hornik).","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-052","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.2","title":"comorbidity 0.5.2","text":"CRAN release: 2019-10-20 Fixed another bug introduced switch data.table occurred input dataset extra columns id code.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-051","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.1","title":"comorbidity 0.5.1","text":"CRAN release: 2019-10-16 melt generic data.table deprecated; dependency reshape2 now removed; Fixed bugs introduced switching data.table comorbidity 0.5.0: column names id code expecting specific names, now fixed behaves expected.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-050","dir":"Changelog","previous_headings":"","what":"comorbidity 0.5.0","title":"comorbidity 0.5.0","text":"CRAN release: 2019-08-20 comorbidity now 10+ times faster, thanks Jonathan Williman contributing code based data.table package; Fixed typo vignette regarding weighting algorithm AHRQ Elixhauser comorbidity score (#14, thanks @cornflakegrl); Added pkgdown website: https://ellessenne.github.io/comorbidity.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-041","dir":"Changelog","previous_headings":"","what":"comorbidity 0.4.1","title":"comorbidity 0.4.1","text":"CRAN release: 2019-06-27 Fixed bug regex patterns (#10, thanks @francisco003 reporting @salmasian pull request).","code":""},{"path":[]},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"BREAKING CHANGES","title":"comorbidity 0.4.0","text":"Modified behaviour assign0 argument discussion Anders Alexandersson Issue #9: now default, forcing user decide whether apply hierarchy comorbidity codes . make algorithm transparent end user, allowing informed choice. See ?comorbidity::comorbidity vignette(\"comorbidityscores\", package = \"comorbidity\") details hierarchy applied.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-030","dir":"Changelog","previous_headings":"","what":"comorbidity 0.3.0","title":"comorbidity 0.3.0","text":"CRAN release: 2019-03-22","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"BREAKING CHANGES","title":"comorbidity 0.3.0","text":"comorbidity now returns two Elixhauser scores, one computed using algorithm van Walraven et al. (2009) second one computed using AHRQ algorithm (Moore et al., 2017). Thanks Yumiko Abe-Jones feedback discussion regarding weighted Elixhauser scores. information can found package vignette: vignette(\"comorbidityscores\", package = \"comorbidity\").","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-021","dir":"Changelog","previous_headings":"","what":"comorbidity 0.2.1","title":"comorbidity 0.2.1","text":"Fixed bug weighting algorithm Elixhauser comorbidity score; assign0 argument comorbidity now defaults FALSE; assign0 now explains details hierarchy comorbidities applied; added reference package vignette comorbidity scores weighting algorithms explained detail.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-020","dir":"Changelog","previous_headings":"","what":"comorbidity 0.2.0","title":"comorbidity 0.2.0","text":"CRAN release: 2018-10-08 comorbidity faster, conservative estimated speed->60%; Lots internal housekeeping; Fixed broken GitHub links R script used generate datasets bundled comorbidity.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"BREAKING CHANGES","title":"comorbidity 0.2.0","text":"score argument comorbidity split score icd. instance, command comorbidity(x = x, id = \"id\", code = \"code\", score = \"charlson_icd10\") modified r comorbidity(x = x, id = \"id\", code = \"code\", score = \"charlson\", icd = \"icd10\"). default value icd icd10, ICD-10 codes, possible values icd10 icd9.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-013","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.3","title":"comorbidity 0.1.3","text":"Added nhds2010 australia10 datasets, imported Stata version 15. Bug fix: * Fixed bug regex ICD10 Charlson score; * Fixed bug regex ICD10 Elixhauser score.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-012","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.2","title":"comorbidity 0.1.2","text":"Added ICD10-CM data (version 2017 2018).","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-011","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.1","title":"comorbidity 0.1.1","text":"CRAN release: 2018-03-30 Documented variables missing among returned comorbidity() (@corinne-riddell, #5); Added CITATION file: citation(\"comorbidity\") now returns properly formatted entry.","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-010","dir":"Changelog","previous_headings":"","what":"comorbidity 0.1.0","title":"comorbidity 0.1.0","text":"CRAN release: 2018-03-07 Added support ICD-9-CM version Charlson Elixhauser scores Added vignette information scores computed comorbidity sample_diag_icd10() function renamed back sample_diag(), now can simulate ICD-9-CM codes ","code":""},{"path":"https://ellessenne.github.io/comorbidity/news/index.html","id":"comorbidity-003","dir":"Changelog","previous_headings":"","what":"comorbidity 0.0.3","title":"comorbidity 0.0.3","text":"CRAN release: 2018-01-08 Added datasets icd10_2009 icd10_2011 ICD-10 codes, 2009 2011 versions (respectively) sample_diag now sample_diag_icd10 simulates proper ICD-10 codes Added Elixhauser comorbidity score Renamed package comorbidity now can compute just Charlson score Added formal testing: codes Charlson score properly identified Added formal testing: codes Elixhauser score properly identified","code":""}]
From 3258f4d830ea38e7a341fa08860e28a192e8ceaa Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 6 Apr 2022 16:31:26 +0200
Subject: [PATCH 03/17] Updated cran-comments.md
---
cran-comments.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cran-comments.md b/cran-comments.md
index 9d4070f..376717c 100644
--- a/cran-comments.md
+++ b/cran-comments.md
@@ -1,6 +1,6 @@
## Test environments
-* local R installation, R 4.1.2, Intel-based macOS Big Sur 11.6.2
+* local R installation, R 4.1.3, Intel-based macOS Monterey 12.3.1
* ubuntu-latest (via GitHub Actions, devel, release, oldrel, 3.5, 3.4)
* windows-latest (via GitHub Actions, devel, release, oldrel, 3.5, 3.4)
* macos-latest (via GitHub Actions, release, oldrel)
From d1b2f3188c4d231b4337e0dde38b2ac39e1ff625 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 6 Apr 2022 17:14:49 +0200
Subject: [PATCH 04/17] Increment version number to 1.0.2.9000
---
DESCRIPTION | 2 +-
NEWS.md | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 4def065..ae3f42b 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Type: Package
Package: comorbidity
-Version: 1.0.2
+Version: 1.0.2.9000
Title: Computing Comorbidity Scores
Description: Computing comorbidity indices and scores such as the weighted Charlson
score (Charlson, 1987 ) and the Elixhauser
diff --git a/NEWS.md b/NEWS.md
index 7de9163..e97ea9e 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,5 @@
+# comorbidity (development version)
+
# comorbidity 1.0.2
* The `copd` and `ami` comorbidities for the Charlson index have been renamed to `cpd` and `mi`, respectively (#53, thanks @DrYan1102). Please be aware that this might break some old code if you were selecting comorbidities by name.
From 82215408271db0a336c3f9163f242c47992c8a86 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 27 Apr 2022 10:18:59 +0200
Subject: [PATCH 05/17] Added reprex for #55
---
testing.R | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/testing.R b/testing.R
index cff5f84..dfc87e9 100644
--- a/testing.R
+++ b/testing.R
@@ -58,3 +58,17 @@ reprex::reprex({
x1
})
+
+
+# #55
+devtools::load_all()
+
+library(comorbidity)
+set.seed(1)
+x <- data.frame(
+ id = sample(1:15, size = 200, replace = TRUE),
+ code = sample_diag(200),
+ stringsAsFactors = FALSE
+)
+x$id <- as.character(x$id)
+comorbidity(x = x, id = "id", code = "code", map = "charlson_icd10_quan", assign0 = FALSE)
From 6f5524ddaaa7be74dc8b2b1084f648d4958f47f1 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 27 Apr 2022 13:47:00 +0200
Subject: [PATCH 06/17] Removed some stray comments
---
R/comorbidity.R | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/R/comorbidity.R b/R/comorbidity.R
index 1e97210..fbf31dd 100644
--- a/R/comorbidity.R
+++ b/R/comorbidity.R
@@ -112,22 +112,6 @@
#' @export
comorbidity <- function(x, id, code, map, assign0, labelled = TRUE, tidy.codes = TRUE) {
- # set.seed(1)
- # x <- data.frame(
- # id = 1,
- # code = sample_diag(10),
- # stringsAsFactors = FALSE
- # )
- # xa <- data.frame(id = 1:2, code = NA_character_)
- # xm <- rbind(x, xa)
- #
- # x = xm
- # id = "id"
- # code = "code"
- # map = "charlson_icd10_quan"
- # assign0 = FALSE
- # labelled = T
- # tidy.codes = T
### Check arguments
arg_checks <- checkmate::makeAssertCollection()
# x must be a data.frame (or a data.table)
From 8720df822bad22d7937bf336e9d5a9efe95f8d8e Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 27 Apr 2022 13:47:25 +0200
Subject: [PATCH 07/17] Possibly fixed issues with non-numeric IDs
---
R/matchit.R | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/R/matchit.R b/R/matchit.R
index 20d1e59..a7611e7 100644
--- a/R/matchit.R
+++ b/R/matchit.R
@@ -28,8 +28,8 @@
if (!is.null(x[["NA"]])) x[, `NA` := NULL]
### Restore IDs
- x <- merge(x, backup, by = id, all.y = TRUE, )
- data.table::setnafill(x = x, type = "const", fill = 0L)
+ x <- merge(x, backup, by = id, all.y = TRUE)
+ data.table::setnafill(x = x, type = "const", fill = 0L, cols = which(names(x) != id))
### Add missing columns
for (col in names(regex)) {
From de397214490edbac2cc0048b4260e8b368e4ddea Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Wed, 27 Apr 2022 13:53:13 +0200
Subject: [PATCH 08/17] Added some tests for #55
---
testing.R | 18 ++++++++++++++++--
tests/testthat/test-#55.R | 32 ++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 2 deletions(-)
create mode 100644 tests/testthat/test-#55.R
diff --git a/testing.R b/testing.R
index dfc87e9..a024a73 100644
--- a/testing.R
+++ b/testing.R
@@ -62,8 +62,6 @@ reprex::reprex({
# #55
devtools::load_all()
-
-library(comorbidity)
set.seed(1)
x <- data.frame(
id = sample(1:15, size = 200, replace = TRUE),
@@ -72,3 +70,19 @@ x <- data.frame(
)
x$id <- as.character(x$id)
comorbidity(x = x, id = "id", code = "code", map = "charlson_icd10_quan", assign0 = FALSE)
+
+
+set.seed(1)
+x <- data.frame(
+ id = sample(1:15, size = 200, replace = TRUE),
+ code = sample_diag(200),
+ stringsAsFactors = FALSE
+)
+x$id <- as.character(x$id)
+x$code[x$id == "1"] <- NA_character_
+id <- "id"
+code <- "code"
+map <- "charlson_icd10_quan"
+assign0 <- FALSE
+labelled <- TRUE
+tidy.codes <- TRUE
diff --git a/tests/testthat/test-#55.R b/tests/testthat/test-#55.R
new file mode 100644
index 0000000..009c575
--- /dev/null
+++ b/tests/testthat/test-#55.R
@@ -0,0 +1,32 @@
+context("issue #55")
+
+test_that("character id is supported", {
+ n <- 15
+ N <- 100
+ x <- data.frame(
+ id = sample(seq(n), size = N, replace = TRUE),
+ code = sample_diag(N)
+ )
+ x$id <- as.character(x$id)
+ cmb <- comorbidity(x = x, id = "id", code = "code", map = "charlson_icd10_quan", assign0 = FALSE)
+ testthat::expect_equal(object = nrow(cmb), expected = n)
+ testthat::expect_s3_class(object = cmb, class = "data.frame")
+})
+
+test_that("character vs integer id makes no difference", {
+ for (times in seq(50)) {
+ n <- 5
+ N <- 50
+ x <- data.frame(
+ id = sample(seq(n), size = N, replace = TRUE),
+ code = sample_diag(N)
+ )
+ cmb1 <- comorbidity(x = x, id = "id", code = "code", map = "charlson_icd10_quan", assign0 = FALSE)
+ x$id <- as.character(x$id)
+ cmb2 <- comorbidity(x = x, id = "id", code = "code", map = "charlson_icd10_quan", assign0 = FALSE)
+ cmb1 <- cmb1[sort(cmb2$id), ]
+ row.names(cmb1) <- NULL
+ row.names(cmb2) <- NULL
+ testthat::expect_equal(object = cmb1[, -which(names(cmb1) == "id")], expected = cmb2[, -which(names(cmb2) == "id")])
+ }
+})
From fdb9d85886488a3709aca2550fdbb892c8602332 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Tue, 12 Jul 2022 11:12:29 +0200
Subject: [PATCH 09/17] Roxygen version bump
---
DESCRIPTION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index ae3f42b..a571d86 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -52,7 +52,7 @@ Suggests:
rmarkdown,
testthat
Roxygen: list(markdown = TRUE)
-RoxygenNote: 7.1.2
+RoxygenNote: 7.2.0
Encoding: UTF-8
LazyData: true
ByteCompile: true
From 039888856f33246d97969f68623da4ec799af310 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Tue, 12 Jul 2022 11:15:59 +0200
Subject: [PATCH 10/17] Extra tests for #55
---
tests/testthat/test-#55.R | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tests/testthat/test-#55.R b/tests/testthat/test-#55.R
index 009c575..910d69e 100644
--- a/tests/testthat/test-#55.R
+++ b/tests/testthat/test-#55.R
@@ -30,3 +30,16 @@ test_that("character vs integer id makes no difference", {
testthat::expect_equal(object = cmb1[, -which(names(cmb1) == "id")], expected = cmb2[, -which(names(cmb2) == "id")])
}
})
+
+test_that("character id with extra columns", {
+ n <- 15
+ N <- 100
+ x <- data.frame(
+ id = sample(seq(n), size = N, replace = TRUE),
+ code = sample_diag(N)
+ )
+ x$id <- as.character(x$id)
+ cmb <- comorbidity(x = x, id = "id", code = "code", map = "charlson_icd10_quan", assign0 = FALSE)
+ testthat::expect_equal(object = nrow(cmb), expected = n)
+ testthat::expect_s3_class(object = cmb, class = "data.frame")
+})
From d6e03e82109efc2b6d661ce5e39f84f261f7bf6d Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Tue, 12 Jul 2022 11:16:12 +0200
Subject: [PATCH 11/17] Updated NEWS
---
NEWS.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/NEWS.md b/NEWS.md
index e97ea9e..c883446 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,7 @@
# comorbidity (development version)
+* Fixed a bug that did not allowed ID columns other than numeric (#55, thanks @norihikorihiko for reporting this).
+
# comorbidity 1.0.2
* The `copd` and `ami` comorbidities for the Charlson index have been renamed to `cpd` and `mi`, respectively (#53, thanks @DrYan1102). Please be aware that this might break some old code if you were selecting comorbidities by name.
From d0e1361155220764b481675e0d0285a4c735bda0 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Tue, 12 Jul 2022 11:20:30 +0200
Subject: [PATCH 12/17] Version bump
---
DESCRIPTION | 2 +-
NEWS.md | 2 +-
R/zzz.R | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index a571d86..2e2f537 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Type: Package
Package: comorbidity
-Version: 1.0.2.9000
+Version: 1.0.3
Title: Computing Comorbidity Scores
Description: Computing comorbidity indices and scores such as the weighted Charlson
score (Charlson, 1987 ) and the Elixhauser
diff --git a/NEWS.md b/NEWS.md
index c883446..c9d89c9 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,4 @@
-# comorbidity (development version)
+# comorbidity 1.0.3
* Fixed a bug that did not allowed ID columns other than numeric (#55, thanks @norihikorihiko for reporting this).
diff --git a/R/zzz.R b/R/zzz.R
index 5bacb14..d6101a6 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -1,8 +1,8 @@
.onAttach <- function(libname, pkgname) {
- tick <- stats::rbinom(n = 1, size = 1, prob = 0.4)
+ tick <- stats::rbinom(n = 1, size = 1, prob = 0.3)
if (tick == 1) {
- packageStartupMessage("This is {comorbidity} version 1.0.2.")
- packageStartupMessage("A lot has changed since the last release on CRAN, please check-out breaking changes here:")
+ packageStartupMessage("This is {comorbidity} version 1.0.3.")
+ packageStartupMessage("A lot has changed since the pre-1.0.0 release on CRAN, please check-out breaking changes here:")
packageStartupMessage("-> https://ellessenne.github.io/comorbidity/articles/C-changes.html")
}
}
From 92a430d03230854f1fe056ae9c8c17f72bd218e7 Mon Sep 17 00:00:00 2001
From: Alessandro Gasparini
Date: Tue, 12 Jul 2022 11:22:14 +0200
Subject: [PATCH 13/17] Rebuilt documentation
---
README.md | 5 +-
docs/404.html | 5 +-
docs/CONDUCT.html | 62 +--
docs/CONTRIBUTING.html | 36 +-
docs/LICENSE.html | 533 +++-----------------
docs/articles/A-introduction.html | 126 +++--
docs/articles/B-comorbidity-scores.html | 9 +-
docs/articles/C-changes.html | 193 ++++---
docs/articles/index.html | 8 +-
docs/authors.html | 5 +-
docs/deps/bootstrap-5.1.0/bootstrap.min.css | 2 +-
docs/index.html | 408 +++++++--------
docs/news/index.html | 160 ++----
docs/pkgdown.js | 2 +-
docs/pkgdown.yml | 4 +-
docs/reference/australia10.html | 7 +-
docs/reference/available_algorithms.html | 9 +-
docs/reference/comorbidity-package.html | 23 +-
docs/reference/comorbidity.html | 52 +-
docs/reference/icd10_2009.html | 7 +-
docs/reference/icd10_2011.html | 7 +-
docs/reference/icd10cm_2017.html | 7 +-
docs/reference/icd10cm_2018.html | 7 +-
docs/reference/icd10cm_2022.html | 7 +-
docs/reference/icd9_2015.html | 7 +-
docs/reference/index.html | 5 +-
docs/reference/nhds2010.html | 7 +-
docs/reference/sample_diag.html | 36 +-
docs/reference/score.html | 44 +-
docs/search.json | 2 +-
30 files changed, 633 insertions(+), 1152 deletions(-)
diff --git a/README.md b/README.md
index 95d3cbb..01ed914 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
# The {comorbidity} Package: Computing Comorbidity Scores
-Last updated: 2022-04-06
+Last updated: 2022-07-12
@@ -48,9 +48,6 @@ For instance, we could simulate ICD-10 codes:
``` r
# load the comorbidity package
library(comorbidity)
-## This is {comorbidity} version 1.0.2.
-## A lot has changed since the last release on CRAN, please check-out breaking changes here:
-## -> https://ellessenne.github.io/comorbidity/articles/C-changes.html
# set a seed for reproducibility
set.seed(1)
# simulate 50 ICD-10 codes for 5 individuals
diff --git a/docs/404.html b/docs/404.html
index 29c680d..449209e 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -24,7 +24,7 @@
comorbidity
- 1.0.2
+ 1.0.3
If you want to contribute to a project and make it better, your help
-is very welcome.
-
For small, simple changes such as fixing typos you can edit any file
-directly from GitHub by clicking the Edit button after
-opening it. For more complicated changes, you will have to manually
-create a pull
-request (PR) after forking this
-repository. See the next section for more information.
-
If you submit a non-trivial pull request (e.g. not just fixing a
-typo), you may add your name to the Authors@R field as a
-contributor (ctb) in the R package DESCRIPTION
-file if you wish.
+
If you want to contribute to a project and make it better, your help is very welcome.
+
For small, simple changes such as fixing typos you can edit any file directly from GitHub by clicking the Edit button after opening it. For more complicated changes, you will have to manually create a pull request (PR) after forking this repository. See the next section for more information.
+
If you submit a non-trivial pull request (e.g. not just fixing a typo), you may add your name to the Authors@R field as a contributor (ctb) in the R package DESCRIPTION file if you wish.
Pull Request Workflow
-
Create a personal fork of the project on Github, and clone the fork
-on your local machine;
+
Create a personal fork of the project on Github, and clone the fork on your local machine;
Create a new branch to work on;
Implement/fix your feature, comment your code;
Follow the code style of the project, including indentation;
Add or change the documentation as needed. Please do not run
-roxygen2, and do not include changes in .Rd
-files in your pull request - I will re-roxygenise the documentation
-myself;
+
Add or change the documentation as needed. Please do not run roxygen2, and do not include changes in .Rd files in your pull request - I will re-roxygenise the documentation myself;
Push your branch to your fork on Github;
From your fork open a pull request in the correct branch.
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
-
Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/ Everyone is
-permitted to copy and distribute verbatim copies of this license
-document, but changing it is not allowed.
+
Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
-
The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program–to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
For the developers’ and authors’ protection, the GPL clearly explains
-that there is no warranty for this free software. For both users’ and
-authors’ sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of protecting
-users’ freedom to change the software. The systematic pattern of such
-abuse occurs in the area of products for individuals to use, which is
-precisely where it is most unacceptable. Therefore, we have designed
-this version of the GPL to prohibit the practice for those products. If
-such problems arise substantially in other domains, we stand ready to
-extend this provision to those domains in future versions of the GPL, as
-needed to protect the freedom of users.
-
Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
The precise terms and conditions for copying, distribution and
-modification follow.
+
The GNU General Public License is a free, copyleft license for software and other kinds of works.
+
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program–to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
+
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
+
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
+
For the developers’ and authors’ protection, the GPL clearly explains that there is no warranty for this free software. For both users’ and authors’ sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
+
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
+
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
+
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
Definitions.
-
“This License” refers to version 3 of the GNU General Public
-License.
-
“Copyright” also means copyright-like laws that apply to other kinds
-of works, such as semiconductor masks.
-
“The Program” refers to any copyrightable work licensed under this
-License. Each licensee is addressed as “you”. “Licensees” and
-“recipients” may be individuals or organizations.
-
To “modify” a work means to copy from or adapt all or part of the
-work in a fashion requiring copyright permission, other than the making
-of an exact copy. The resulting work is called a “modified version” of
-the earlier work or a work “based on” the earlier work.
-
A “covered work” means either the unmodified Program or a work based
-on the Program.
-
To “propagate” a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
To “convey” a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
An interactive user interface displays “Appropriate Legal Notices” to
-the extent that it includes a convenient and prominently visible feature
-that (1) displays an appropriate copyright notice, and (2) tells the
-user that there is no warranty for the work (except to the extent that
-warranties are provided), that licensees may convey the work under this
-License, and how to view a copy of this License. If the interface
-presents a list of user commands or options, such as a menu, a prominent
-item in the list meets this criterion.
+
“This License” refers to version 3 of the GNU General Public License.
+
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
+
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
+
A “covered work” means either the unmodified Program or a work based on the Program.
+
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
Source Code.
-
The “source code” for a work means the preferred form of the work for
-making modifications to it. “Object code” means any non-source form of a
-work.
-
A “Standard Interface” means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that is
-widely used among developers working in that language.
-
The “System Libraries” of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that Major
-Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A “Major
-Component”, in this context, means a major essential component (kernel,
-window system, and so on) of the specific operating system (if any) on
-which the executable work runs, or a compiler used to produce the work,
-or an object code interpreter used to run it.
-
The “Corresponding Source” for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work’s System
-Libraries, or general-purpose tools or generally available free programs
-which are used unmodified in performing those activities but which are
-not part of the work. For example, Corresponding Source includes
-interface definition files associated with source files for the work,
-and the source code for shared libraries and dynamically linked
-subprograms that the work is specifically designed to require, such as
-by intimate data communication or control flow between those subprograms
-and other parts of the work.
-
The Corresponding Source need not include anything that users can
-regenerate automatically from other parts of the Corresponding
-Source.
-
The Corresponding Source for a work in source code form is that same
-work.
+
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
+
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work’s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
The Corresponding Source for a work in source code form is that same work.
Basic Permissions.
-
All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright
-law.
-
You may make, run and propagate covered works that you do not convey,
-without conditions so long as your license otherwise remains in force.
-You may convey covered works to others for the sole purpose of having
-them make modifications exclusively for you, or provide you with
-facilities for running those works, provided that you comply with the
-terms of this License in conveying all material for which you do not
-control copyright. Those thus making or running the covered works for
-you must do so exclusively on your behalf, under your direction and
-control, on terms that prohibit them from making any copies of your
-copyrighted material outside their relationship with you.
-
Conveying under any other circumstances is permitted solely under the
-conditions stated below. Sublicensing is not allowed; section 10 makes
-it unnecessary.
+
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
Protecting Users’ Legal Rights From Anti-Circumvention Law.
-
No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article 11
-of the WIPO copyright treaty adopted on 20 December 1996, or similar
-laws prohibiting or restricting circumvention of such measures.
-
When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to the
-covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work’s
-users, your or third parties’ legal rights to forbid circumvention of
-technological measures.
+
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work’s users, your or third parties’ legal rights to forbid circumvention of technological measures.
Conveying Verbatim Copies.
-
You may convey verbatim copies of the Program’s source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice; keep
-intact all notices stating that this License and any non-permissive
-terms added in accord with section 7 apply to the code; keep intact all
-notices of the absence of any warranty; and give all recipients a copy
-of this License along with the Program.
-
You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
+
You may convey verbatim copies of the Program’s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
Conveying Modified Source Versions.
-
You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the terms
-of section 4, provided that you also meet all of these conditions:
+
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modifiedit, and giving a relevant date.
@@ -245,20 +116,9 @@
Appropriate Legal Notices; however, if the Program has interactiveinterfaces that do not display Appropriate Legal Notices, yourwork need not make them do so.
-
A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work, and
-which are not combined with it such as to form a larger program, in or
-on a volume of a storage or distribution medium, is called an
-“aggregate” if the compilation and its resulting copyright are not used
-to limit the access or legal rights of the compilation’s users beyond
-what the individual works permit. Inclusion of a covered work in an
-aggregate does not cause this License to apply to the other parts of the
-aggregate.
+
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
Conveying Non-Source Forms.
-
You may convey a covered work in object code form under the terms of
-sections 4 and 5, provided that you also convey the machine-readable
-Corresponding Source under the terms of this License, in one of these
-ways:
+
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product(including a physical distribution medium), accompanied by theCorresponding Source fixed on a durable physical medium
@@ -299,70 +159,16 @@
you inform other peers where the object code and CorrespondingSource of the work are being offered to the general public at nocharge under subsection 6d.
-
A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be included
-in conveying the object code work.
-
A “User Product” is either (1) a “consumer product”, which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for
-incorporation into a dwelling. In determining whether a product is a
-consumer product, doubtful cases shall be resolved in favor of coverage.
-For a particular product received by a particular user, “normally used”
-refers to a typical or common use of that class of product, regardless
-of the status of the particular user or of the way in which the
-particular user actually uses, or expects or is expected to use, the
-product. A product is a consumer product regardless of whether the
-product has substantial commercial, industrial or non-consumer uses,
-unless such uses represent the only significant mode of use of the
-product.
-
“Installation Information” for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product
-from a modified version of its Corresponding Source. The information
-must suffice to ensure that the continued functioning of the modified
-object code is in no case prevented or interfered with solely because
-modification has been made.
-
If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied by
-the Installation Information. But this requirement does not apply if
-neither you nor any third party retains the ability to install modified
-object code on the User Product (for example, the work has been
-installed in ROM).
-
The requirement to provide Installation Information does not include
-a requirement to continue to provide support service, warranty, or
-updates for a work that has been modified or installed by the recipient,
-or for the User Product in which it has been modified or installed.
-Access to a network may be denied when the modification itself
-materially and adversely affects the operation of the network or
-violates the rules and protocols for communication across the
-network.
-
Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in source
-code form), and must require no special password or key for unpacking,
-reading or copying.
+
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
Additional Terms.
-
“Additional permissions” are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by this
-License without regard to the additional permissions.
-
When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own removal
-in certain cases when you modify the work.) You may place additional
-permissions on material, added by you to a covered work, for which you
-have or can give appropriate copyright permission.
-
Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders
-of that material) supplement the terms of this License with terms:
+
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from theterms of sections 15 and 16 of this License; or
@@ -385,212 +191,49 @@
it) with contractual assumptions of liability to the recipient, forany liability that these contractual assumptions directly impose onthose licensors and authors.
-
All other non-permissive additional terms are considered “further
-restrictions” within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains a
-further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms of
-that license document, provided that the further restriction does not
-survive such relicensing or conveying.
-
If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the additional
-terms that apply to those files, or a notice indicating where to find
-the applicable terms.
-
Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions; the above
-requirements apply either way.
+
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
Termination.
-
You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after your
-receipt of the notice.
-
Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
+
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
Acceptance Not Required for Having Copies.
-
You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission to
-receive a copy likewise does not require acceptance. However, nothing
-other than this License grants you permission to propagate or modify any
-covered work. These actions infringe copyright if you do not accept this
-License. Therefore, by modifying or propagating a covered work, you
-indicate your acceptance of this License to do so.
+
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
Automatic Licensing of Downstream Recipients.
-
Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
An “entity transaction” is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered work
-results from an entity transaction, each party to that transaction who
-receives a copy of the work also receives whatever licenses to the work
-the party’s predecessor in interest had or could give under the previous
-paragraph, plus a right to possession of the Corresponding Source of the
-work from the predecessor in interest, if the predecessor has it or can
-get it with reasonable efforts.
-
You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may not
-impose a license fee, royalty, or other charge for exercise of rights
-granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that any
-patent claim is infringed by making, using, selling, offering for sale,
-or importing the Program or any portion of it.
+
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party’s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
Patents.
-
A “contributor” is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The work
-thus licensed is called the contributor’s “contributor version”.
-
A contributor’s “essential patent claims” are all patent claims owned
-or controlled by the contributor, whether already acquired or hereafter
-acquired, that would be infringed by some manner, permitted by this
-License, of making, using, or selling its contributor version, but do
-not include claims that would be infringed only as a consequence of
-further modification of the contributor version. For purposes of this
-definition, “control” includes the right to grant patent sublicenses in
-a manner consistent with the requirements of this License.
-
Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor’s essential patent claims, to make,
-use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
In the following three paragraphs, a “patent license” is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To “grant” such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone to
-copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. “Knowingly relying” means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient’s use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify or
-convey a specific copy of the covered work, then the patent license you
-grant is automatically extended to all recipients of the covered work
-and works based on it.
-
A patent license is “discriminatory” if it does not include within
-the scope of its coverage, prohibits the exercise of, or is conditioned
-on the non-exercise of one or more of the rights that are specifically
-granted under this License. You may not convey a covered work if you are
-a party to an arrangement with a third party that is in the business of
-distributing software, under which you make payment to the third party
-based on the extent of your activity of conveying the work, and under
-which the third party grants, to any of the parties who would receive
-the covered work from you, a discriminatory patent license (a) in
-connection with copies of the covered work conveyed by you (or copies
-made from those copies), or (b) primarily for and in connection with
-specific products or compilations that contain the covered work, unless
-you entered into that arrangement, or that patent license was granted,
-prior to 28 March 2007.
-
Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may otherwise
-be available to you under applicable patent law.
+
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor’s “contributor version”.
+
A contributor’s “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor’s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient’s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
No Surrender of Others’ Freedom.
-
If conditions are imposed on you (whether by court order, agreement
-or otherwise) that contradict the conditions of this License, they do
-not excuse you from the conditions of this License. If you cannot convey
-a covered work so as to satisfy simultaneously your obligations under
-this License and any other pertinent obligations, then as a consequence
-you may not convey it at all. For example, if you agree to terms that
-obligate you to collect a royalty for further conveying from those to
-whom you convey the Program, the only way you could satisfy both those
-terms and this License would be to refrain entirely from conveying the
-Program.
+
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
Use with the GNU Affero General Public License.
-
Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
+
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
Revised Versions of this License.
-
The Free Software Foundation may publish revised and/or new versions
-of the GNU General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in
-detail to address new problems or concerns.
-
Each version is given a distinguishing version number. If the Program
-specifies that a certain numbered version of the GNU General Public
-License “or any later version” applies to it, you have the option of
-following the terms and conditions either of that numbered version or of
-any later version published by the Free Software Foundation. If the
-Program does not specify a version number of the GNU General Public
-License, you may choose any version ever published by the Free Software
-Foundation.
-
If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy’s
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
+
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
+
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
Disclaimer of Warranty.
-
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT
-WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
-THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
Limitation of Liability.
-
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
-CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
-NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
-SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
-WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Interpretation of Sections 15 and 16.
-
If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates an
-absolute waiver of all civil liability in connection with the Program,
-unless a warranty or assumption of liability accompanies a copy of the
-Program in return for a fee.
+
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs
-
If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
-
To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least the
-“copyright” line and a pointer to where the full notice is found.
+
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>Copyright (C) <year> <name of author>
@@ -606,28 +249,15 @@
You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.
-
Also add information on how to contact you by electronic and paper
-mail.
-
If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
+
Also add information on how to contact you by electronic and paper mail.
+
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program>Copyright (C) <year><name of author>This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.This is free software, and you are welcome to redistribute itunder certain conditions; type `show c' for details.
-
The hypothetical commands show w' andshow c’ should show
-the appropriate parts of the General Public License. Of course, your
-program’s commands might be different; for a GUI interface, you would
-use an “about box”.
-
You should also get your employer (if you work as a programmer) or
-school, if any, to sign a “copyright disclaimer” for the program, if
-necessary. For more information on this, and how to apply and follow the
-GNU GPL, see http://www.gnu.org/licenses/.
-
The GNU General Public License does not permit incorporating your
-program into proprietary programs. If your program is a subroutine
-library, you may consider it more useful to permit linking proprietary
-applications with the library. If this is what you want to do, use the
-GNU Lesser General Public License instead of this License. But first,
-please read http://www.gnu.org/philosophy/why-not-lgpl.html.
+
The hypothetical commands show w' andshow c’ should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.
+
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/.
+
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html.
The resulting data frame has a row per subject, a column for IDs, and
a column for each condition included in a given score (e.g. 17
conditions for the Charlson score).
The different columns are also labelled for compatibility with the
RStudio viewer, see e.g. View(charlson_df) after running
the code above on your computer.
To see all supported mapping algorithms, please see the vignette:
This yields unweighted scores (e.g. equivalent to the
score column above). If we need weighted scores (e.g. the
wscore column above, which assumes the old Charlson score
weights from 1987), we can pass the name of a supported scoring
algorithm:
The {comorbidity} Package: Computing Comorbidity Scores
-
+
The {comorbidity} Package: Computing Comorbidity Scores
-
Last updated: 2022-04-06
+
Last updated: 2022-07-12
-
comorbidity is an R package for computing comorbidity
-scores such as the weighted Charlson score and the Elixhauser
-comorbidity score; both ICD-10 and ICD-9 coding systems are
-supported.
+
comorbidity is an R package for computing comorbidity scores such as the weighted Charlson score and the Elixhauser comorbidity score; both ICD-10 and ICD-9 coding systems are supported.
Installation
-
comorbidity is on CRAN. You can install it as usual
-with:
+
comorbidity is on CRAN. You can install it as usual with:
The comorbidity packages includes a function named
-sample_diag() that allows simulating ICD diagnostic codes
-in a straightforward way. For instance, we could simulate ICD-10
-codes:
+
The comorbidity packages includes a function named sample_diag() that allows simulating ICD diagnostic codes in a straightforward way. For instance, we could simulate ICD-10 codes:
-# load the comorbidity package
-library(comorbidity)
-## This is {comorbidity} version 1.0.2.
-## A lot has changed since the last release on CRAN, please check-out breaking changes here:
-## -> https://ellessenne.github.io/comorbidity/articles/C-changes.html
-# set a seed for reproducibility
-set.seed(1)
-# simulate 50 ICD-10 codes for 5 individuals
-x<-data.frame(
- id =sample(1:5, size =50, replace =TRUE),
- code =sample_diag(n =50)
-)
-x<-x[order(x$id, x$code), ]
-print(head(x, n =15), row.names =FALSE)
-## id code
-## 1 B02
-## 1 B582
-## 1 I749
-## 1 J450
-## 1 L893
-## 1 Q113
-## 1 Q26
-## 1 Q978
-## 1 T224
-## 1 V101
-## 1 V244
-## 1 V46
-## 2 A665
-## 2 C843
-## 2 D838
-
It is also possible to simulate from two different versions of the
-ICD-10 coding system. The default is to simulate ICD-10 codes from the
-2011 version:
It is also possible to simulate from two different versions of the ICD-10 coding system. The default is to simulate ICD-10 codes from the 2011 version:
The main function of the comorbidity package is named
-comorbidity(), and it can be used to compute any supported
-comorbidity score; scores can be specified by setting the
-score argument, which is required.
-
Say we have 3 individuals with a total of 30 ICD-10 diagnostic
-codes:
+
The main function of the comorbidity package is named comorbidity(), and it can be used to compute any supported comorbidity score; scores can be specified by setting the score argument, which is required.
+
Say we have 3 individuals with a total of 30 ICD-10 diagnostic codes:
If you find comorbidity useful, please cite it in your
-publications:
+
If you find comorbidity useful, please cite it in your publications:
-citation("comorbidity")
-##
-## To cite the comorbidity package in publications, please use:
-##
-## Gasparini, (2018). comorbidity: An R package for computing comorbidity scores. Journal
-## of Open Source Software, 3(23), 648, https://doi.org/10.21105/joss.00648
-##
-## A BibTeX entry for LaTeX users is
-##
-## @Article{,
-## author = {Alessandro Gasparini},
-## title = {comorbidity: An R package for computing comorbidity scores},
-## journal = {Journal of Open Source Software},
-## year = {2018},
-## volume = {3},
-## issue = {23},
-## pages = {648},
-## doi = {10.21105/joss.00648},
-## url = {https://doi.org/10.21105/joss.00648},
-## }
+citation("comorbidity")
+##
+## To cite the comorbidity package in publications, please use:
+##
+## Gasparini, (2018). comorbidity: An R package for computing comorbidity scores. Journal
+## of Open Source Software, 3(23), 648, https://doi.org/10.21105/joss.00648
+##
+## A BibTeX entry for LaTeX users is
+##
+## @Article{,
+## author = {Alessandro Gasparini},
+## title = {comorbidity: An R package for computing comorbidity scores},
+## journal = {Journal of Open Source Software},
+## year = {2018},
+## volume = {3},
+## issue = {23},
+## pages = {648},
+## doi = {10.21105/joss.00648},
+## url = {https://doi.org/10.21105/joss.00648},
+## }
References
-
More details on which comorbidity mapping and scoring algorithm are
-available within the package can be found in the two accompanying
-vignettes, which can be accessed on CRAN or directly from your R
-session:
+
More details on which comorbidity mapping and scoring algorithm are available within the package can be found in the two accompanying vignettes, which can be accessed on CRAN or directly from your R session: