Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,43 @@
class="p-20px mt-8px mx-0px mb-16px bg-white br-4px bs-small d-lg-flex fd-lg-column
justify-lg-between h-lg-full w-lg-full mt-lg-0 pb-inside-avoid b-print-black w-print-16cm min-w-0 col-span-3">

<%= render Dashboard::Card::TitleComponent.new(title: 'Treatment status of patients under care') %>
<%= render Dashboard::Card::TitleComponent.new(title: t("diabetes_treatment_status_card.title")) %>

<div id="diabetesVisitDetails" class="d-flex fd-column fd-lg-row" data-period="<%= period.to_s %>">
<div class="pl-lg-12px w-lg-50 h-lg-auto minh-300px">
<canvas></canvas>
</div>
<div class="flex-lg-1 mt-24px ml-lg-24px mt-print-2cm">
<% treatment_outcomes.each do |treatment_outcome| %>
<% case treatment_outcome[:outcome]
when :bs_below_200
copy_key = @use_who_standard ? "diabetes_treatment_status_card.bs_below_200.who_standard" : "diabetes_treatment_status_card.bs_below_200"
title_text = t("#{copy_key}.title")
description_text = t("#{copy_key}.description")
numerator_text = @use_who_standard ? t("bs_below_200_copy.numerator_fbs") : t("bs_below_200_copy.numerator")
when :bs_200_to_299
copy_key = @use_who_standard ? "diabetes_treatment_status_card.bs_200_to_299.who_standard" : "diabetes_treatment_status_card.bs_200_to_299"
title_text = t("#{copy_key}.title")
description_text = t("#{copy_key}.description")
numerator_text = @use_who_standard ? t("bs_over_200_copy.bs_200_to_299.numerator_fbs") : t("bs_over_200_copy.bs_200_to_299.numerator")
when :bs_over_300
copy_key = @use_who_standard ? "diabetes_treatment_status_card.bs_over_300.who_standard" : "diabetes_treatment_status_card.bs_over_300"
title_text = t("#{copy_key}.title")
description_text = t("#{copy_key}.description")
numerator_text = @use_who_standard ? t("bs_over_200_copy.bs_over_300.numerator_fbs") : t("bs_over_200_copy.bs_over_300.numerator")
when :missed_visits
title_text = t("diabetes_treatment_status_card.missed_visits.title")
description_text = t("diabetes_treatment_status_card.missed_visits.description")
numerator_text = t("diabetes_missed_visits_copy.numerator")
when :visit_no_bs
title_text = t("diabetes_treatment_status_card.visit_no_bs.title")
description_text = t("diabetes_treatment_status_card.visit_no_bs.description")
numerator_text = t("visit_but_no_bs_taken_copy.numerator")
end %>
<% tooltip = {
numerator: numerator_text,
denominator: t("diabetes_denominator_copy", region_name: region.name)
} %>
<div>
<div class="mb-16px d-lg-flex align-lg-center">
<p class="c-print-black <%= treatment_outcome[:class] %> graph-percent fs-28px"
Expand All @@ -18,14 +47,14 @@
<div>
<div class="d-flex flex-1">
<p class="mb-0px mr-6px fw-bold">
<%= treatment_outcome[:title] %>
<%= title_text %>
</p>
<%= render Dashboard::Card::TooltipComponent.new(treatment_outcome[:tooltip]) %>
<%= render Dashboard::Card::TooltipComponent.new(tooltip) %>
</div>

<p class="m-0px c-black">
<span data-key="<%= treatment_outcome[:count] %>" data-format="numberWithCommas"></span>
<%= treatment_outcome[:description] %>
<%= description_text %>
from
<span data-key="startDate"></span>
to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ class Dashboard::Diabetes::TreatmentOutcomesCardComponent < ApplicationComponent
attr_reader :region
attr_reader :period
attr_reader :with_ltfu
attr_reader :use_who_standard

def initialize(data:, region:, period:, with_ltfu: false)
def initialize(data:, region:, period:, with_ltfu: false, use_who_standard: false)
@data = data
@region = region
@period = period
@with_ltfu = with_ltfu
@use_who_standard = use_who_standard
end

