rcpch / rcpch-audit-engine

Epilepsy12 Audit Platform
https://e12.rcpch.ac.uk/
GNU Affero General Public License v3.0
5 stars 5 forks source link

Eatyourpeas/aggregation-logs-text-fixes #933

Closed eatyourpeas closed 1 month ago

eatyourpeas commented 3 months ago

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:

  1. update the filter to accept only completed cases who have completed a full year of care
  2. 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

  1. add filter_completed_cases_at_one_year_by_abstraction_level to __init__.py to allow easier importing
  2. remove the return statement after testing for None, and nest any code below this test into a conditional.
  3. Change _register_kpi_scored_cases function in the e12case factory to include cases who have completed a full year of care
  4. 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

Related Issues

Closes #907

mbarton commented 3 months ago

@eatyourpeas what's left to get this merged? :)

eatyourpeas commented 1 month ago

I think park this PR for now