Description
Going forward we will need to extend the and modify the way the caching works to allow for multiscale comparisons between larger unit groupings and the same unit over time. This is a bit of a change because it will involve the dashboard stats library directly communicating with a cache of data. This will not change the way the precalculation works. There will also need to be a significant refactor of the calculators to allow the assembly of the patient cohort.
Caching
Going forward the dashboard stats will have its own redis database. This will not be exposed to the api since it will be unaggregated ukrdc data. It will store dataframes with keys based on the input required to calculate them. The calculators will check against the cache when query the ukrdc this will speed up the calculation since the database queries will only be run when they do not exist in the cache. The cache will expire either after an arbitary fixed time or a more intelligently calculated time period based on how old the data is.
Dashboard Stats Refactor
Target User(s)
Components/Dependencies
Libraries
(delete where appropriate)
dashboard stats
ukrdc fastapi
ukrdc UI
UKRDC stats dependencies
abc base class
Steps
- Create xy model
- Write core query to …
- Write abc function to filter patient cohort …