def graph_data
Expand All @@ -30,44 +32,23 @@ def treatment_outcomes
[{key: "diabetesMissedVisitsRate",
count: "diabetesMissedVisits",
class: "c-blue",
title: "Missed visits",
description: "patients with no visit",
tooltip: {
numerator: t("diabetes_missed_visits_copy.numerator"),
denominator: t("diabetes_denominator_copy", region_name: @region.name)
}},
outcome: :missed_visits},
{key: "visitButNoBSMeasureRate",
count: "visitButNoBSMeasure",
class: "c-grey-dark",
title: "Visit but no blood sugar taken",
description: "patients with a visit but no blood sugar taken",
tooltip: {
numerator: t("visit_but_no_bs_taken_copy.numerator"),
denominator: t("diabetes_denominator_copy", region_name: @region.name)
}},
outcome: :visit_no_bs},
{key: "bsOver300Rate",
count: "bsOver300Patients",
class: "c-red",
title: "Blood sugar &ge;300".html_safe,
description: "patients with blood sugar ≥300 taken",
tooltip: {
numerator: t("bs_over_200_copy.bs_over_300.numerator"),
denominator: t("diabetes_denominator_copy", region_name: @region.name)
}},
outcome: :bs_over_300},
{key: "bs200to300Rate",
count: "bs200to300Patients",
title: "Blood sugar 200-299",
description: "patients with blood sugar 200-299 taken",
class: "c-amber",
tooltip: {numerator: t("bs_over_200_copy.bs_200_to_299.numerator"),
denominator: t("diabetes_denominator_copy", region_name: @region.name)}},
outcome: :bs_200_to_299},
{key: "bsBelow200Rate",
count: "bsBelow200Patients",
class: "c-green-dark",
title: "Blood sugar &lt;200".html_safe,
description: "patients with blood sugar <200 taken",
tooltip: {numerator: t("bs_below_200_copy.numerator"),
denominator: t("diabetes_denominator_copy", region_name: @region.name)}}]
outcome: :bs_below_200}]
end

def period_data
Expand Down
2 changes: 1 addition & 1 deletion app/views/reports/regions/diabetes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<%= render Dashboard::Diabetes::MissedVisitsGraphComponent.new(args_with_ltfu) %>
<%= render Dashboard::Diabetes::RegistrationsAndFollowUpsGraphComponent.new(args) %>
<%= render(Dashboard::Diabetes::LostToFollowUpComponent.new(args)) %>
<%= render Dashboard::Diabetes::TreatmentOutcomesCardComponent.new(args) %>
<%= render Dashboard::Diabetes::TreatmentOutcomesCardComponent.new(args.merge(use_who_standard: @use_who_standard)) %>
</div>

