Skip to content

Commit b8908d4

Browse files
committed
update medicalcoder-vs-comorbidity
1 parent e7d0364 commit b8908d4

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

vignettes/articles/medicalcoder-vs-comorbidity.Rmd

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ packageDescription("comorbidity")$Title
3737
cat(packageDescription("comorbidity")$Description)
3838
```
3939

40+
```{r, include = FALSE}
41+
stopifnot(packageVersion("comorbidity") == "1.1.0")
42+
```
43+
4044
The following table is a partial list of similarities and differences between
4145
medicalcoder and comorbidity.
4246

@@ -697,12 +701,14 @@ cmrb_results <-
697701
698702
elixhauser_delta <-
699703
merge(
700-
x = comorbidity_elixhauser_results,
701-
y = medicalcoder_elixhauser_results,
704+
x = cmrb_results,
705+
y = mdcr_results,
702706
all = TRUE,
703-
by = "patid"
707+
by = "code_id"
704708
)
705709
710+
data.table::setDT(elixhauser_delta)
711+
706712
for (i in seq_len(nrow(elixhauser_columns))) {
707713
x <- elixhauser_columns[["comorbidity"]][i]
708714
y <- elixhauser_columns[["medicalcoder"]][i]
@@ -714,14 +720,23 @@ for (i in seq_len(nrow(elixhauser_columns))) {
714720
print(e)
715721
r <- eval(e)
716722
print(r)
717-
stopifnot(r)
718-
elixhauser_delta[[x]] <- NULL
719-
elixhauser_delta[[y]] <- NULL
723+
if (r) {
724+
elixhauser_delta[[x]] <- NULL
725+
elixhauser_delta[[y]] <- NULL
726+
}
720727
}
721728
```
722729

730+
```{r, include = FALSE}
731+
stopifnot(identical(names(elixhauser_delta), c("code_id", "HTN_C", "num_cmrb", "cmrb_flag", "mortality_index", "readmission_index")))
732+
```
723733

734+
The only differences between the resulting data sets are columns unique to
735+
medicalcoder.
724736

737+
```{r}
738+
str(elixhauser_delta)
739+
```
725740

726741
# Benchmarking
727742

0 commit comments

Comments
 (0)