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

Check RY9 in KPI export #935

Closed mbarton closed 3 months ago

mbarton commented 3 months ago

It appears that there's data in the KPI export under that trust even though there are no children registered in the dataset

mbarton commented 3 months ago

I can reproduce this quite easily with locally seeded data. I can see data in the dashboard for Kings College Hospital Trust (RJZ) but the HBT sheet has empty rows for them

mbarton commented 3 months ago

I think this is an issue with how we look up rows in the KPI report (https://github.com/rcpch/rcpch-audit-engine/blob/f1bad97abfa941a84ada619493bd45a8c492c2a7/epilepsy12/common_view_functions/aggregate_by.py#L922).

I added a log message

 print(f"{model_aggregation1} {body} {uid + 1} {objects[key]}")

and we're looking up the incorrect row:

<class 'epilepsy12.models_folder.kpi_aggregation.ICBKPIAggregation'> {'ods_code': 'QT1', 'gss_code': 'E54000060', 'name': 'NHS NOTTINGHAM AND NOTTINGHAMSHIRE INTEGRATED CARE BOARD'} 33 {'id': 702 ... 'abstraction_name': 'NHS West Yorkshire Integrated Care Board' }

It wants to look up NHS NOTTINGHAM AND NOTTINGHAMSHIRE INTEGRATED CARE BOARD but is actually getting NHS West Yorkshire Integrated Care Board

mbarton commented 3 months ago

Fixed in #941