<% if current_admin.feature_enabled?(:medications_dispensation) %>
Expand Down
34 changes: 30 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ en:
reports_card_subtitle: "Estimated adults in %{region_name} with hypertension who are registered, under care, and controlled till %{period}"
bs_below_200_copy:
reports_card_title: "Blood sugar <200"
reports_card_title_fbs: "Blood sugar <126"
reports_card_title_fbs: "Blood sugar controlled"
reports_card_title_dm: "Blood Sugar <200"
reports_card_title_dm_bs: "Blood sugar <200"
reports_card_title_dm_fbs: "Blood sugar controlled"
Expand All @@ -87,15 +87,15 @@ en:
numerator: "Patients with HbA1c <7.0 at their last visit in the last 3 months"
bs_over_200_copy:
reports_card_title: "Blood sugar ≥200"
reports_card_title_fbs: "Blood sugar ≥126"
reports_card_title_fbs: "Blood sugar uncontrolled"
reports_card_title_dm: "Blood sugar ≥200"
reports_card_title_dm_fbs: "Blood sugar uncontrolled"
reports_card_subtitle: "Diabetes patients in %{region_name} with blood sugar 200-299 or blood sugar ≥300 at their last visit in the last 3 months"
reports_card_subtitle_fbs: "Diabetes patients in %{region_name} with FBS ≥126mg/dL or HbA1c ≥7% at their last visit in the last 3 months"
bs_200_to_299:
title: "Blood Sugar 200-299"
title_dm_bs: "Blood sugar 200-299"
title_fbs: "Blood Sugar 126-199"
title_fbs: "Blood sugar uncontrolled (126-199)"
title_dm: "blood sugar 200-299"
title_dm_fbs: "FBS 126-199mg/dL or HbA1c 7%-8.9%"
reports_card_subtitle: "Diabetes patients at %{region_name} registered >3 months ago with blood sugar 200-299 at their last visit in the last 3 months."
Expand All @@ -114,7 +114,7 @@ en:
numerator: "Patients with HbA1c 7.0-8.9 at their last visit in the last 3 months"
bs_over_300:
title: "Blood sugar ≥300"
title_fbs: "Blood sugar ≥200"
title_fbs: "Blood sugar uncontrolled (≥200)"
title_dm_fbs: "FBS ≥200mg/dL or HbA1c ≥9%"
numerator: "Patients with RBS/PPBS ≥300, FBS ≥200, or HbA1c ≥9.0 at their last visit in the last 3 months"
numerator_fbs: "Patients with FBS ≥200mg/dL, or HbA1c ≥9% at their last visit in the last 3 months"
Expand All @@ -130,6 +130,32 @@ en:
numerator: "Patients with FBS ≥200 at their last visit in the last 3 months"
hba1c:
numerator: "Patients with HbA1c ≥9.0 at their last visit in the last 3 months"
diabetes_treatment_status_card:
title: "Treatment status of patients under care"
missed_visits:
title: "Missed visits"
description: "patients with no visit"
visit_no_bs:
title: "Visit but no blood sugar taken"
description: "patients with a visit but no blood sugar taken"
bs_over_300:
title: "Blood sugar ≥300"
description: "patients with blood sugar ≥300 taken"
who_standard:
title: "Blood sugar uncontrolled"
description: "patients with FBS ≥200mg/dL or HbA1c ≥9% taken"
bs_200_to_299:
title: "Blood sugar 200-299"
description: "patients with blood sugar 200-299 taken"
who_standard:
title: "Blood sugar uncontrolled"
description: "patients with FBS 126-199mg/dL or HbA1c 7%-8.9% taken"
bs_below_200:
title: "Blood sugar <200"
description: "patients with blood sugar <200 taken"
who_standard:
title: "Blood sugar controlled"
description: "patients with FBS <126mg/dL or HbA1c <7% taken"
missed_visits_copy:
reports_card_subtitle: "Hypertension patients with no visit in the last 3 months"
numerator: "Patients with no visit in the last 3 months"
Expand Down
4 changes: 0 additions & 4 deletions config/locales/en_LK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ en-LK:
numerator_dm_fbs: "Patients with FBS <126mg/dL or HbA1c <7% at their last visit in the last 3 months"
reports_card_title: "Blood Sugar <200"
reports_card_title_dm_bs: "Blood sugar <200"
reports_card_title_fbs: "Blood sugar controlled"
reports_card_title_dm: "Blood Sugar <200"
reports_card_title_dm_fbs: "Blood sugar controlled"
report_card_lower_bar: "blood sugar <200"
report_card_lower_bar_fbs: "FBS <126mg/dL or HbA1c <7%"
Expand All @@ -70,8 +68,6 @@ en-LK:
summary_fbs: "patients with blood sugar controlled from"
bs_over_200_copy:
reports_card_title: "Blood sugar 200-299 or ≥300"
reports_card_title_dm: "Blood sugar ≥200"
reports_card_title_fbs: "Blood sugar uncontrolled"
reports_card_title_dm_fbs: "Blood sugar uncontrolled"
reports_card_subtitle: "Diabetes patients in %{region_name} with blood sugar 200-299 or blood sugar ≥300 at their last visit in the last 3 months"
reports_card_subtitle_fbs: "Diabetes patients in %{region_name} with FBS ≥126mg/dL or HbA1c ≥7% at their last visit in the last 3 months"
Expand Down