Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds options for 2020-2022 AHRQ Elixhauser versions #52

Open
wants to merge 52 commits into
base: master
Choose a base branch
from

Conversation

fiksdala
Copy link

@fiksdala fiksdala commented Mar 7, 2022

Hi @ellessenne,

Our team at Brigham and Women's Hospital (principally myself, @kravvaz, and @salmasian) have been developing a fork of this package that can replicate the functionality of AHRQ's SAS program for computing Elixhauser comorbidities (see https://www.hcup-us.ahrq.gov/toolssoftware/comorbidityicd10/comorbidity_icd10.jsp for their work). We have been using this fork in our internal work since mid-2020, and think it is now in a state where we can pursue a formal pull request. In short, these modifications allow for replicating the mappings for the 2020, 2021, and 2022 versions of the AHRQ Elixhauser SAS programs, and scoring algorithms for the 2022 version (separate scoring programs do not exist for 2020 and 2021).

While we have prepared our code such that it is mergeable and fully functional (as far as we know) with your project and its updated API, it is a substantial PR. As the package author, we want to make this process as easy as possible for you. As such, if you'd prefer to discuss this "offline" prior to moving forward with the PR, we'd be more than happy to do so. Any feedback on the code we've put together or requests for alterations are of course very welcome as well.

If you have any other questions as you review this PR, please do not hesitate to get in touch.

Kind regards,
Alex Fiksdal

fiksdala and others added 30 commits April 21, 2020 16:39
add icd10cm_2020_1 ahrq maintenance files

add icd10cm_2021_1 ahrq maintenance files

add 2021 ahrq function

delete duplicate files

update directory references in for 2020 convert-sas.R

update directory references in make-data.R

streamline ahrq 2020 lofregex and add 2021 formats

add formats directory for ahrq versions

add directory for sas parsing scripts

add parameters for 2021 ahrq

remove extaneous options ahrq 2021

remove maintenance dir, replace with sas-parse/sas-formats

update mapping reference to list produced in get_mappings

rename elixhauser_ahrq option to elixhauser_ahrq_2020

update internal data

fix ahrq labels in .check_output

fix drg_id class = factor error

fix ahrq_2020 assertions, add assertions for ahrq_2021, add ahrq_2021 to .check_output

add total score column

isolate internal/external score calculations and add ahrq2021 support

roxygen2 upgrade

calculate ahrq using discrete functions

fixes POA required with not present logic

fix class assertions for tibbles w/spec_tbl_df subclass

add assertion for ic10cm_vers values

fix exempt matching

fixes missing columns error when poa=F

fix icd10cm_vers assertion

remove missing columns references when poa=F

fix cbvd exemptions

update documentation

update documentation

remove testing scripts

fix id name error

add elixhauser 2021 examples to README
@ellessenne
Copy link
Owner

HI @fiksdala, @kravvaz, @salmasian: first of all, thanks for the massive amount of work behind this. I will review this in the next few days, so please bear with me just a little longer.
In the meantime, after a quick skim through the PR, it looks like this follows the "old" logic behind the scenes, so it likely will require some adjustments (which I can work on, no problem).
I had been thinking about how to effectively implement the AHRQ algorithms for a while now, actually, and given that it is not simply an ICD-based score anymore (using all sorts of other information) I was wondering if it would be better to have a separate ahrq() function, calling the same internal scoring functions that are used by comorbidity(), still returning a comorbidity-like object to be used, e.g., with score().
What do you think about it? Happy to have a quick chat if that works better for you all.
Thanks,

Alessandro

@ellessenne
Copy link
Owner

Hi everyone, just wanted to let you know that I forked this PR, where I'll be reviewing/editing: https://github.com/ellessenne/comorbidity/tree/updated_elixhauser

@fiksdala
Copy link
Author

fiksdala commented Jun 13, 2022 via email

@ellessenne
Copy link
Owner

Hi @fiksdala, sorry for being slow – I've actually had very little time to work on this.

I have some early feedback though: for what I've seen, the current PR simply wraps the old API for AHRQ. I think that should be recoded to use the new internal functions, rather than using the old ones, as (1) it would be very hard to maintain and (2) the new API is actually faster than the old one. Do you think you would be able to recode your implementation to do that?

The matching algorithm is now abstracted out as the internal .matchit() function: in my head, it should be possible to call this function to both ICD and DRG codes first, with appropriate mappings (something added to the .maps internal list, see e.g. here), and then combining the results in a single "matrix" of results. What do you think?

@fiksdala
Copy link
Author

fiksdala commented Jun 22, 2022 via email

@salmasian
Copy link
Contributor

@fiksdala here is what I suggest to facilitate this discussion: if you could provide a few examples of those non-linear relationships between ICD codes and comorbidities in the AHRQ 2020 definition, that could help.

As for the POA piece, obviously, you can first eliminate the ICD codes that are not matching the POA logic, and only then pass the remaining list to the mapping function, but again, if these mappings are non-linear (and involve intermediary logic that cannot be handled by the new API) you should provide some examples.

@ellessenne
Copy link
Owner

Hi @fiksdala and @salmasian,
Thanks for the feedback.
With other scores, there is already a 1:n relationship between ICD codes and comorbidity in some settings (e.g., a single ICD code that is used by two domains), so that would not be a problem I think. The rest of the AHRQ algorithm, however, seems to deviate much more from the standard comorbidity approaches. Maybe a separate function/implementation for the AHRQ scores might be the best solution here?

@fiksdala
Copy link
Author

fiksdala commented Jul 14, 2022 via email

@ellessenne
Copy link
Owner

Hi @fiksdala,
No problem at all, my bandwidth is also unfortunately limited.
I wonder if we should brainstorm a bit on how to implement this functionality before spending time on coding, actually?
Thanks,

Alessandro

@fiksdala
Copy link
Author

fiksdala commented Aug 10, 2022 via email

@ellessenne
Copy link
Owner

No worries @fiksdala! I think setting up a call will make things easier at the beginning, but I won't be able until later this month (at the earliest), unfortunately. Time difference should be manageable if we set something for, say, 10 am Boston time (4 pm here in Sweden if I am not mistaken).

After a call, I think it would be easier (and more effective) to proceed asynchronously. How does that sound?

@fiksdala
Copy link
Author

fiksdala commented Aug 19, 2022 via email

@ellessenne
Copy link
Owner

Hi @fiksdala, first of all, sorry for the late response!
About possible dates, would Sep 13/14 work? 10:00 am Boston time would be okay for me. Otherwise I will have more time from the 27 onwards.
Thanks!

Alessandro

@fiksdala
Copy link
Author

fiksdala commented Oct 11, 2022 via email

@fiksdala
Copy link
Author

fiksdala commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants