From 62c651796993af348851951836010dace5910e1d Mon Sep 17 00:00:00 2001 From: eatyourpeas Date: Sat, 14 Dec 2024 13:03:34 +0000 Subject: [PATCH] fix the things i broke in the merge --- project/npda/templates/dashboard.html | 132 ++++++++---------- .../components/cards/imd_map_card.html | 17 ++- project/npda/views/dashboard.py | 1 + 3 files changed, 74 insertions(+), 76 deletions(-) diff --git a/project/npda/templates/dashboard.html b/project/npda/templates/dashboard.html index 01e5f2fe..1cedb754 100644 --- a/project/npda/templates/dashboard.html +++ b/project/npda/templates/dashboard.html @@ -2,78 +2,68 @@ {% load static %} {% load npda_tags %} {% block content %} -{% url 'dashboard' as hx_get %} - -{% comment %} ADDS KONVA FOR WAFFLE PLOTS JUST WHEN THIS TEMPLATE IS RENDERED {% endcomment %} - - -
-
-

PDU Dashboard for {{pdu_lead_organisation.name}} ({{pdu_object.pz_code}})

-

Calculated at {{ kpi_calculations_object.calculation_datetime }}

-

This data has not been validated by the NPDA team.

-
-
- - {% include 'dashboard/components/cards/pdu_card.html' %} - - - - {% include 'dashboard/components/cards/audit_details_card.html' %} - - - {% include 'dashboard/components/cards/total_eligible_patients_card.html' %} -
- - -

Unit Report

- -
- - {% include 'dashboard/components/cards/patient_characteristics_card.html' %} - - {% include 'dashboard/components/cards/treatment_regimen_card.html' %} -
- - {% include 'dashboard/components/cards/hcl_use_card.html' %} - - {% include 'dashboard/components/cards/care_at_diagnosis_card.html' %} + {% url 'dashboard' as hx_get %} + {% comment %} ADDS KONVA FOR WAFFLE PLOTS JUST WHEN THIS TEMPLATE IS RENDERED {% endcomment %} + +
+
+

+ PDU Dashboard for {{ pdu_lead_organisation.name }} ({{ pdu_object.pz_code }}) +

+

+ Calculated at {{ kpi_calculations_object.calculation_datetime }} +

+

This data has not been validated by the NPDA team.

-
-
- - {% include 'dashboard/components/cards/health_checks_completion_rate_card.html' %} - - {% include 'dashboard/components/cards/additional_care_processes_card.html' %} -
- - {% include 'dashboard/components/cards/hba1c_card.html' %} - - {% include 'dashboard/components/cards/admissions_card.html' %} +
+ + {% include 'dashboard/components/cards/pdu_card.html' %} + + {% include 'dashboard/components/cards/audit_details_card.html' %} + + {% include 'dashboard/components/cards/total_eligible_patients_card.html' %}
+ +

Unit Report

+
+ + {% include 'dashboard/components/cards/patient_characteristics_card.html' %} + + {% include 'dashboard/components/cards/treatment_regimen_card.html' %} +
+ + {% include 'dashboard/components/cards/hcl_use_card.html' %} + + {% include 'dashboard/components/cards/care_at_diagnosis_card.html' %} +
+
+
+ + {% include 'dashboard/components/cards/health_checks_completion_rate_card.html' %} + + {% include 'dashboard/components/cards/additional_care_processes_card.html' %} +
+ + {% include 'dashboard/components/cards/hba1c_card.html' %} + + {% include 'dashboard/components/cards/admissions_card.html' %} +
+
+
+ + {% include 'dashboard/components/cards/sex_card.html' %} + + {% include 'dashboard/components/cards/ethnicity_card.html' %} + + {% include 'dashboard/components/cards/imd_card.html' %} +
+ +
+ {% include 'dashboard/components/cards/imd_map_card.html' with scatterplot_of_cases_for_selected_organisation=charts.scatterplot_of_cases_for_selected_organisation pdu_lead_organisation=pdu_lead_organisation pdu_object=pdu_object %} +
+ +

Patient-Level Report

+ + {% include 'dashboard/pt_level_report_table_partial.html' with text=default_pt_level_menu_text selected=default_pt_level_menu_tab_selected highlight=default_highlight %}
-
- - {% include 'dashboard/components/cards/sex_card.html' %} - - {% include 'dashboard/components/cards/ethnicity_card.html' %} - - {% include 'dashboard/components/cards/imd_card.html' %} -
- - -
- {% include 'dashboard/components/cards/imd_map_card.html' with scatterplot_of_cases_for_selected_organisation=charts.scatterplot_of_cases_for_selected_organisation pdu_lead_organisation=pdu_lead_organisation pdu_object=pdu_object %} -
- - -

Patient-Level Report

- - - {% include 'dashboard/pt_level_report_table_partial.html' with text=default_pt_level_menu_text selected=default_pt_level_menu_tab_selected highlight=default_highlight%} - - - -
{% endblock content %} - diff --git a/project/npda/templates/dashboard/components/cards/imd_map_card.html b/project/npda/templates/dashboard/components/cards/imd_map_card.html index d82185ab..80071fce 100644 --- a/project/npda/templates/dashboard/components/cards/imd_map_card.html +++ b/project/npda/templates/dashboard/components/cards/imd_map_card.html @@ -3,11 +3,18 @@ Distribution of patients ({{ pdu_object.lead_organisation_name }} {{ pdu_object.pz_code }}) {% endblock card_title %} {% block card_body %} -
-
-
- {% comment %}
-
{% endcomment %} +
+
+
+ {% include 'dashboard/map_chart_partial.html' with chart_html=chart_html %} +
+
+
diff --git a/project/npda/views/dashboard.py b/project/npda/views/dashboard.py index 468f09f7..8a51696c 100644 --- a/project/npda/views/dashboard.py +++ b/project/npda/views/dashboard.py @@ -7,6 +7,7 @@ from typing import Literal import plotly.graph_objects as go +import plotly.io as pio # Django imports from django.apps import apps