rcpch / national-paediatric-diabetes-audit

A django application to audit the care of children and young people with diabetes in England and Wales.
0 stars 1 forks source link

Adds vscode debugger, refactors single pt kpi results, adds tests #381

Closed anchit-chandran closed 1 week ago

anchit-chandran commented 1 week ago

Signed-off-by: anchit-chandran anchit97123@gmail.com

Overview

Vscode Debugger

Implements functionality of vscode debugger through debugpy. Did this using an override docker-compose-debug.yml file run using the s/up-debug script to ensure we're not polluting production environment (requires couple extra configs like env vars, ports etc). See documentation:

image

Single pt KPIs

Refactors the calculate_kpis_for_single_patient to return data the looks like:

{
                "calculation_datetime": datetime.datetime(
                    2024, 11, 15, 9, 49, 32, 684190
                ),
                "audit_start_date": datetime.date(2024, 4, 1),
                "audit_end_date": datetime.date(2025, 3, 31),
                "gte_12yo": False,
                "diagnosed_in_period": False,
                "died_in_period": False,
                "transfer_in_period": False,
                "kpi_results": {
                    "kpi_25_hba1c": False,
                    "kpi_26_bmi": False,
                    "kpi_27_thyroid_screen": False,
                    "kpi_28_blood_pressure": None,
                    "kpi_29_urinary_albumin": None,
                    "kpi_30_retinal_screening": None,
                    "kpi_31_foot_examination": None,
                },
                "total_passed": 0,
                "expected_total": 3,
            }

With simple template to show its use at the bottom of /patient/{PK}/visits: image

Tests

Related Issues

https://github.com/orgs/rcpch/projects/13?pane=issue&itemId=87470511&issue=rcpch%7Cnational-paediatric-diabetes-audit%7C380 https://github.com/orgs/rcpch/projects/13?pane=issue&itemId=83210131&issue=rcpch%7Cnational-paediatric-diabetes-audit%7C320 https://github.com/orgs/rcpch/projects/13?pane=issue&itemId=87361257&issue=rcpch%7Cnational-paediatric-diabetes-audit%7C373

mbarton commented 1 week ago

Seen on STAGING (merged by @anchit-chandran 6 minutes and 35 seconds ago) Please check your changes!