Skip to content

Commit 5d1e5fd

Browse files
Additional Reports for District Dashboards [sc-15055] (#5546)
**Story card:** [sc-15055](https://app.shortcut.com/simpledotorg/story/15055/additional-reports-for-district-dashboards-bp-fudging) Because At district level, quick links will open the corresponding metabase report for that district This Addresses Will open the quick links for the respective district Test Instructions Enable the flipper "quick_link_for_metabase"
1 parent 2bc8206 commit 5d1e5fd

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.env.BD

100644100755
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ HELP_SCREEN_SUPPORT_GROUP_ICON = "icon_whatsapp_icon.svg"
44
DRUG_STOCK_REPORT_URL = "/my_facilities/drug_stocks?facility_group="
55
METABASE_TITRATION_URL = "https://metabase.bd.simple.org/question/109-facility-titration-trend?months=past9months&facility_name="
66
METABASE_BP_FUDGING_URL = "https://metabase.bd.simple.org/question/954-bp-fudging-02-facility-trend-line?assigned_facility_slug="
7-
DISTRICT_FACILITY_TREND_REPORT_URL = "https://api.bd.simple.org/my_facilities/bp_controlled?facility_group="
8-
DISTRICT_DRUG_STOCK_REPORT_URL = "https://api.bd.simple.org/my_facilities/drug_stocks?facility_group="
9-
DISTRICT_METABASE_TITRATION_URL = "https://metabase.bd.simple.org/question/997-district-titration-trend?months=past9months&district_name="
7+
DISTRICT_FACILITY_TREND_REPORT_URL = "http://localhost:3000/my_facilities/bp_controlled?facility_group="
8+
DISTRICT_FACILITY_TREND_REPORT_URL_1 = "https://api.bd.simple.org/my_facilities/bp_controlled?facility_group="
9+
DISTRICT_DRUG_STOCK_REPORT_URL = "http://localhost:3000/my_facilities/drug_stocks?facility_group="
10+
DISTRICT_DRUG_STOCK_REPORT_URL_1 = "https://api.bd.simple.org/my_facilities/drug_stocks?facility_group="
11+
DISTRICT_METABASE_TITRATION_URL = "https://metabase.bd.simple.org/question/109-facility-titration-trend?months=past9months&facility_name="
12+
DISTRICT_METABASE_BP_FUDGING_URL = "https://metabase.bd.simple.org/question/1000-01-district-report?state_name="

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ METABASE_TITRATION_URL= 'https://metabase.example.com/titration?region='
6969
DISTRICT_DRUG_STOCK_REPORT_URL = "https://api.example.com/my_facilities/drug_stocks?facility_group="
7070
DISTRICT_FACILITY_TREND_REPORT_URL = "https://api.example.com/my_facilities/bp_controlled?facility_group="
7171
DISTRICT_METABASE_TITRATION_URL = "https://metabase.example.com/titration?district_name="
72+
DISTRICT_METABASE_BP_FUDGING_URL = "https://metabase.example.com/bp_fudging?state_name="

app/views/reports/regions/show.html.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<div><a href="<%= ENV.fetch('DISTRICT_METABASE_TITRATION_URL', '') %><%= @region.name %>" target="_blank">
3535
Metabase: Titration report
3636
</a></div>
37+
<div><a href="<%= ENV.fetch('DISTRICT_METABASE_BP_FUDGING_URL', '') %><%= @region.parent.name %>&district_name= <%= @region.source.slug %>" target="_blank">
38+
Metabase: BP fudging report
39+
</a></div>
3740
</div>
3841
<% end %>
3942
<% end %>

spec/controllers/reports/regions_controller_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@
9191
expect(response.body).to include("Facility trends")
9292
expect(response.body).to include("Drug stock")
9393
expect(response.body).to include("Metabase: Titration report")
94+
expect(response.body).to include("Metabase: BP fudging report")
9495
expect(response.body).to include("https://api.example.com/my_facilities/drug_stocks?facility_group=")
9596
expect(response.body).to include("https://api.example.com/my_facilities/bp_controlled?facility_group=")
9697
expect(response.body).to include("https://metabase.example.com/titration?district_name=")
98+
expect(response.body).to include("https://metabase.example.com/bp_fudging?state_name=")
9799
end
98100
end
99101
context "and the feature flag is disabled" do
@@ -103,6 +105,7 @@
103105
expect(response.body).to_not include("District facility trend report")
104106
expect(response.body).to_not include("District Drug sto_notck report")
105107
expect(response.body).to_not include("Metabase: Titration report")
108+
expect(response.body).to_not include("Metabase: BP fudging report")
106109
end
107110
end
108111
end

0 commit comments

Comments
 (0)