Closed cornflakegrl closed 4 years ago
Hi, the code 583.0 is actually detected using the latest version of comorbidity
(0.4.1):
library(comorbidity)
data <- data.frame(id = 1, code = "583.0")
comorbidity::comorbidity(x = data, id = "id", code = "code", score = "charlson", icd = "icd9", assign0 = FALSE)
#> id ami chf pvd cevd dementia copd rheumd pud mld diab diabwc hp rend
#> 1 res 0 0 0 0 0 0 0 0 0 0 0 0 1
#> canc msld metacanc aids score index wscore windex
#> 1 0 0 0 0 1 1-2 2 1-2
Created on 2019-07-02 by the reprex package (v0.3.0)
Could you elaborate further on your issue, or provide a reproducible example?
Also, regarding the leading zeros: my understanding is that would be a problem of how the data is recorded or am I misunderstanding the issue?
Here is my raw data. The DX tab has the patient id, dx code and cci and eci categories. The CCI tab has the scores that I calculated. Please calculate the scores for my data and compare. comorbid_error.xlsx
I am still not sure what is the problem, could you provide more information? What are the differences that you think are wrong?
Take a look at the Compare tab. I have highlighted the places where your calculation differs from mine. comorbid_error.xlsx
I had a look at it and:
comorbidity
on your data differs from what is in your Excel file, see:library(readxl)
library(comorbidity)
df <- readxl::read_excel(path = "~/Downloads/comorbid_error-2.xlsx")
#> New names:
#> * `` -> ...5
names(df) <- make.names(names(df))
comorbidity::comorbidity(x = df, id = "PT_ID", code = "ICD.9_CODE", score = "charlson", icd = "icd9", assign0 = FALSE)
#> PT_ID ami chf pvd cevd dementia copd rheumd pud mld diab diabwc hp rend
#> 1 2 0 0 0 0 0 0 0 1 0 0 0 0 1
#> 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 3 4 0 0 0 0 0 0 0 1 0 0 0 0 0
#> 4 112 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 5 141 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 6 153 0 0 0 0 0 1 0 0 0 0 0 0 0
#> canc msld metacanc aids score index wscore windex
#> 1 0 0 0 0 2 1-2 3 3-4
#> 2 0 0 0 0 0 0 0 0
#> 3 0 0 0 0 1 1-2 1 1-2
#> 4 0 0 0 0 0 0 0 0
#> 5 0 0 0 0 0 0 0 0
#> 6 0 0 0 0 1 1-2 1 1-2
Created on 2019-07-04 by the reprex package (v0.3.0)
@cornflakegrl did you sort this out? If so, could you close this issue? Thanks!
CCI: The ICD-9 code 583.0 is not being flagged as a Renal disease (cat 13) Also, ICD9 codes have a leading "0" for codes below 100. I think that codes like 016.72 are being counted as 167.2 because the leading zero was lost.