comorbidity
comorbidity copied to clipboard
Add support for latest AHRQ Elixhauser comorbidity calculation
The way the package calculates the Elixhauser comorbidity is based on previously published literature (Quan et al. and Moore et al.) which is dated. AHRQ continues to update the algorithm every year. While one could use the SAS program from HCUP, it would be ideal to make comorbidity
the R equivalent of it and keep it up to date.
Other related issues are:
- The score (
wscore
) calculated bycomorbidity
is only one of the two scores from Moore et al. (it is the mortality score; there also exists a readmission score). We should allow users to choose which score they want. Alternatively, we should return both, and name the output more accurately (e.g.wscore_ahrq_moratlity
) - To name the output
ahrq
is a bit of a stretch, because current AHRQ algorithm is not what the R code returns. Perhaps we should name it more accurate, e.g.wscore_moore
and then have an additional choice in thecomorbidity()
function'smethod
argument to return the 2019 or 2020 versions which returnswscore_ahrq
. - The newer AHRQ algorithms don't just rely on ICD codes, but also look at DRG codes to capture certain commodities. We should add an optional
drg
argument which names the column that stores the DRG value, and would only be required if the choice ofmethod
iselixhauser_ahrq
. - The
carit
comorbidity has been dropped by AHRQ's latest code altogether.
Of note, my colleague has already created a fork at https://github.com/fiksdala/comorbidity and is working on it. The fork includes a script that can parse the SAS code and automatically generate the corresponding R code. It might be a good idea to use this Issue here to decide on the naming conventions, etc.
Hi @salmasian, thanks for the heads-up.
I have been discussing with @jackwasey about merging comorbidity
and icd
to drive development together and we have several ideas on how to go forward with this.
I agree that keeping scores as up-to-date as possible would be great, definitely something we should aim for.
I hope to be able to start working on this with @jackwasey soon!
@ellessenne just so you know, my colleague @fiksdala has already created a fork and addressed this issue. He recently updated his fork to improve documentation. The PR may not be 100% ready, but is close. I will ask him to submit the PR and hopefully we can get it merged soon.
Of note, his PR also includes a script that can take the SAS code from AHRQ, whenever it is updated (annually), and rebuild the corresponding R code. So maintaining a current version is going to be easy.
@ellessenne another update on this: AHRQ's 2021 definitions are substantially different from the prior years. Alex is restructuring the code to make it amenable to such changes. This PR should not be merged for now, and will be updated later.
Thanks, I might release a new version soon with minor (albeit breaking) changes, see #32. I have been thinking about how to implement the PR from @fiksdala without creating a vastly different API, and I have some ideas. I think it would be better implemented by re-factoring the codebase and including some of the under-the-hood changes I've been talking about previously. Let's keep talking. Thanks!