From 60bd39ae1cfb0c7a85dd70d81d074481a8fa7582 Mon Sep 17 00:00:00 2001 From: Jamie Carter <9541902+jamiecarter7@users.noreply.github.com> Date: Wed, 10 Jun 2026 18:59:00 +0100 Subject: [PATCH] Flipper flag updates - Standardised language 'controlled' and 'uncontrolled' - Removed LK specific language, this is now default language --- ...treatment_outcomes_card_component.html.erb | 37 +++++++++++++++++-- .../treatment_outcomes_card_component.rb | 35 ++++-------------- app/views/reports/regions/diabetes.html.erb | 2 +- config/locales/en.yml | 34 +++++++++++++++-- config/locales/en_LK.yml | 4 -- 5 files changed, 72 insertions(+), 40 deletions(-) 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")) %>
- <%= 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)) %>