From 6e959abf34a97caddda8d8814514dccb71a8500e Mon Sep 17 00:00:00 2001 From: Anchit Date: Wed, 26 Apr 2023 14:11:33 +0100 Subject: [PATCH 01/33] restyle index page as per Edit homepage text #405 Signed-off-by: Anchit --- static/styles/style.css | 19 ++++++++++++ templates/epilepsy12/epilepsy12index.html | 37 +++++++++-------------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/static/styles/style.css b/static/styles/style.css index ea1896cc..5241f7bd 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -197,6 +197,8 @@ div.center.aligned.image.rcpch_index_card_image { .ui.card > .content.rcpch_index_card_content { padding: 1.5rem; + display: flex; + flex-direction: column; } .rcpch_index_card_content.content > h1.ui.header { @@ -216,12 +218,29 @@ div.center.aligned.image.rcpch_index_card_image { margin-bottom: 1em; } +.rcpch_index_card_content .rcpch_icon_text_group.rcpch_index_card_select { + margin-top: auto; +} + +.rcpch_icon_text_group.rcpch_index_card_select>a{ + margin-top: 4em; +} + a.rcpch_index_card_link { font-weight: 900; font-size: 1.4em; margin-right: 0.2em; } +.rcpch.container .index_segment .card_container { + display: flex; + flex-direction: column; +} + +.card_container>.card_content_wrapper { + flex-grow: 1; +} + /* links */ #organisation_segment { diff --git a/templates/epilepsy12/epilepsy12index.html b/templates/epilepsy12/epilepsy12index.html index 60f6ce00..d8ae4979 100644 --- a/templates/epilepsy12/epilepsy12index.html +++ b/templates/epilepsy12/epilepsy12index.html @@ -26,11 +26,10 @@

Welcome to the Epilepsy12 data platform

- Epilepsy12 (The UK collaborative clinical audit of health care for children and young people with - suspected epileptic seizures) is a national clinical audit established in 2009 and has the continued aim - of helping epilepsy services, and those who commission health services, to measure and improve the - quality of care for children and young people with seizures and epilepsies. As per rounds 1 - 3 of the - audit the audit is overseen by a project board and a dedicated project team within the RCPCH. + Epilepsy12 (The National Clinical Audit of Seizures and Epilepsies for Children and Young People) is a + national clinical audit established in 2009 and has the continued aim of helping epilepsy services, and + those who commission health services, to measure and improve the quality of care for children and young + people with seizures and epilepsies.

@@ -38,19 +37,16 @@

Welcome to the Epilepsy12 data platform

-
-
+
+
- +
-

Community and organisation

+

Epilepsy12 Data Capture Platform

Clinician access

-

THIS IS THE DESCRIPTION FOR THE CLINICIAN SECTION OF THE AUDIT Lorem ipsum dolor sit, - amet consectetur adipisicing elit. Dolore molestiae assumenda voluptas neque eos? Quia - omnis nobis iste enim ipsum, distinctio dignissimos suscipit consequatur sit minima vel - blanditiis asperiores exercitationem!

+

Access Epilepsy12 audit data for your organisation.

-
-
+
+
@@ -70,10 +66,7 @@

Clinician access

Children and families

Patient access

-

THIS IS THE DESCRIPTION FOR THE CLINICIAN SECTION OF THE AUDIT Lorem ipsum dolor sit, - amet consectetur adipisicing elit. Dolore molestiae assumenda voluptas neque eos? Quia - omnis nobis iste enim ipsum, distinctio dignissimos suscipit consequatur sit minima vel - blanditiis asperiores exercitationem!

+

THIS WILL BE ACCESS FOR PUBLIC FACING REPORTS

