-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from rcpch/kpis-in-the-uis
Kpis-in-the-uis
- Loading branch information
Showing
15 changed files
with
584 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .kpis import * |
512 changes: 226 additions & 286 deletions
512
project/npda/general_functions/kpis.py → project/npda/kpi_class/kpis.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<div class="w-100"> | ||
<strong> | ||
Key Performance Indicators for {{patient.nhs_number}} ({{ kpi_results.pz_code }}) | ||
</strong> | ||
<table class="table-auto w-full text-sm text-left text-gray-500 mb-5 font-montserrat"> | ||
<thead class="text-xs text-gray-700 uppercase bg-gray-50 bg-rcpch_dark_blue text-white"> | ||
<tr> | ||
<th class="px-6 py-3">KPI</th> | ||
<th class="px-6 py-3">Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for kpi_key, kpi_value in kpi_results.calculated_kpi_values.items %} | ||
{% if not kpi_key|slice:":6" == "kpi_32" %} | ||
<tr class="bg-white border-b"> | ||
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ kpi_value.kpi_label }}</td> | ||
<td class="px-6 py-4"> | ||
{% if kpi_value.total_failed == 1 %} | ||
<span class="text-red-500 tooltip" data-tip="{{patient.nhs_number}} has failed this measure">✖</span> | ||
{% elif kpi_value.total_passed == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has passed this measure" data-inverted="" data-position="top left"> | ||
<svg width="12px" height="12px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="#e00087" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% elif kpi_value.total_ineligible == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} is not eligible for this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?> | ||
<svg height="12px" viewBox="0 0 1792 1792" width="12px" xmlns="http://www.w3.org/2000/svg" fill='#11a7f2'> | ||
<path d="M1152 896q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75 75 181zm-256-544q-148 0-273 73t-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273-73-273-198-198-273-73zm768 544q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z" stroke="#11a7f2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% else %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has not done this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?><svg height="12px" viewBox="0 0 48 48" width="12px" xmlns="http://www.w3.org/2000/svg" fill="#11a7f2"><path d="M0 0h48v48h-48z" fill="none"/><path d="M12 20c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm24 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-12 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg> | ||
</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
<!-- Sub-rows for KPI 32 --> | ||
<tr class="bg-white border-b"> | ||
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">KPI 32</td> | ||
<td class="px-6 py-4"> | ||
{% if kpi_results.calculated_kpi_values.kpi_32_1_health_check_completion_rate.total_failed == 1 %} | ||
<span class="text-red-500 tooltip" data-tip="{{patient.nhs_number}} has failed this measure">✖</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_1_health_check_completion_rate.total_passed == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has passed this measure" data-inverted="" data-position="top left"> | ||
<svg width="12px" height="12px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg> | ||
<path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="#e00087" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_1_health_check_completion_rate.total_ineligible == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} is not eligible for this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?> | ||
<svg height="12px" viewBox="0 0 1792 1792" width="12px" xmlns="http://www.w3.org/2000/svg" fill='#11a7f2'> | ||
<path d="M1152 896q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75 75 181zm-256-544q-148 0-273 73t-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273-73-273-198-198-273-73zm768 544q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z" stroke="#11a7f2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% else %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has not done this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?><svg height="12px" viewBox="0 0 48 48" width="12px" xmlns="http://www.w3.org/2000/svg" fill="#11a7f2"><path d="M0 0h48v48h-48z" fill="none"/><path d="M12 20c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm24 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-12 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg> | ||
</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
<tr class="bg-gray-50 border-b"> | ||
<td class="px-6 py-4 pl-12 font-medium text-gray-900 whitespace-nowrap">Care Process Completion Rate</td> | ||
<td class="px-6 py-4"> | ||
{% if kpi_results.calculated_kpi_values.kpi_32_1_health_check_completion_rate.total_failed == 1 %} | ||
<span class="text-red-500 tooltip" data-tip="{{patient.nhs_number}} has failed this measure">✖</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_1_health_check_completion_rate.total_passed == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has passed this measure" data-inverted="" data-position="top left"> | ||
<svg width="12px" height="12px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="#e00087" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_1_health_check_completion_rate.total_ineligible == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} is not eligible for this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?> | ||
<svg height="12px" viewBox="0 0 1792 1792" width="12px" xmlns="http://www.w3.org/2000/svg" fill='#11a7f2'> | ||
<path d="M1152 896q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75 75 181zm-256-544q-148 0-273 73t-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273-73-273-198-198-273-73zm768 544q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z" stroke="#11a7f2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% else %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has not done this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?><svg height="12px" viewBox="0 0 48 48" width="12px" xmlns="http://www.w3.org/2000/svg" fill="#11a7f2"><path d="M0 0h48v48h-48z" fill="none"/><path d="M12 20c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm24 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-12 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg> | ||
</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
<tr class="bg-gray-50 border-b"> | ||
<td class="px-6 py-4 pl-12 font-medium text-gray-900 whitespace-nowrap">Health Check < 12yo</td> | ||
<td class="px-6 py-4"> | ||
{% if kpi_results.calculated_kpi_values.kpi_32_2_health_check_lt_12yo.total_failed == 1 %} | ||
<span class="text-red-500 tooltip" data-tip="{{patient.nhs_number}} has failed this measure">✖</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_2_health_check_lt_12yo.total_passed == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has passed this measure" data-inverted="" data-position="top left"> | ||
<svg width="12px" height="px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="#e00087" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_2_health_check_lt_12yo.total_ineligible == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} is not eligible for this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?> | ||
<svg height="12px" viewBox="0 0 1792 1792" width="12px" xmlns="http://www.w3.org/2000/svg" fill='#11a7f2'></svg> | ||
<path d="M1152 896q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75 75 181zm-256-544q-148 0-273 73t-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273-73-273-198-198-273-73zm768 544q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z" stroke="#11a7f2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% else %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has not done this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?><svg height="12px" viewBox="0 0 48 48" width="12px" xmlns="http://www.w3.org/2000/svg" fill="#11a7f2"><path d="M0 0h48v48h-48z" fill="none"/><path d="M12 20c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm24 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-12 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg> | ||
</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
<tr class="bg-gray-50 border-b"> | ||
<td class="px-6 py-4 pl-12 font-medium text-gray-900 whitespace-nowrap">Health Check >= 12yo</td> | ||
<td class="px-6 py-4"> | ||
{% if kpi_results.calculated_kpi_values.kpi_32_3_health_check_gte_12yo.total_failed == 1 %} | ||
<span class="text-red-500 tooltip" data-tip="{{patient.nhs_number}} has failed this measure">✖</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_3_health_check_gte_12yo.total_passed == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has passed this measure" data-inverted="" data-position="top left"> | ||
<svg width="12px" height="px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="#e00087" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% elif kpi_results.calculated_kpi_values.kpi_32_3_health_check_gte_12yo.total_ineligible == 1 %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} is not eligible for this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?> | ||
<svg height="12px" viewBox="0 0 1792 1792" width="12px" xmlns="http://www.w3.org/2000/svg" fill='#11a7f2'> | ||
<path d="M1152 896q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75 75 181zm-256-544q-148 0-273 73t-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273-73-273-198-198-273-73zm768 544q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z" stroke="#11a7f2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
</span> | ||
{% else %} | ||
<span class='tooltip' data-tip="{{patient.nhs_number}} has not done this measure" data-inverted="" data-position="top left"> | ||
<?xml version="1.0" ?><svg height="12px" viewBox="0 0 48 48" width="12px" xmlns="http://www.w3.org/2000/svg" fill="#11a7f2"><path d="M0 0h48v48h-48z" fill="none"/><path d="M12 20c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm24 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-12 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg> | ||
</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.