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

Add support for latest AHRQ Elixhauser comorbidity calculation #29

Closed
wants to merge 37 commits into from

Conversation

fiksdala
Copy link

Hi @ellessenne ,

My colleague @salmasian has mentioned this work to you previously, but this PR aims to address Issue #28 and replicates the AHRQ SAS program (version 3.7) functionality. This required changes to comorbidity.R as well as some other supporting scripts. Of particular note, ICD-10 ranks and DRG codes must be passed to comorbidity() to replicate the AHRQ SAS program. While my fork is 100% functional, some changes to this PR may be required for better integration with the parent repo. Please let me know if there's anything I can do to facilitate those efforts or if you have any other questions.

Kind regards,
Alex Fiksdal

@ellessenne
Copy link
Owner

Hi!
Thanks for your PR @fiksdala (and cc @salmasian).
I will need some time to review it (and time has been extremely limited this summer, on top of everything else going on).
I have a list of additions and changes to the comorbidity package that are in the pipeline, hopefully it'll be easier in the coming months. I'll get back to you soon!

@ellessenne
Copy link
Owner

I think implementing #35 will greatly simplify implementing scores with DRG codes.
I am thinking about the API at the moment, and I am considering splitting the comorbidity mapping and the scoring parts into two separate functions, e.g. (in pseudo-code):

# function to get comorbidity domains:
comorbidity_matrix = comorbidity(data, type = 'elixhauser', ...)

# function to obtain comorbidity scores, summarising the domains calculated above:
score(comorbidity_matrix, type = 'ahrq', ...)

What do you think @salmasian and @fiksdala?

@fiksdala
Copy link
Author

Thanks @ellessenne for this update! I think that would make sense both from an end-user perspective and in light of recent AHRQ updates to Elixhauser. The SAS program provided by AHRQ only returns the domains (plus some generic summary stats in a separate procedure), and my most recent work (i.e. the 2021 update, not yet finalized) also only returns the comorbidity domains anyway. That decision was made both to more closely replicate the SAS output and because the 2021 AHRQ update includes new comorbidity categories that are incompatible with the scoring schemes used previously.

@ellessenne
Copy link
Owner

Sounds good, thanks. I will work on the API on a separate branch, I'll let you know once ready to test!

fiksdala and others added 8 commits January 29, 2021 17:10
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
Bug fixes for elixhauser_ahrq_2022
bug fixes, confirms 2022 matches AHRQ SAS program
@ellessenne
Copy link
Owner

Hi @fiksdala, I am preparing a new release of {comorbidity} for CRAN with the new API (see #43). Once that is done, it will be easier to work on the AHRQ version of the Elixhauser score. Thank you again for your patience!

@fiksdala
Copy link
Author

fiksdala commented Jan 17, 2022 via email

@ellessenne
Copy link
Owner

Given the new PR in #52, do you think it would be okay to close this @fiksdala?

@fiksdala
Copy link
Author

fiksdala commented Mar 8, 2022 via email

@ellessenne ellessenne closed this Mar 9, 2022
@fiksdala fiksdala deleted the master branch January 31, 2023 16:58
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.

2 participants