From f5342b1190cb857c896a365f6a0f369c9b5c8cc7 Mon Sep 17 00:00:00 2001 From: Anchit Date: Wed, 26 Apr 2023 14:42:04 +0100 Subject: [PATCH 02/33] add city to organisation select Signed-off-by: Anchit --- epilepsy12/view_folder/organisation_views.py | 6 ++++++ .../partials/page_elements/rcpch_organisations_select.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epilepsy12/view_folder/organisation_views.py b/epilepsy12/view_folder/organisation_views.py index 4d9a4d59..b9e1b119 100644 --- a/epilepsy12/view_folder/organisation_views.py +++ b/epilepsy12/view_folder/organisation_views.py @@ -92,6 +92,10 @@ def organisation_reports(request): count_of_current_cohort_registered_cases_in_this_trust)) else: total_percent_trust = 0 + + org_list=Organisation.objects.order_by('OrganisationName').all() + print(dir(org_list[0])) + print(f"{org_list[0].OrganisationName=}{org_list[0].ParentOrganisation_OrganisationName=}") return render(request=request, template_name=template_name, context={ 'user': request.user, @@ -164,6 +168,8 @@ def selected_organisation_summary(request): count_of_current_cohort_registered_completed_cases_in_this_organisation))*10 else: total_percent_trust = 0 + + return render(request=request, template_name='epilepsy12/partials/selected_organisation_summary.html', context={ 'user': request.user, diff --git a/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html b/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html index f5a6cb4e..5112ce8c 100644 --- a/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html +++ b/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html @@ -30,7 +30,7 @@
{{hx_default_text}}
From 4d0cedfc85bb97d5a521bc1834a1b345ddd5a0ab Mon Sep 17 00:00:00 2001 From: Anchit Date: Fri, 28 Apr 2023 13:04:30 +0100 Subject: [PATCH 03/33] restyle index page as per Edit homepage text #405 Signed-off-by: Anchit --- static/styles/style.css | 19 ++++++++++++ templates/epilepsy12/epilepsy12index.html | 37 +++++++++-------------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/static/styles/style.css b/static/styles/style.css index ea1896cc..5241f7bd 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -197,6 +197,8 @@ div.center.aligned.image.rcpch_index_card_image { .ui.card > .content.rcpch_index_card_content { padding: 1.5rem; + display: flex; + flex-direction: column; } .rcpch_index_card_content.content > h1.ui.header { @@ -216,12 +218,29 @@ div.center.aligned.image.rcpch_index_card_image { margin-bottom: 1em; } +.rcpch_index_card_content .rcpch_icon_text_group.rcpch_index_card_select { + margin-top: auto; +} + +.rcpch_icon_text_group.rcpch_index_card_select>a{ + margin-top: 4em; +} + a.rcpch_index_card_link { font-weight: 900; font-size: 1.4em; margin-right: 0.2em; } +.rcpch.container .index_segment .card_container { + display: flex; + flex-direction: column; +} + +.card_container>.card_content_wrapper { + flex-grow: 1; +} + /* links */ #organisation_segment { diff --git a/templates/epilepsy12/epilepsy12index.html b/templates/epilepsy12/epilepsy12index.html index 60f6ce00..d8ae4979 100644 --- a/templates/epilepsy12/epilepsy12index.html +++ b/templates/epilepsy12/epilepsy12index.html @@ -26,11 +26,10 @@

Welcome to the Epilepsy12 data platform

- Epilepsy12 (The UK collaborative clinical audit of health care for children and young people with - suspected epileptic seizures) is a national clinical audit established in 2009 and has the continued aim - of helping epilepsy services, and those who commission health services, to measure and improve the - quality of care for children and young people with seizures and epilepsies. As per rounds 1 - 3 of the - audit the audit is overseen by a project board and a dedicated project team within the RCPCH. + Epilepsy12 (The National Clinical Audit of Seizures and Epilepsies for Children and Young People) is a + national clinical audit established in 2009 and has the continued aim of helping epilepsy services, and + those who commission health services, to measure and improve the quality of care for children and young + people with seizures and epilepsies.

@@ -38,19 +37,16 @@

Welcome to the Epilepsy12 data platform

-
-
+
+ -
-
+
+
@@ -70,10 +66,7 @@

Clinician access

Children and families

Patient access

-

THIS IS THE DESCRIPTION FOR THE CLINICIAN SECTION OF THE AUDIT Lorem ipsum dolor sit, - amet consectetur adipisicing elit. Dolore molestiae assumenda voluptas neque eos? Quia - omnis nobis iste enim ipsum, distinctio dignissimos suscipit consequatur sit minima vel - blanditiis asperiores exercitationem!

+

THIS WILL BE ACCESS FOR PUBLIC FACING REPORTS

From 0ab8c9cb427d8d684863af68b2ea0592bb519cfa Mon Sep 17 00:00:00 2001 From: Anchit Date: Fri, 28 Apr 2023 13:05:24 +0100 Subject: [PATCH 04/33] add city to organisation select Signed-off-by: Anchit --- epilepsy12/view_folder/organisation_views.py | 6 ++++++ .../partials/page_elements/rcpch_organisations_select.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epilepsy12/view_folder/organisation_views.py b/epilepsy12/view_folder/organisation_views.py index f7110875..30d5b6fa 100644 --- a/epilepsy12/view_folder/organisation_views.py +++ b/epilepsy12/view_folder/organisation_views.py @@ -111,6 +111,10 @@ def organisation_reports(request): ) else: total_percent_trust = 0 + + org_list=Organisation.objects.order_by('OrganisationName').all() + print(dir(org_list[0])) + print(f"{org_list[0].OrganisationName=}{org_list[0].ParentOrganisation_OrganisationName=}") return render( request=request, @@ -238,6 +242,8 @@ def selected_organisation_summary(request): ) else: total_percent_trust = 0 + + return render( request=request, diff --git a/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html b/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html index dc54c8fc..5112ce8c 100644 --- a/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html +++ b/templates/epilepsy12/partials/page_elements/rcpch_organisations_select.html @@ -30,7 +30,7 @@
{{hx_default_text}}
From 7f82ce7cb24f685612833dfe67fb52f3af73b06a Mon Sep 17 00:00:00 2001 From: Anchit Date: Fri, 28 Apr 2023 13:17:50 +0100 Subject: [PATCH 05/33] middle align e12user table icons Signed-off-by: Anchit --- static/styles/style.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/static/styles/style.css b/static/styles/style.css index 5241f7bd..6bd97458 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -1219,9 +1219,6 @@ div.ui.card > div.content > div.organisation_address_container { border-color: var(--rcpch_light_blue); border-width: medium; margin-bottom: 10px; -} - -.ui.rcpch.table { margin-top: 10px; } @@ -1431,6 +1428,7 @@ a label { display: flex; justify-content: center; align-items: center; + height: 5em; } .rcpch_team_member_image_wrapper > * { From 56f749f506467a0a62832deeb10740a5640f46f9 Mon Sep 17 00:00:00 2001 From: Anchit Date: Fri, 28 Apr 2023 13:49:39 +0100 Subject: [PATCH 06/33] improve button layout children's table Signed-off-by: Anchit --- static/styles/style.css | 26 ++++++++++++++++++++++++++ templates/epilepsy12/cases/cases.html | 20 +++++++++++--------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/static/styles/style.css b/static/styles/style.css index 6bd97458..e5852d76 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -636,6 +636,12 @@ div.ui.card > div.content > div.organisation_address_container { background-color: var(--rcpch_strong_blue); } +a.ui.button { + display: flex; + justify-content: center; + align-items: center; +} + .ui.rcpch_positive.button:hover { border-radius: 0% !important; color: white; @@ -1643,4 +1649,24 @@ div.ui.three.stackable.cards.individual_measures .ui.card { justify-content: center; align-items: center; height: 100%; +} + +.twelve.wide.column.add_search_return_wrapper { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +div.sixteen.wide.column.add_search_return_wrapper { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +div.sixteen.wide.column.add_search_return_wrapper > #case_statistics { + flex-grow: 2; +} + +div.sixteen.wide.column.search_field_wrapper > .ui.rcpch.icon.input { + width: 100%; } \ No newline at end of file diff --git a/templates/epilepsy12/cases/cases.html b/templates/epilepsy12/cases/cases.html index d7f218be..df98186c 100644 --- a/templates/epilepsy12/cases/cases.html +++ b/templates/epilepsy12/cases/cases.html @@ -17,21 +17,23 @@
-
+
- + Add a new Child/Young Person -
- - +
+ {% include 'epilepsy12/partials/cases/case_statistics.html' with organisation=organisation total_cases=total_cases total_registrations=total_registrations %}
- - + + Return to organisation view
-
- {% include 'epilepsy12/partials/cases/case_statistics.html' with organisation=organisation total_cases=total_cases total_registrations=total_registrations %} +
+
+ + +
From 9c215a308555ec0d7f567e01837335ede50a0c82 Mon Sep 17 00:00:00 2001 From: Simon Chapman Date: Fri, 28 Apr 2023 18:57:06 +0100 Subject: [PATCH 07/33] Change SUDEP label to "Unexpected" NOT "Unexplained" Fixes #421 --- epilepsy12/models_folder/kpi.py | 159 +++++++++++++++----------------- static/styles/style.css | 101 ++++++++++++++------ 2 files changed, 148 insertions(+), 112 deletions(-) diff --git a/epilepsy12/models_folder/kpi.py b/epilepsy12/models_folder/kpi.py index 28f041f3..08b4e4fc 100644 --- a/epilepsy12/models_folder/kpi.py +++ b/epilepsy12/models_folder/kpi.py @@ -55,7 +55,7 @@ class KPI(models.Model, HelpTextMixin): 9f. Service contact details Percentage of children and young people with epilepsy with evidence of being given service contact details. - 10. School Individual Healthcare Plan - % of children and young people with epilepsy aged 4 years and above with evidence of a school individual healthcare plan by 1 year after first paediatric assessment.. + 10. School Individual Healthcare Plan - % of children and young people with epilepsy aged 4 years and above with evidence of a school individual healthcare plan by 1 year after first paediatric assessment.. """ @@ -68,11 +68,11 @@ class KPI(models.Model, HelpTextMixin): """ paediatrician_with_expertise_in_epilepsies = models.IntegerField( help_text={ - 'label': '1. Paediatrician with expertise in epilepsies', - 'reference': "Percentage of children and young people with epilepsy, with input by a 'consultant paediatrician with expertise in epilepsies' within 2 weeks of initial referral" + "label": "1. Paediatrician with expertise in epilepsies", + "reference": "Percentage of children and young people with epilepsy, with input by a 'consultant paediatrician with expertise in epilepsies' within 2 weeks of initial referral", }, default=None, - null=True + null=True, ) """ @@ -84,11 +84,11 @@ class KPI(models.Model, HelpTextMixin): """ epilepsy_specialist_nurse = models.IntegerField( help_text={ - 'label': '2. Epilepsy Specialist Nurse', - 'reference': "Percentage of children and young people with epilepsy, with input by epilepsy specialist nurse within the first year of care." + "label": "2. Epilepsy Specialist Nurse", + "reference": "Percentage of children and young people with epilepsy, with input by epilepsy specialist nurse within the first year of care.", }, default=None, - null=True + null=True, ) """ @@ -100,11 +100,11 @@ class KPI(models.Model, HelpTextMixin): """ tertiary_input = models.IntegerField( help_text={ - 'label': '3. Tertiary input', - 'reference': "Percentage of children and young people meeting defined criteria for paediatric neurology referral, with input of tertiary care and/or CESS referral within the first year of care." + "label": "3. Tertiary input", + "reference": "Percentage of children and young people meeting defined criteria for paediatric neurology referral, with input of tertiary care and/or CESS referral within the first year of care.", }, default=None, - null=True + null=True, ) """ @@ -116,11 +116,11 @@ class KPI(models.Model, HelpTextMixin): """ epilepsy_surgery_referral = models.IntegerField( help_text={ - 'label': '3b. Epilepsy surgery referral', - 'reference': "Percentage of ongoing children and young people meeting defined epilepsy surgery referral criteria with evidence of epilepsy surgery referral." + "label": "3b. Epilepsy surgery referral", + "reference": "Percentage of ongoing children and young people meeting defined epilepsy surgery referral criteria with evidence of epilepsy surgery referral.", }, default=None, - null=True + null=True, ) """ @@ -132,12 +132,11 @@ class KPI(models.Model, HelpTextMixin): """ ecg = models.IntegerField( help_text={ - 'label': '4. ECG', - 'reference': "Percentage of children and young people with convulsive seizures and epilepsy, with an ECG at first year." + "label": "4. ECG", + "reference": "Percentage of children and young people with convulsive seizures and epilepsy, with an ECG at first year.", }, - default=None, - null=True + null=True, ) """ @@ -149,12 +148,11 @@ class KPI(models.Model, HelpTextMixin): """ mri = models.IntegerField( help_text={ - 'label': '5. MRI', - 'reference': "Percentage of children and young people with defined indications for an MRI, who had timely MRI within 6 weeks of request" + "label": "5. MRI", + "reference": "Percentage of children and young people with defined indications for an MRI, who had timely MRI within 6 weeks of request", }, - default=None, - null=True + null=True, ) """ @@ -166,11 +164,11 @@ class KPI(models.Model, HelpTextMixin): """ assessment_of_mental_health_issues = models.IntegerField( help_text={ - 'label': '6. Assessment of mental health issues', - 'reference': "Percentage of children and young people with epilepsy where there is documented evidence that they have been asked about mental health either through clinical screening, or a questionnaire/measure." + "label": "6. Assessment of mental health issues", + "reference": "Percentage of children and young people with epilepsy where there is documented evidence that they have been asked about mental health either through clinical screening, or a questionnaire/measure.", }, default=None, - null=True + null=True, ) """ @@ -181,13 +179,12 @@ class KPI(models.Model, HelpTextMixin): Denominator= Number of children and young people diagnosed with epilepsy AND had a mental health issue identified """ mental_health_support = models.IntegerField( - help_text={ - 'label': '7. Mental health support', - 'reference': "Percentage of children and young people with epilepsy and a mental health problem who have evidence of mental health support" + "label": "7. Mental health support", + "reference": "Percentage of children and young people with epilepsy and a mental health problem who have evidence of mental health support", }, default=None, - null=True + null=True, ) """ @@ -199,11 +196,11 @@ class KPI(models.Model, HelpTextMixin): """ sodium_valproate = models.IntegerField( help_text={ - 'label': '8. Sodium Valproate', - 'reference': "Percentage of all females 12 years and above currently on valproate treatment with annual risk acknowledgement form completed" + "label": "8. Sodium Valproate", + "reference": "Percentage of all females 12 years and above currently on valproate treatment with annual risk acknowledgement form completed", }, default=None, - null=True + null=True, ) """ @@ -215,32 +212,31 @@ class KPI(models.Model, HelpTextMixin): """ comprehensive_care_planning_agreement = models.IntegerField( help_text={ - 'label': '9A. Comprehensive care planning agreement', - 'reference': "Percentage of children and young people with epilepsy after 12 months where there is evidence of a comprehensive care plan that is agreed between the person, their family and/or carers and primary and secondary care providers, and the care plan has been updated where necessary." + "label": "9A. Comprehensive care planning agreement", + "reference": "Percentage of children and young people with epilepsy after 12 months where there is evidence of a comprehensive care plan that is agreed between the person, their family and/or carers and primary and secondary care providers, and the care plan has been updated where necessary.", }, default=None, - null=True + null=True, ) """ - 9a. Percentage of children and young people with epilepsy after 12 months that had an individualised epilepsy document with individualised epilepsy document or a copy clinic letter that includes care planning information. + 9i. Percentage of children and young people with epilepsy after 12 months that had an individualised epilepsy document with individualised epilepsy document or a copy clinic letter that includes care planning information. Calculation Method Numerator = Number of children and young people diagnosed with epilepsy at first year AND( with individualised epilepsy document or copy clinic letter that includes care planning information ) Denominator = Number of children and young people diagnosed with epilepsy at first year """ patient_held_individualised_epilepsy_document = models.IntegerField( - help_text={ - 'label': '9a. Patient-held individualised epilepsy document/copy of clinic letter that includes care planning information', - 'reference': "Percentage of children and young people with epilepsy after 12 months that had an individualised epilepsy document with individualised epilepsy document or a copy clinic letter that includes care planning information." + "label": "i. Patient-held individualised epilepsy document/copy of clinic letter that includes care planning information", + "reference": "Percentage of children and young people with epilepsy after 12 months that had an individualised epilepsy document with individualised epilepsy document or a copy clinic letter that includes care planning information.", }, default=None, - null=True + null=True, ) """ - 9b. Percentage of children and young people with epilepsy after 12 months where there was evidence of agreement between the person, their family and/or carers as appropriate. + 9ii. Percentage of children and young people with epilepsy after 12 months where there was evidence of agreement between the person, their family and/or carers as appropriate. Calculation Method Numerator = Number of children and young people diagnosed with epilepsy at first year AND with evidence of agreement @@ -248,15 +244,15 @@ class KPI(models.Model, HelpTextMixin): """ patient_carer_parent_agreement_to_the_care_planning = models.IntegerField( help_text={ - 'label': '9b. Patient/carer/parent agreement to the care planning', - 'reference': "Percentage of children and young people with epilepsy after 12 months where there was evidence of agreement between the person, their family and/or carers as appropriate." + "label": "ii. Patient/carer/parent agreement to the care planning", + "reference": "Percentage of children and young people with epilepsy after 12 months where there was evidence of agreement between the person, their family and/or carers as appropriate.", }, default=None, - null=True + null=True, ) """ - 9c. Percentage of children and young people with epilepsy after 12 months where there is evidence that the care plan has been updated where necessary. + 9iii. Percentage of children and young people with epilepsy after 12 months where there is evidence that the care plan has been updated where necessary. Calculation Method Numerator = Number of children and young people diagnosed with epilepsy at first year AND with care plan which is updated where necessary @@ -264,11 +260,11 @@ class KPI(models.Model, HelpTextMixin): """ care_planning_has_been_updated_when_necessary = models.IntegerField( help_text={ - 'label': '9c. Care planning has been updated when necessary', - 'reference': "Percentage of children and young people with epilepsy after 12 months where there is evidence that the care plan has been updated where necessary." + "label": "iii. Care planning has been updated when necessary", + "reference": "Percentage of children and young people with epilepsy after 12 months where there is evidence that the care plan has been updated where necessary.", }, default=None, - null=True + null=True, ) """ @@ -280,15 +276,15 @@ class KPI(models.Model, HelpTextMixin): """ comprehensive_care_planning_content = models.IntegerField( help_text={ - 'label': '9B. Comprehensive care planning content', - 'reference': "Percentage of children diagnosed with epilepsy with documented evidence of communication regarding core elements of care planning (items a - f)." + "label": "9B. Comprehensive care planning content", + "reference": "Percentage of children diagnosed with epilepsy with documented evidence of communication regarding core elements of care planning (items a - f).", }, default=None, - null=True + null=True, ) """ - 9a. Percentage of children and young people with epilepsy who have been prescribed rescue medication and have evidence of a written prolonged seizures plan. + 9i. Percentage of children and young people with epilepsy who have been prescribed rescue medication and have evidence of a written prolonged seizures plan. Calculation Method Numerator = Number of children and young people diagnosed with epilepsy at first year AND prescribed rescue medication AND evidence of a written prolonged seizures plan @@ -296,15 +292,15 @@ class KPI(models.Model, HelpTextMixin): """ parental_prolonged_seizures_care_plan = models.IntegerField( help_text={ - 'label': '9a. Parental prolonged seizures care plan', - 'reference': "Percentage of children and young people with epilepsy who have been prescribed rescue medication and have evidence of a written prolonged seizures plan." + "label": "i. Parental prolonged seizures care plan", + "reference": "Percentage of children and young people with epilepsy who have been prescribed rescue medication and have evidence of a written prolonged seizures plan.", }, default=None, - null=True + null=True, ) """ - 9b. Water Safety + 9ii. Water Safety Percentage of children and young people with epilepsy with evidence of discussion regarding water safety. @@ -314,15 +310,15 @@ class KPI(models.Model, HelpTextMixin): """ water_safety = models.IntegerField( help_text={ - 'label': '9b. Water safety', - 'reference': "Percentage of children and young people with epilepsy with evidence of discussion regarding water safety." + "label": "ii. Water safety", + "reference": "Percentage of children and young people with epilepsy with evidence of discussion regarding water safety.", }, default=None, - null=True + null=True, ) """ - 9c. First Aid + 9iii. First Aid Percentage of children and young people with epilepsy with evidence of discussion regarding first aid. @@ -332,15 +328,15 @@ class KPI(models.Model, HelpTextMixin): """ first_aid = models.IntegerField( help_text={ - 'label': '9c. First aid', - 'reference': "Percentage of children and young people with epilepsy with evidence of discussion regarding first aid." + "label": "iii. First aid", + "reference": "Percentage of children and young people with epilepsy with evidence of discussion regarding first aid.", }, default=None, - null=True + null=True, ) """ - 9d. General participation and risk + 9iv. General participation and risk Percentage of children and young people with epilepsy with evidence of discussion regarding general participation and risk. @@ -350,15 +346,15 @@ class KPI(models.Model, HelpTextMixin): """ general_participation_and_risk = models.IntegerField( help_text={ - 'label': '9d. General participation and risk', - 'reference': "Percentage of children and young people with epilepsy with evidence of discussion regarding general participation and risk." + "label": "iv. General participation and risk", + "reference": "Percentage of children and young people with epilepsy with evidence of discussion regarding general participation and risk.", }, default=None, - null=True + null=True, ) """ - 9e. SUDEP + 9v. SUDEP Percentage of children and young people with epilepsy with evidence of discussion regarding SUDEP and evidence of a prolonged seizures care plan. @@ -368,15 +364,15 @@ class KPI(models.Model, HelpTextMixin): """ sudep = models.IntegerField( help_text={ - 'label': '9e. Sudden unexplained death in epilepsy', - 'reference': "Percentage of children and young people with epilepsy with evidence of discussion regarding SUDEP and evidence of a prolonged seizures care plan." + "label": "v. Sudden unexpected death in epilepsy", + "reference": "Percentage of children and young people with epilepsy with evidence of discussion regarding SUDEP (Sudden unexpected death in epilepsy) and evidence of a prolonged seizures care plan.", }, default=None, - null=True + null=True, ) """ - 9f. Service contact details + 9vi. Service contact details Percentage of children and young people with epilepsy with evidence of being given service contact details. @@ -387,11 +383,11 @@ class KPI(models.Model, HelpTextMixin): service_contact_details = models.IntegerField( help_text={ - 'label': '9f. Service contact details', - 'reference': "Percentage of children and young people with epilepsy with evidence of being given service contact details." + "label": "vi. Service contact details", + "reference": "Percentage of children and young people with epilepsy with evidence of being given service contact details.", }, default=None, - null=True + null=True, ) """ @@ -405,25 +401,22 @@ class KPI(models.Model, HelpTextMixin): """ school_individual_healthcare_plan = models.IntegerField( help_text={ - 'label': '10. School individualised health care plan', - 'reference': "Percentage of children and young people with epilepsy aged 4 years and above with evidence of a school individual healthcare plan by 1 year after first paediatric assessment." + "label": "10. School individualised health care plan", + "reference": "Percentage of children and young people with epilepsy aged 4 years and above with evidence of a school individual healthcare plan by 1 year after first paediatric assessment.", }, default=None, - null=True + null=True, ) organisation = models.ForeignKey( - "epilepsy12.Organisation", - on_delete=models.CASCADE + "epilepsy12.Organisation", on_delete=models.CASCADE ) - parent_trust = models.CharField( - max_length=250 - ) + parent_trust = models.CharField(max_length=250) class Meta: verbose_name = _("KPI ") verbose_name_plural = _("KPIs") def __str__(self): - return f'KPI for child in {self.organisation.OrganisationName}({self.parent_trust})' + return f"KPI for child in {self.organisation.OrganisationName}({self.parent_trust})" diff --git a/static/styles/style.css b/static/styles/style.css index ea1896cc..a87d055a 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -27,20 +27,31 @@ } :root { - --rcpch_lightest_blue: #f0fafe; --rcpch_lightest_grey: #f3f3f3; - /* --rcpch_light_blue: #0c98dd; */ + + --rcpch_dark_blue: #0d0d58; --rcpch_strong_blue: #3366cc; /* 51,102,204 */ - --rcpch_dark_blue: #0d0d58; + --rcpch_strong_blue_light_tint1: #668cd9; + --rcpch_strong_blue_light_tint2: #99b3e6; + --rcpch_strong_blue_light_tint3: #ccd9f2; + --rcpch_strong_blue_dark_tint: #405a97; + /* 45,49,109 */ --rcpch_light_blue: #11a7f2; + --rcpch_light_blue_tint1: #4dbdf5; + --rcpch_light_blue_tint2: #88d3f9; + --rcpch_light_blue_tint3: #cfe9fc; + --rcpch_light_blue_dark_tint: #0082bc; /* 17,167,242 */ + --rcpch_pink: #e00087; /* 224,0,135 */ - --rcpch_light_pink: #ffe0f3; - --rcpch_lightest_pink: #fbe5f3; - /* 224,0,135 */ + --rcpch_pink_light_tint1: #e840a5; + --rcpch_pink_light_tint2: #ef80c3; + --rcpch_pink_light_tint3: #f7bfe1; + --rcpch_pink_dark_tint: #ab1368; + /* monochrome */ --rcpch_white: #ffffff; --rcpch_light_grey: #d9d9d9; @@ -53,20 +64,52 @@ /* 77,77,77 */ --rcpch_charcoal_dark: #191919; --rcpch_black: #000000; - /* secondary colours */ + + /* secondary colours */ --rcpch_red: #e60700; - --rcpch_light_red: #ffe7e6; + --rcpch_red_light_tint1: #ec4540; + --rcpch_red_light_tint2: #f38380; + --rcpch_red_light_tint3: #f9c1bf; + --rcpch_red_dark_tint: #b11d23; + --rcpch_orange: #ff8000; - --rcpch_light_orange: #ffdab5; - --rcpch_yellow: #fdc300; + --rcpch_orange_light_tint1: #ffa040; + --rcpch_orange_light_tint2: #ffc080; + --rcpch_orange_light_tint3: #ffdfbf; + --rcpch_orange_dark_tint: #bf6914; + + --rcpch_yellow: #ffd200; + --rcpch_yellow_light_tint1: #ffdd40; + --rcpch_yellow_light_tint2: #ffe980; + --rcpch_yellow_light_tint3: #fff4bf; + --rcpch_yellow_dark_tint: #c5a000; + + --rcpch_strong_green: #66cc33; + --rcpch_strong_green_light_tint1: #8cd966; + --rcpch_strong_green_light_tint2: #b3e699; + --rcpch_strong_green_light_tint3: #d9f2cc; + --rcpch_strong_green_dark_tint: #53861b; + + --rcpch_aqua_green: #00bdaa; + --rcpch_aqua_green_light_tint1: #40ecbf; + --rcpch_aqua_green_light_tint2: #80ded4; + --rcpch_aqua_green_light_tint3: #bfeeea; + --rcpch_aqua_green_dark_tint: #2e888d; + + --rcpch_purple: #7159aa; + --rcpch_purple_light_tint1: #ae4cbf; + --rcpch_purple_light_tint2: #c987d4; + --rcpch_purple_light_tint3: #e4c3ea; + --rcpch_purple_dark_tint: #66296c; + +/* old colours */ --rcpch_gold: #c2a712; --rcpch_vivid_green: #c8d400; - --rcpch_aqua_green: #00dbaa; - /* SGA colours */ - --rcpch_purple: #7159aa; - --rcpch_magenta: #e00087; - --rcpch_strong_green: #66cc33; --rcpch_dark_red: #9a0500; + + + + /* STANDARD FONT */ --rcpch_standard_font: Montserrat-Regular; --rcpch_bold_font: Montserrat-Bold; @@ -429,7 +472,7 @@ div.ui.card > div.content > div.organisation_address_container { } .ui.rcpch_lightest_blue.message { - background-color: var(--rcpch_lightest_blue); + background-color: var(--rcpch_light_blue_tint2); color: var(--rcpch_black); } @@ -791,15 +834,15 @@ div.ui.card > div.content > div.organisation_address_container { color: white; } -.ui.rcpch_light_pink.search.selection.fluid.dropdown { +.ui.--rcpch_pink_light_tint2.search.selection.fluid.dropdown { border: 3px solid var(--rcpch_pink) !important; -webkit-box-shadow: 0px 0px 0px 100px var(--rcpch_white) inset !important; box-shadow: 0px 0px 0px 100px var(--rcpch_white) inset !important; border-radius: 0%; } -.ui.rcpch_light_pink.dropdown .item:hover { - background-color: var(--rcpch_light_pink); +.ui.--rcpch_pink_light_tint2.dropdown .item:hover { + background-color: var(--rcpch_pink_light_tint2); color: white; } @@ -1053,8 +1096,8 @@ div.ui.card > div.content > div.organisation_address_container { .ui.form .field.field input:-webkit-autofill:focus { border: 3px solid rgba(17, 167, 242, 1) !important; - -webkit-box-shadow: 0px 0px 0px 100px var(--rcpch_lightest_blue) inset !important; - box-shadow: 0px 0px 0px 100px var(--rcpch_lightest_blue) inset !important; + -webkit-box-shadow: 0px 0px 0px 100px var(--rcpch_light_blue_tint2) inset !important; + box-shadow: 0px 0px 0px 100px var(--rcpch_light_blue_tint2) inset !important; } .ui.form .field.field input:-webkit-autofill { @@ -1143,7 +1186,7 @@ div.ui.card > div.content > div.organisation_address_container { } .ui.rcpch.selection.active.dropdown ::-webkit-scrollbar { - background-color: var(--rcpch_lightest_blue); + background-color: var(--rcpch_light_blue_tint2); } .ui.rcpch.selection.active.dropdown ::-webkit-scrollbar-thumb { @@ -1235,12 +1278,12 @@ div.ui.card > div.content > div.organisation_address_container { } .ui.rcpch.table .subcategory-header { - background-color: var(--rcpch_mid_grey); + background-color: var(--rcpch_light_blue_tint2); font-family: var(--rcpch_bold_font); } .ui.rcpch.table .subcategory-row { - background-color: var(--rcpch_light_grey); + background-color: var(--rcpch_light_blue_tint3); } /* rcpch message */ @@ -1248,7 +1291,7 @@ div.ui.card > div.content > div.organisation_address_container { .ui.rcpch_info.message { border-radius: 0%; color: var(--rcpch_dark_blue); - background-color: var(--rcpch_lightest_blue); + background-color: var(--rcpch_light_blue_tint3); -webkit-box-shadow: 0px 0px 0px 1px rgba(51, 102, 204, 0.22) inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); box-shadow: 0px 0px 0px 1px rgba(51, 102, 204, 0.22) inset, @@ -1266,7 +1309,7 @@ div.ui.card > div.content > div.organisation_address_container { .ui.rcpch_important.message { border-radius: 0%; color: var(--rcpch_charcoal); - background-color: var(--rcpch_lightest_blue); + background-color: var(--rcpch_light_blue_tint2); -webkit-box-shadow: 0px 0px 0px 1px rgba(51, 102, 204, 0.22) inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); box-shadow: 0px 0px 0px 1px rgba(51, 102, 204, 0.22) inset, @@ -1280,7 +1323,7 @@ div.ui.card > div.content > div.organisation_address_container { .ui.rcpch_warning.message { border-radius: 0%; color: var(--rcpch_red); - background-color: var(--rcpch_light_red); + background-color: var(--rcpch_red_light_tint3); -webkit-box-shadow: 0px 0px 0px 1px rgba(90, 3, 0, 0.22) inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); box-shadow: 0px 0px 0px 1px rgba(90, 3, 0, 0.22) inset, @@ -1379,7 +1422,7 @@ a label { } .ui.rcpch_secret.label { - background-color: var(--rcpch_lightest_blue); + background-color: var(--rcpch_light_blue_tint2); color: var(--rcpch_dark_grey); border-radius: 0%; } @@ -1402,7 +1445,7 @@ a label { .ui.rcpch_warning.basic.label { color: var(--rcpch_dark_red); - background-color: var(--rcpch_light_red); + background-color: var(--rcpch_red_light_tint3); border-radius: 0%; border-color: var(--rcpch_dark_red); margin-top: 1em; From 3c763826c55183529bfb853f23287569773d0c06 Mon Sep 17 00:00:00 2001 From: Simon Chapman Date: Fri, 28 Apr 2023 19:23:04 +0100 Subject: [PATCH 08/33] add new rcpch colours - styling to information messages - refactor kpi numbering --- static/styles/style.css | 2 +- .../assessment/consultant_paediatrician.html | 2 +- .../partials/assessment/epilepsy_nurse.html | 2 +- .../partials/assessment/epilepsy_surgery.html | 4 +- .../assessment/paediatric_neurology.html | 2 +- .../partials/charts/deprivation_scores.html | 76 ++++++++++--------- 6 files changed, 48 insertions(+), 40 deletions(-) diff --git a/static/styles/style.css b/static/styles/style.css index a87d055a..660fbf4b 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -1309,7 +1309,7 @@ div.ui.card > div.content > div.organisation_address_container { .ui.rcpch_important.message { border-radius: 0%; color: var(--rcpch_charcoal); - background-color: var(--rcpch_light_blue_tint2); + background-color: var(--rcpch_light_blue_tint3); -webkit-box-shadow: 0px 0px 0px 1px rgba(51, 102, 204, 0.22) inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); box-shadow: 0px 0px 0px 1px rgba(51, 102, 204, 0.22) inset, diff --git a/templates/epilepsy12/partials/assessment/consultant_paediatrician.html b/templates/epilepsy12/partials/assessment/consultant_paediatrician.html index a651a419..6ebe08b5 100644 --- a/templates/epilepsy12/partials/assessment/consultant_paediatrician.html +++ b/templates/epilepsy12/partials/assessment/consultant_paediatrician.html @@ -8,7 +8,7 @@ {% if assessment.consultant_paediatrician_referral_made %} -
+
{% url 'consultant_paediatrician_referral_date' assessment_id=assessment.pk as hx_post %} {% include 'epilepsy12/partials/page_elements/date_field.html' with hx_post=hx_post hx_swap="innerHTML" hx_target="#general_paediatric" hx_trigger="change delay:1s" label=assessment.get_consultant_paediatrician_referral_date_help_label_text reference=assessment.get_consultant_paediatrician_referral_date_help_reference_text date_value=assessment.consultant_paediatrician_referral_date input_date_field_name="consultant_paediatrician_referral_date" data_position="top left" error_message=error_message enabled=perms.epilepsy12.change_assessment has_permission=perms.epilepsy12.change_assessment %} diff --git a/templates/epilepsy12/partials/assessment/epilepsy_nurse.html b/templates/epilepsy12/partials/assessment/epilepsy_nurse.html index 35f8c3e5..6b43d71f 100644 --- a/templates/epilepsy12/partials/assessment/epilepsy_nurse.html +++ b/templates/epilepsy12/partials/assessment/epilepsy_nurse.html @@ -8,7 +8,7 @@ {% if assessment.epilepsy_specialist_nurse_referral_made %} -
+
{% url 'epilepsy_specialist_nurse_referral_date' assessment_id=assessment.pk as hx_post %} {% include 'epilepsy12/partials/page_elements/date_field.html' with hx_post=hx_post hx_swap="innerHTML" hx_target="#epilepsy_specialist_nurse" hx_trigger="change delay:1s" label=assessment.get_epilepsy_specialist_nurse_referral_date_help_label_text reference=assessment.get_epilepsy_specialist_nurse_referral_date_help_reference_text date_value=assessment.epilepsy_specialist_nurse_referral_date data_position='top left' input_date_field_name="epilepsy_specialist_nurse_referral_date" error_message=error_message enabled=perms.epilepsy12.change_assessment has_permission=perms.epilepsy12.change_assessment %} diff --git a/templates/epilepsy12/partials/assessment/epilepsy_surgery.html b/templates/epilepsy12/partials/assessment/epilepsy_surgery.html index 7b2f0908..39c45f27 100644 --- a/templates/epilepsy12/partials/assessment/epilepsy_surgery.html +++ b/templates/epilepsy12/partials/assessment/epilepsy_surgery.html @@ -1,7 +1,7 @@ {% load epilepsy12_template_tags %}
-
+
Criteria for referral to a children's epilepsy surgery service: @@ -27,7 +27,7 @@ {% if assessment.childrens_epilepsy_surgical_service_referral_made %} -
+
{% url 'childrens_epilepsy_surgical_service_referral_date' assessment_id=assessment.pk as hx_post %} {% include 'epilepsy12/partials/page_elements/date_field.html' with hx_post=hx_post hx_swap="innerHTML" hx_target="#childrens_epilepsy_surgical_service" hx_trigger="change delay:1s" label=assessment.get_childrens_epilepsy_surgical_service_referral_date_help_label_text reference=assessment.get_childrens_epilepsy_surgical_service_referral_date_help_reference_text date_value=assessment.childrens_epilepsy_surgical_service_referral_date input_date_field_name="childrens_epilepsy_surgical_service_referral_date" error_message=error_message enabled=perms.epilepsy12.change_assessment has_permission=perms.epilepsy12.change_assessment %} diff --git a/templates/epilepsy12/partials/assessment/paediatric_neurology.html b/templates/epilepsy12/partials/assessment/paediatric_neurology.html index b96c2c47..909d8bb4 100644 --- a/templates/epilepsy12/partials/assessment/paediatric_neurology.html +++ b/templates/epilepsy12/partials/assessment/paediatric_neurology.html @@ -6,7 +6,7 @@ {% if assessment.paediatric_neurologist_referral_made %} -
+
{% url 'paediatric_neurologist_referral_date' assessment_id=assessment.pk as hx_post %} {% include 'epilepsy12/partials/page_elements/date_field.html' with hx_post=hx_post hx_swap="innerHTML" hx_target="#paediatric_neurology" hx_trigger="change delay:1s" label=assessment.get_paediatric_neurologist_referral_date_help_label_text reference=assessment.get_paediatric_neurologist_referral_date_help_reference_text date_value=assessment.paediatric_neurologist_referral_date input_date_field_name="paediatric_neurologist_referral_date" error_message=error_message enabled=perms.epilepsy12.change_assessment has_permission=perms.epilepsy12.change_assessment %} diff --git a/templates/epilepsy12/partials/charts/deprivation_scores.html b/templates/epilepsy12/partials/charts/deprivation_scores.html index 01bbf143..0d8ee714 100644 --- a/templates/epilepsy12/partials/charts/deprivation_scores.html +++ b/templates/epilepsy12/partials/charts/deprivation_scores.html @@ -5,18 +5,26 @@ crossorigin="anonymous" > - + {{ redirect_to_login_immediately }} From a61378f86fc4f29ba64f1649330931f2a7624224 Mon Sep 17 00:00:00 2001 From: anchit-chandran Date: Tue, 2 May 2023 12:10:08 +0100 Subject: [PATCH 29/33] implement enhanced kpi data labels + colors Signed-off-by: anchit-chandran --- .../common_view_functions/aggregate_by.py | 3 +- .../templatetags/epilepsy12_template_tags.py | 8 ++- epilepsy12/view_folder/organisation_views.py | 1 + .../organisations_ranked_by_kpi_measure.html | 61 +++++++++++++------ 4 files changed, 53 insertions(+), 20 deletions(-) diff --git a/epilepsy12/common_view_functions/aggregate_by.py b/epilepsy12/common_view_functions/aggregate_by.py index e5ecf84b..fc9cd30e 100644 --- a/epilepsy12/common_view_functions/aggregate_by.py +++ b/epilepsy12/common_view_functions/aggregate_by.py @@ -264,7 +264,8 @@ def return_all_aggregated_kpis_for_cohort_and_abstraction_level_annotated_by_sub final_object.append( { "region": label, - "aggregated_kpis": aggregated_kpis + "aggregated_kpis": aggregated_kpis, + 'color' : '#808080' if aggregated_kpis[kpi_measure] is None else '#000000', } ) diff --git a/epilepsy12/templatetags/epilepsy12_template_tags.py b/epilepsy12/templatetags/epilepsy12_template_tags.py index c2f5e181..57776f75 100644 --- a/epilepsy12/templatetags/epilepsy12_template_tags.py +++ b/epilepsy12/templatetags/epilepsy12_template_tags.py @@ -50,9 +50,13 @@ def percentage_of_total(numerator, denominator): @register.simple_tag -def kpi_for_kpi_name(aggregated_kpi, kpi_name): +def kpi_for_kpi_name(aggregated_kpi, kpi_name, color=False): + + # guard clause check if color should be returned + if color: + return aggregated_kpi['color'] if aggregated_kpi['aggregated_kpis'][kpi_name] is None: - return 0 + return -1 else: pct = 100*aggregated_kpi['aggregated_kpis'][kpi_name] / aggregated_kpi['aggregated_kpis']['total_number_of_cases'] return pct diff --git a/epilepsy12/view_folder/organisation_views.py b/epilepsy12/view_folder/organisation_views.py index 9d84f1c6..ae8c456e 100644 --- a/epilepsy12/view_folder/organisation_views.py +++ b/epilepsy12/view_folder/organisation_views.py @@ -543,6 +543,7 @@ def selected_trust_select_kpi(request, organisation_id): "national_kpi": national_kpi[kpi_name], "total_national_kpi_cases": national_kpi["total_number_of_cases"], "open_uk": all_aggregated_kpis_by_open_uk_region_in_current_cohort, + # "open_uk_data_colors": [color for color in all_aggregated_kpis_by_open_uk_region_in_current_cohort], "open_uk_avg": open_uk_avg, "open_uk_title": f"{kpi_value} by OPEN UK Region", "open_uk_id": "open_uk_id", diff --git a/templates/epilepsy12/partials/charts/organisations_ranked_by_kpi_measure.html b/templates/epilepsy12/partials/charts/organisations_ranked_by_kpi_measure.html index 216c533c..b861a52c 100644 --- a/templates/epilepsy12/partials/charts/organisations_ranked_by_kpi_measure.html +++ b/templates/epilepsy12/partials/charts/organisations_ranked_by_kpi_measure.html @@ -3,6 +3,18 @@
From e77f4293e96f60416ef66b6c4923d4e3c7619f36 Mon Sep 17 00:00:00 2001 From: anchit-chandran Date: Tue, 2 May 2023 12:37:03 +0100 Subject: [PATCH 30/33] fix styling case create buttons Signed-off-by: anchit-chandran --- static/styles/style.css | 5 ++ templates/epilepsy12/forms/case_form.html | 103 ++++++++++++---------- 2 files changed, 62 insertions(+), 46 deletions(-) diff --git a/static/styles/style.css b/static/styles/style.css index 184c039e..d9e25321 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -1901,4 +1901,9 @@ div.sixteen.wide.column.search_field_wrapper > .ui.rcpch.icon.input { .notupperpadded { padding-top: 0 !important; +} + + +.case_create_buttons_wrapper { + display: flex; } \ No newline at end of file diff --git a/templates/epilepsy12/forms/case_form.html b/templates/epilepsy12/forms/case_form.html index 178cea4e..0e183e23 100644 --- a/templates/epilepsy12/forms/case_form.html +++ b/templates/epilepsy12/forms/case_form.html @@ -80,60 +80,71 @@ {% if case and perms.epilepsy.can_opt_out_child_from_inclusion_in_audit %} -
- -

- Children, young people and their families can opt out of Epilepsy12 at any - time. Should {{case}} or their family choose to do so, all records - relating to {{case}}'s epilepsy care will be removed from RCPCH servers. -

- +
+
+ +

+ Children, young people and their families can opt out of Epilepsy12 at any + time. Should {{case}} or their family choose to do so, all records + relating to {{case}}'s epilepsy care will be removed from RCPCH servers. +

+ +
{% else %} -
- -
-
Organisation
-

- {{organisation.OrganisationName}}({{organisation.ParentOrganisation_OrganisationName}}) - will be allocated automatically as the lead Epilepsy12 centre on saving - this child's information. -

+
+
+ +
+
Organisation
+

+ {{organisation.OrganisationName}}({{organisation.ParentOrganisation_OrganisationName}}) + will be allocated automatically as the lead Epilepsy12 centre on saving + this child's information. +

+
- {% endif %} {% if perms.epilepsy12.change_case or perms.epilepsy12.add_case %} - - {% endif %} {% if perms.epilepsy12.delete_case %} - + {% endif %} + +
+
+ Cancel + {% if perms.epilepsy12.change_case or perms.epilepsy12.add_case %} + - {% endif %} - - Cancel + {% endif %} + {% if perms.epilepsy12.delete_case %} + + + {% endif %} +
+
From d2be676ea557033979927611841d8595d00d9c4f Mon Sep 17 00:00:00 2001 From: anchit-chandran Date: Tue, 2 May 2023 12:40:13 +0100 Subject: [PATCH 31/33] fixes buttons e12 user create form Signed-off-by: anchit-chandran --- templates/registration/admin_create_user.html | 130 +++++++++--------- 1 file changed, 63 insertions(+), 67 deletions(-) diff --git a/templates/registration/admin_create_user.html b/templates/registration/admin_create_user.html index 257758c2..d09b1c46 100644 --- a/templates/registration/admin_create_user.html +++ b/templates/registration/admin_create_user.html @@ -106,75 +106,71 @@

{{admin_title}}

- - - {% if not form.email_confirmed.value and admin_title != "Add RCPCH Epilepsy12 staff member" and admin_title != 'Add Epilepsy12 User' %} - - + {% endif %} + {{form.email_confirmed.as_hidden}} + {% if admin_title != 'Add Epilepsy12 User' and admin_title != "Add RCPCH Epilepsy12 staff member" %} + - Resend Email - - - {% endif %} - - {{form.email_confirmed.as_hidden}} - - {% if admin_title != 'Add Epilepsy12 User' and admin_title != "Add RCPCH Epilepsy12 staff member" %} - - - - {% endif %} - - Cancel + end + " + /> + + {% endif %} + + Cancel +
From eb26b0dec5b5bd6145cba5ac718a07b0336d0398 Mon Sep 17 00:00:00 2001 From: Simon Chapman Date: Wed, 3 May 2023 18:42:48 +0100 Subject: [PATCH 32/33] Regional individual KPI chart should just be the 7 regions, exclude health boards Fixes #460 --- .../common_view_functions/report_queries.py | 143 +++++++++++------- 1 file changed, 92 insertions(+), 51 deletions(-) diff --git a/epilepsy12/common_view_functions/report_queries.py b/epilepsy12/common_view_functions/report_queries.py index b8c1113b..315a72d5 100644 --- a/epilepsy12/common_view_functions/report_queries.py +++ b/epilepsy12/common_view_functions/report_queries.py @@ -1,16 +1,31 @@ # python imports from typing import Literal + # django imports from django.contrib.gis.db.models import Q # E12 imports -from ..models import Case, Organisation, NHSRegionEntity, OPENUKNetworkEntity, IntegratedCareBoardEntity, ONSCountryEntity - - -def all_registered_cases_for_cohort_and_abstraction_level(organisation_instance, cohort, case_complete=True, abstraction_level: Literal['organisation', 'trust', 'icb', 'nhs_region', 'open_uk', 'country', 'national'] = 'organisation'): +from ..models import ( + Case, + Organisation, + NHSRegionEntity, + OPENUKNetworkEntity, + IntegratedCareBoardEntity, + ONSCountryEntity, +) + + +def all_registered_cases_for_cohort_and_abstraction_level( + organisation_instance, + cohort, + case_complete=True, + abstraction_level: Literal[ + "organisation", "trust", "icb", "nhs_region", "open_uk", "country", "national" + ] = "organisation", +): """ Returns all Cases that have been registered for a given cohort at a given abstration level. - It can return cases that are only registered in E12 for a given cohort but have not yet completed the return, or + It can return cases that are only registered in E12 for a given cohort but have not yet completed the return, or cases that are both registered and have also completed all required fields in the return. Parameters accepted: Organisation instance @@ -26,66 +41,78 @@ def all_registered_cases_for_cohort_and_abstraction_level(organisation_instance, if case_complete: all_cases_for_cohort = Case.objects.filter( - Q(registration__isnull=False) & - Q(registration__audit_progress__registration_complete=True) & - Q(registration__audit_progress__first_paediatric_assessment_complete=True) & - Q(registration__audit_progress__assessment_complete=True) & - Q(registration__audit_progress__epilepsy_context_complete=True) & - Q(registration__audit_progress__multiaxial_diagnosis_complete=True) & - Q(registration__audit_progress__investigations_complete=True) & - Q(registration__audit_progress__management_complete=True) & - Q(registration__cohort=cohort) + Q(registration__isnull=False) + & Q(registration__audit_progress__registration_complete=True) + & Q(registration__audit_progress__first_paediatric_assessment_complete=True) + & Q(registration__audit_progress__assessment_complete=True) + & Q(registration__audit_progress__epilepsy_context_complete=True) + & Q(registration__audit_progress__multiaxial_diagnosis_complete=True) + & Q(registration__audit_progress__investigations_complete=True) + & Q(registration__audit_progress__management_complete=True) + & Q(registration__cohort=cohort) ).all() else: all_cases_for_cohort = Case.objects.filter( - Q(registration__isnull=False) & - Q(registration__cohort=cohort) + Q(registration__isnull=False) & Q(registration__cohort=cohort) ).all() - if abstraction_level == 'organisation': + if abstraction_level == "organisation": q_filter = ( - Q(site__organisation__pk=organisation_instance.pk) & - Q(site__site_is_actively_involved_in_epilepsy_care=True) & - Q(site__site_is_primary_centre_of_epilepsy_care=True) + Q(site__organisation__pk=organisation_instance.pk) + & Q(site__site_is_actively_involved_in_epilepsy_care=True) + & Q(site__site_is_primary_centre_of_epilepsy_care=True) ) - elif abstraction_level == 'trust': + elif abstraction_level == "trust": q_filter = ( - Q(site__organisation__ParentOrganisation_ODSCode=organisation_instance.ParentOrganisation_ODSCode) & - Q(site__site_is_actively_involved_in_epilepsy_care=True) & - Q(site__site_is_primary_centre_of_epilepsy_care=True) + Q( + site__organisation__ParentOrganisation_ODSCode=organisation_instance.ParentOrganisation_ODSCode + ) + & Q(site__site_is_actively_involved_in_epilepsy_care=True) + & Q(site__site_is_primary_centre_of_epilepsy_care=True) ) - elif abstraction_level == 'icb': + elif abstraction_level == "icb": q_filter = ( - Q(site__organisation__integrated_care_board__ODS_ICB_Code=organisation_instance.integrated_care_board.ODS_ICB_Code) & - Q(site__site_is_actively_involved_in_epilepsy_care=True) & - Q(site__site_is_primary_centre_of_epilepsy_care=True) + Q( + site__organisation__integrated_care_board__ODS_ICB_Code=organisation_instance.integrated_care_board.ODS_ICB_Code + ) + & Q(site__site_is_actively_involved_in_epilepsy_care=True) + & Q(site__site_is_primary_centre_of_epilepsy_care=True) ) - elif abstraction_level == 'nhs_region': + elif abstraction_level == "nhs_region": q_filter = ( - Q(site__organisation__nhs_region__NHS_Region_Code=organisation_instance.nhs_region.NHS_Region_Code) & - Q(site__site_is_actively_involved_in_epilepsy_care=True) & - Q(site__site_is_primary_centre_of_epilepsy_care=True) + Q( + site__organisation__nhs_region__NHS_Region_Code=organisation_instance.nhs_region.NHS_Region_Code + ) + & Q( + site__organisation__ons_region__ons_country__Country_ONS_Name=organisation_instance.ons_region.ons_country.Country_ONS_Name + ) + & Q(site__site_is_actively_involved_in_epilepsy_care=True) + & Q(site__site_is_primary_centre_of_epilepsy_care=True) ) - elif abstraction_level == 'open_uk': + elif abstraction_level == "open_uk": q_filter = ( - Q(site__organisation__openuk_network__OPEN_UK_Network_Code=organisation_instance.openuk_network.OPEN_UK_Network_Code) & - Q(site__site_is_actively_involved_in_epilepsy_care=True) & - Q(site__site_is_primary_centre_of_epilepsy_care=True) + Q( + site__organisation__openuk_network__OPEN_UK_Network_Code=organisation_instance.openuk_network.OPEN_UK_Network_Code + ) + & Q(site__site_is_actively_involved_in_epilepsy_care=True) + & Q(site__site_is_primary_centre_of_epilepsy_care=True) ) - elif abstraction_level == 'country': + elif abstraction_level == "country": q_filter = ( - Q(site__organisation__ons_region__ons_country=organisation_instance.ons_region.ons_country) & - Q(site__site_is_actively_involved_in_epilepsy_care=True) & - Q(site__site_is_primary_centre_of_epilepsy_care=True) + Q( + site__organisation__ons_region__ons_country=organisation_instance.ons_region.ons_country + ) + & Q(site__site_is_actively_involved_in_epilepsy_care=True) + & Q(site__site_is_primary_centre_of_epilepsy_care=True) ) - elif abstraction_level == 'national': - q_filter = ( - Q(site__site_is_actively_involved_in_epilepsy_care=True) & - Q(site__site_is_primary_centre_of_epilepsy_care=True) + elif abstraction_level == "national": + q_filter = Q(site__site_is_actively_involved_in_epilepsy_care=True) & Q( + site__site_is_primary_centre_of_epilepsy_care=True ) else: raise ValueError( - f"Incorrect or invalid abstraction error f{abstraction_level} supplied.") + f"Incorrect or invalid abstraction error f{abstraction_level} supplied." + ) return all_cases_for_cohort.filter(q_filter) @@ -98,7 +125,7 @@ def get_all_countries(): # return Organisation.objects.order_by('CountryONSCode', # 'Country').values_list('CountryONSCode', # 'Country').distinct() - return ONSCountryEntity.objects.order_by('Country_ONS_Name') + return ONSCountryEntity.objects.order_by("Country_ONS_Name") def get_all_nhs_regions(): @@ -109,7 +136,9 @@ def get_all_nhs_regions(): # return Organisation.objects.order_by('NHSEnglandRegionCode', # 'NHSEnglandRegion').values_list('NHSEnglandRegionCode', # 'NHSEnglandRegion').distinct() - return NHSRegionEntity.objects.order_by('NHS_Region', 'NHS_Region_Code') + return NHSRegionEntity.objects.filter(year=2019).order_by( + "NHS_Region", "NHS_Region_Code" + ) def get_all_open_uk_regions(): @@ -120,7 +149,7 @@ def get_all_open_uk_regions(): # return Organisation.objects.order_by('OPENUKNetworkCode', # 'OPENUKNetworkName').values_list('OPENUKNetworkCode', # 'OPENUKNetworkName').distinct() - return OPENUKNetworkEntity.objects.order_by('OPEN_UK_Network_Name', 'country') + return OPENUKNetworkEntity.objects.order_by("OPEN_UK_Network_Name", "country") def get_all_icbs(): @@ -130,18 +159,30 @@ def get_all_icbs(): # return Organisation.objects.order_by('ICBODSCode', # 'ICBName').values_list('ICBODSCode', # 'ICBName').distinct() - return IntegratedCareBoardEntity.objects.order_by('ICB_Name') + return IntegratedCareBoardEntity.objects.order_by("ICB_Name") def get_all_trusts(): """ Returns a list of all Trusts """ - return Organisation.objects.order_by('ParentOrganisation_OrganisationName', 'ParentOrganisation_ODSCode').values_list('ParentOrganisation_ODSCode', 'ParentOrganisation_OrganisationName').distinct() + return ( + Organisation.objects.order_by( + "ParentOrganisation_OrganisationName", "ParentOrganisation_ODSCode" + ) + .values_list( + "ParentOrganisation_ODSCode", "ParentOrganisation_OrganisationName" + ) + .distinct() + ) def get_all_organisations(): """ Returns a list of all Organisations """ - return Organisation.objects.order_by('OrganisationName', 'ODSCode').values_list('OrganisationName', 'ODSCode').distinct() + return ( + Organisation.objects.order_by("OrganisationName", "ODSCode") + .values_list("OrganisationName", "ODSCode") + .distinct() + ) From f8965d0265778d69e120eb79f63c0e9f45ef2b73 Mon Sep 17 00:00:00 2001 From: Simon Chapman Date: Fri, 5 May 2023 11:22:42 +0100 Subject: [PATCH 33/33] seed function for only 20 cases in 2 organisations --- epilepsy12/management/commands/seed.py | 143 +++++++++++++++++-------- 1 file changed, 99 insertions(+), 44 deletions(-) diff --git a/epilepsy12/management/commands/seed.py b/epilepsy12/management/commands/seed.py index 93f8a5fe..75b70dae 100644 --- a/epilepsy12/management/commands/seed.py +++ b/epilepsy12/management/commands/seed.py @@ -9,11 +9,55 @@ from django.contrib.gis.geos import Point -from ...constants import ETHNICITIES, DUMMY_NAMES, SYNDROMES, SNOMED_BENZODIAZEPINE_TYPES, SNOMED_ANTIEPILEPSY_MEDICINE_TYPES, OPEN_UK_NETWORKS, RCPCH_ORGANISATIONS -from ...models import Organisation, Keyword, Case, Site, Registration, SyndromeEntity, EpilepsyCauseEntity, ComorbidityEntity, MedicineEntity, AntiEpilepsyMedicine, IntegratedCareBoardEntity, OPENUKNetworkEntity, NHSRegionEntity, ONSRegionEntity, ONSCountryEntity -from ...constants import ALL_HOSPITALS, KEYWORDS, WELSH_HOSPITALS, INTEGRATED_CARE_BOARDS_LOCAL_AUTHORITIES, WELSH_REGIONS, COUNTRY_CODES, UK_ONS_REGIONS -from ...general_functions import random_postcodes, random_date, first_tuesday_in_january, current_cohort_start_date, fetch_ecl, fetch_paediatric_neurodisability_outpatient_diagnosis_simple_reference_set, ons_region_for_postcode -from .create_groups import create_groups, add_permissions_to_existing_groups, delete_and_reallocate_permissions +from ...constants import ( + ETHNICITIES, + DUMMY_NAMES, + SYNDROMES, + SNOMED_BENZODIAZEPINE_TYPES, + SNOMED_ANTIEPILEPSY_MEDICINE_TYPES, + OPEN_UK_NETWORKS, + RCPCH_ORGANISATIONS, +) +from ...models import ( + Organisation, + Keyword, + Case, + Site, + Registration, + SyndromeEntity, + EpilepsyCauseEntity, + ComorbidityEntity, + MedicineEntity, + AntiEpilepsyMedicine, + IntegratedCareBoardEntity, + OPENUKNetworkEntity, + NHSRegionEntity, + ONSRegionEntity, + ONSCountryEntity, +) +from ...constants import ( + ALL_HOSPITALS, + KEYWORDS, + WELSH_HOSPITALS, + INTEGRATED_CARE_BOARDS_LOCAL_AUTHORITIES, + WELSH_REGIONS, + COUNTRY_CODES, + UK_ONS_REGIONS, +) +from ...general_functions import ( + random_postcodes, + random_date, + first_tuesday_in_january, + current_cohort_start_date, + fetch_ecl, + fetch_paediatric_neurodisability_outpatient_diagnosis_simple_reference_set, + ons_region_for_postcode, +) +from .create_groups import ( + create_groups, + add_permissions_to_existing_groups, + delete_and_reallocate_permissions, +) from .create_e12_records import create_epilepsy12_record, create_registrations @@ -21,52 +65,50 @@ class Command(BaseCommand): help = "seed database with organisation trust data for testing and development." def add_arguments(self, parser): - parser.add_argument('--mode', type=str, help="Mode") + parser.add_argument("--mode", type=str, help="Mode") def handle(self, *args, **options): - if (options['mode'] == 'seed_dummy_cases'): - self.stdout.write('seeding with dummy case data...') + if options["mode"] == "seed_dummy_cases": + self.stdout.write("seeding with dummy case data...") run_dummy_cases_seed() - elif (options['mode'] == 'seed_registrations'): + elif options["mode"] == "seed_registrations": self.stdout.write( - 'register cases in audit and complete all fields with random answers...') + "register cases in audit and complete all fields with random answers..." + ) run_registrations() - elif (options['mode'] == 'seed_groups_and_permissions'): - self.stdout.write('setting up groups and permissions...') + elif options["mode"] == "seed_groups_and_permissions": + self.stdout.write("setting up groups and permissions...") create_groups() - elif (options['mode'] == 'add_permissions_to_existing_groups'): - self.stdout.write('adding permissions to groups...') + elif options["mode"] == "add_permissions_to_existing_groups": + self.stdout.write("adding permissions to groups...") add_permissions_to_existing_groups() - elif (options['mode'] == 'delete_all_groups_and_recreate'): - self.stdout.write( - 'deleting all groups/permissions and reallocating...') - # elif (options['mode'] == 'replace_comorbidities_with_refset'): - # self.stdout.write( - # 'replacing comorbidites with refset...') - # replace_existing_comorbidities_with_refset() - elif (options['mode'] == 'add_existing_medicines_as_foreign_keys'): - self.stdout.write( - 'replacing medicines with medicine entity...') + elif options["mode"] == "delete_all_groups_and_recreate": + self.stdout.write("deleting all groups/permissions and reallocating...") + elif options["mode"] == "add_existing_medicines_as_foreign_keys": + self.stdout.write("replacing medicines with medicine entity...") else: - self.stdout.write('No options supplied...') - print('\033[38;2;17;167;142m') + self.stdout.write("No options supplied...") + print("\033[38;2;17;167;142m") self.stdout.write(image()) - print('\033[38;2;17;167;107m') - self.stdout.write('done.') + print("\033[38;2;17;167;107m") + self.stdout.write("done.") + def run_dummy_cases_seed(): added = 0 - print('\033[33m', 'Seeding fictional cases...', '\033[33m') + print("\033[33m", "Seeding fictional cases...", "\033[33m") # there should not be any cases yet, but sometimes seed gets run more than once if Case.objects.all().exists(): - print(f'Cases already exist. Skipping this step...') + print(f"Cases already exist. Skipping this step...") return postcode_list = random_postcodes.generate_postcodes(requested_number=100) - random_organisations = [] + random_organisations = ["RX1LK", "RK5BC"] + """ + Commented out section creates cases across 10 organisations, the first being Addenbrooke's # first populate Addenbrooke's for ease of dev testing for _ in range(1, 11): random_organisations.append( @@ -77,14 +119,16 @@ def run_dummy_cases_seed(): random_organisation = Organisation.objects.order_by("?").first() for i in range(1, 11): random_organisations.append(random_organisation) + """ - for index in range(len(DUMMY_NAMES) - 1): + # for index in range(len(DUMMY_NAMES) - 1): # commented out line populates all the names, not just first 20 + for index in range(0, 20): # first 20 names random_date = date(randint(2005, 2021), randint(1, 12), randint(1, 28)) nhs_number = randint(1000000000, 9999999999) - first_name = DUMMY_NAMES[index]['firstname'] - surname = DUMMY_NAMES[index]['lastname'] - gender_object = DUMMY_NAMES[index]['gender'] - if gender_object == 'm': + first_name = DUMMY_NAMES[index]["firstname"] + surname = DUMMY_NAMES[index]["lastname"] + gender_object = DUMMY_NAMES[index]["gender"] + if gender_object == "m": sex = 1 else: sex = 2 @@ -93,7 +137,11 @@ def run_dummy_cases_seed(): ethnicity = choice(ETHNICITIES)[0] # get a random organisation - organisation = random_organisations[index] + if index < 11: + # organisation = random_organisations[index] # line used if populating random hospitals + organisation = Organisation.objects.get(ODSCode=random_organisations[0]) + else: + organisation = Organisation.objects.get(ODSCode=random_organisations[1]) case_has_error = False @@ -106,7 +154,7 @@ def run_dummy_cases_seed(): sex=sex, date_of_birth=date_of_birth, postcode=postcode, - ethnicity=ethnicity + ethnicity=ethnicity, ) new_case.save() except Exception as e: @@ -119,7 +167,7 @@ def run_dummy_cases_seed(): organisation=organisation, site_is_actively_involved_in_epilepsy_care=True, site_is_primary_centre_of_epilepsy_care=True, - case=new_case + case=new_case, ) new_site.save() except Exception as e: @@ -127,7 +175,8 @@ def run_dummy_cases_seed(): added += 1 print( - f"{new_case.first_name} {new_case.surname} at {new_site.organisation.OrganisationName} ({new_site.organisation.ParentOrganisation_OrganisationName})...") + f"{new_case.first_name} {new_case.surname} at {new_site.organisation.OrganisationName} ({new_site.organisation.ParentOrganisation_OrganisationName})..." + ) print(f"Saved {added} cases.") @@ -135,7 +184,7 @@ def run_registrations(): """ Calling function to register all cases in Epilepsy12 and complete all fields with random answers """ - print('\033[33m', 'Registering fictional cases in Epilepsy12...', '\033[33m') + print("\033[33m", "Registering fictional cases in Epilepsy12...", "\033[33m") create_registrations() @@ -146,12 +195,18 @@ def complete_registrations(): """ Loop through the registrations and score all fields """ - print('\033[33m', 'Completing all the Epilepsy12 fields for the fictional cases...', '\033[33m') + print( + "\033[33m", + "Completing all the Epilepsy12 fields for the fictional cases...", + "\033[33m", + ) for registration in Registration.objects.all(): current_cohort_end_date = first_tuesday_in_january( - current_cohort_start_date().year + 2) + relativedelta(days=7) + current_cohort_start_date().year + 2 + ) + relativedelta(days=7) registration.registration_date = random_date( - start=current_cohort_start_date(), end=current_cohort_end_date) + start=current_cohort_start_date(), end=current_cohort_end_date + ) registration.eligibility_criteria_met = True registration.save()