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

QE King's Lynn #907

Closed eatyourpeas closed 6 months ago

eatyourpeas commented 6 months ago

There seems to be an error with King's Lynn specifically where aggregations are counting all children in the organisation, at ICB/NHS region and national levels, but not at Trust level. It looks like they are being filtered out.

mbarton commented 6 months ago

[posting summary from a call with Simon, Danny and Michael 29/04/24]

We think the issue is probably that now we have added additional filtering, no cases from QE Kings Lynn should be included in the aggregations. However an organisation aggregation row was added previously and our code at the moment doesn't reset it again to zero, it simply skips over any abstraction level that has no corresponding cases.

@eatyourpeas will try changing the code to always write at all abstraction levels every time. We believe that to be safe as even if we have bugs in our aggregation code it can always be derived from the underlying data - so it's fine to overwrite a previous aggregation row even if there's no corresponding data for the organisation now our additional filtering applies

mbarton commented 6 months ago

@dc2007git and I looked at this today. We removed all KPI metrics so they would be recalculated the next time aggregations were run.

BaseKPIMetrics.objects.all().delete()

This removed any outdated rows but unfortunately it does not seem to have fixed this issue.

The Trust column that was blank before is now missing entirely. The organisation shows zero cases at the top level but then does show cases in the rows below. It also shows a "Local health board" column which should not apply here as we're not in Wales.

mbarton commented 6 months ago

This is fixed, we’ll track everything else under other issues