-
Notifications
You must be signed in to change notification settings - Fork 50
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 monthly patient risk models #627
base: main
Are you sure you want to change the base?
Conversation
@wtyree this is amazing! I think it looks awesome. I'm running the CI tests now to make sure it works in the other data warehouses we support. I'll be running some tests locally on other datasets to compare results and let you know early next week. Just for transparency, this will be a breaking change, so we will need to package it with other changes when we're ready for the next minor release. Thanks again for sharing your enhancements to this data mart! 🙏 |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Wyatt, I need to request a few syntax changes for the other data warehouses we support. I am still testing in Fabric, so I'll submit another review after that. One thing I know we'll have to change is all of the ||
to concat
.
models/cms_hcc/intermediate/cms_hcc__int_monthly_collection_dates.sql
Outdated
Show resolved
Hide resolved
models/cms_hcc/intermediate/cms_hcc__int_monthly_collection_dates.sql
Outdated
Show resolved
Hide resolved
Thanks for the review @sarah-tuva, I'm excited to be able to contribute! I will take a look at the recommendations for making things more generalizable to other data warehouses. |
@sarah-tuva I've made the requested changes and learned some things about using dbt in a way that's more portable! Thanks for the feedback. Let me know if there's anything else that I've missed. |
Thanks for making those changes so quickly! I'll re-run the CI tests and finish my validation. |
Workflow has finished with the following statuses:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wtyree I've completed my validation, and the CI tests are now passing. Thank you so much for your work on this PR and for sharing your enhancements to this data mart! We're really excited to get this merged in. We will bundle this with other breaking changes in the upcoming weeks.
Great! Thanks so much for the review and for the help getting this through. It will certainly be useful for us and I hope it will be useful for others as well. |
Describe your changes
This PR modifies existing patient risk models to support monthly cumulative risk scores and adds new monthly risk factors and monthly risk scores models. A new base table
cms_hcc__int_monthly_collection_dates
was created to provide the monthly scaffolding for all payment years and all collection period ranges. For each payment and collection year, there are collection start and end periods that go from the beginning of the collection year to the end of each month. 2023-01-01 to 2023-01-31, 2023-01-01 to 2023-02-28, and so on. The existing intermediate models were then updated to pass the payment year and collection period end date through each model. There are then final monthly risk factors and risk scores models that maintain that monthly granularity. The existing final models were updated to maintain support for the existing version of the models.This change enables a few different analyses:
How has this been tested?
We have tested this on our own Tuva implementation using our patient data. We have confirmed that the
cms_hcc__patient_risk_scores
are identical in this version.To see what the YoY comparison might look like, you can use queries like:
One important callout: the adjustment rates end at payment year 2024. I have included some logic to use the max payment year from that file when the year is not available. This is something we use internally to allow us to see how we're progressing this year for payment year 2025. I'm not sure though how Tuva may want this to be handled. You can see an example of this here.
Reviewer focus
How well does this fit into Tuva's plans for this mart? My understanding of risk scores is still developing, have I overlooked anything obvious? In general, I would be willing to use this as a discussion starter if more is needed.
Checklist before requesting a review
tuva_last_run
to the final outputPackage release checklist
dbt_project.yml
(Optional) Gif of how this PR makes you feel
Loom link