-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kpi aggregations #282
Kpi aggregations #282
Conversation
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
… and build large query with single transaction Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
creates kpi folder with file for each kpi query kpi 1-4 added
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
…it cohort to enable debugging of kip calcs Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big enough PR that I can't really review it in a meaningful sense but I've run it up locally and it calculates KPIs for dummy_sheet_invalid.csv
and the tests all pass.
The debugging endpoint doesn't have any permissions checking on it but I guess that's fine since we're planning to replace it with dashboarding at the PDU level and upwards anyway.
So shall we merge this @anchit-chandran and then we can raise additional PRs against live
to implement the other KPIs?
# So, we use a custom lazy fn to generate unique emails | ||
@classmethod | ||
def generate_unique_email(cls): | ||
"""Generate a unique email address.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not as readable when debugging tests perhaps but we could use a UUID here instead:
email = f"npda_test_user_{str(uuid.uuid4())}@nhs.net"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much nicer, good shout! once i make this change, will merge
Agreed it's definitely too large, the real review will come from people using and seeing whether numbers are as expected. Hopefully after the first few kinks, should be easy to sort as will be related to definition nuances; particularly if there's issues in KPI calculations 1-12, it'll lead to downstream issues in other calculations. But equally, a fix there will fix any downstream issues too. An important note here is that the tests should definitely pass but that doesn't mean the calculations are correct as depends on KPI definitions which have required updating / confirming as I work through each calculation. Have made updates to the excel sheet which is git tracked in the repo
Also re permissions - we're not using any real data currently? That was the main reason I hadn't put perms checks as just a quick debugging view with intention; but is quick to add the perms mixin |
My only worry is that we might forget about it - so lets raise an issue to track removing it |
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Add issue and updated |
Seen on STAGING (merged by @anchit-chandran 5 minutes and 21 seconds ago) Please check your changes! |
It's still WIP, but @mbarton discussed merging it into live so people can upload and view numbers. If a calculation method is not implemented, it is handled as 'Not implemented' in the table.
View calculation results at temp URL:
https://npda.localhost/kpis/aggregation/pdu/PZ999
(note: you'd have to upload thedummy_csv_invalid
first (or any csv but have updated values in there to ensure they get shown in aggregations due to particular KPI eligibilities).Important changes:
Note
have also patched call to
imd_for_postcode
globally across tests so now they run much faster, ~1-2 mins down to a few seconds, I should have done this earlierdummy_sheet_invalid.csv
to ensure some kpi values show (e.g. has T1DM, setting ages around 12 etc)