Another incremental improvement in the aggregation suite.
This ensures logs for any updates or creates to the KPIAggregation models, with a summary of how many models changed, and how many records updated with 0 if unscored.
There are also some fixes to the tests:
update the filter to accept only completed cases who have completed a full year of care
deprecate the get_filtered_cases_queryset_for which is not used for the aggregations anyway in favour of the newer filter_completed_cases_at_one_year_by_abstraction_level so testing closer to real life
Code changes
add filter_completed_cases_at_one_year_by_abstraction_level to __init__.py to allow easier importing
remove the return statement after testing for None, and nest any code below this test into a conditional.
Change _register_kpi_scored_cases function in the e12case factory to include cases who have completed a full year of care
deprecate get_filtered_cases_queryset_for which was now failing update KPIAggregation table tests, and replace with filter_completed_cases_at_one_year_by_abstraction_level which is used in the actual calculations anyway
Documentation changes (done or required as a result of this PR)
This needs doing - mostly to make explicit that the aggregation tables now only contain fully scored cases that have completed a full year of care
Overview
Another incremental improvement in the aggregation suite. This ensures logs for any updates or creates to the KPIAggregation models, with a summary of how many models changed, and how many records updated with 0 if unscored.
There are also some fixes to the tests:
filter_completed_cases_at_one_year_by_abstraction_level
so testing closer to real lifeCode changes
filter_completed_cases_at_one_year_by_abstraction_level
to__init__.py
to allow easier importingreturn
statement after testing for None, and nest any code below this test into a conditional._register_kpi_scored_cases
function in the e12case factory to include cases who have completed a full year of careget_filtered_cases_queryset_for
which was now failing update KPIAggregation table tests, and replace withfilter_completed_cases_at_one_year_by_abstraction_level
which is used in the actual calculations anywayDocumentation changes (done or required as a result of this PR)
This needs doing - mostly to make explicit that the aggregation tables now only contain fully scored cases that have completed a full year of care
Related Issues
Closes #907