diff --git a/app/components/dashboard/diabetes/treatment_outcomes_card_component.html.erb b/app/components/dashboard/diabetes/treatment_outcomes_card_component.html.erb index 8c7b61fc1e..90d5c3285e 100644 --- a/app/components/dashboard/diabetes/treatment_outcomes_card_component.html.erb +++ b/app/components/dashboard/diabetes/treatment_outcomes_card_component.html.erb @@ -2,7 +2,7 @@ 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")) %>
@@ -10,6 +10,35 @@
<% 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) + } %>

- <%= treatment_outcome[:title] %> + <%= title_text %>

- <%= render Dashboard::Card::TooltipComponent.new(treatment_outcome[:tooltip]) %> + <%= render Dashboard::Card::TooltipComponent.new(tooltip) %>

- <%= treatment_outcome[:description] %> + <%= description_text %> from to diff --git a/app/components/dashboard/diabetes/treatment_outcomes_card_component.rb b/app/components/dashboard/diabetes/treatment_outcomes_card_component.rb index 9bc03a918c..b6f124a1b8 100644 --- a/app/components/dashboard/diabetes/treatment_outcomes_card_component.rb +++ b/app/components/dashboard/diabetes/treatment_outcomes_card_component.rb @@ -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 @@ -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 ≥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 <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 diff --git a/app/views/reports/regions/diabetes.html.erb b/app/views/reports/regions/diabetes.html.erb index bbc9658d64..835b6798ae 100644 --- a/app/views/reports/regions/diabetes.html.erb +++ b/app/views/reports/regions/diabetes.html.erb @@ -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)) %>

<% if current_admin.feature_enabled?(:medications_dispensation) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 02121c76c0..e1d305a1a7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" @@ -87,7 +87,7 @@ 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" @@ -95,7 +95,7 @@ en: 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." @@ -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" @@ -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" diff --git a/config/locales/en_LK.yml b/config/locales/en_LK.yml index 4bcaba3954..45f69dff38 100644 --- a/config/locales/en_LK.yml +++ b/config/locales/en_LK.yml @@ -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%" @@ -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"