Open wtyree opened 1 month ago
@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! 🙏
Workflow has finished with the following statuses:
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.
@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:
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