Skip to content

Dm dashboard new controlled bp statin cards#5770

Open
jamiecarter7 wants to merge 1 commit intomasterfrom
dm-dashboard-new-controlled-bp-statin-cards
Open

Dm dashboard new controlled bp statin cards#5770
jamiecarter7 wants to merge 1 commit intomasterfrom
dm-dashboard-new-controlled-bp-statin-cards

Conversation

@jamiecarter7
Copy link
Contributor

@jamiecarter7 jamiecarter7 commented Feb 18, 2026

Story card: 15132 SIMPLEBACK-35 SIMPLEBACK-31

Because

This PR is adding 2 new charts to the Simple DM dashboard:

  • DM patients with controlled BP
  • DM patients >40yr prescribed statins

This addresses

New DM indicators.

Test instructions

This feature is behind a flipper flag while adding to production to test before roll-out.
Flag: diabetes_cvd_indicators

<%= render Dashboard::Diabetes::DmPrescribedStatinsComponent.new(args_with_ltfu) %>
</div>
<% end %>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gyan-Gupta-Rtsl If you can just review this flipper flag is correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamiecarter7 Yes it is correctly implemented.

Copy link
Contributor

@Gyan-Gupta-Rtsl Gyan-Gupta-Rtsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM , Please resolve the merge conflicts in db/structure.sql before merging.

<%= render Dashboard::Diabetes::DmPrescribedStatinsComponent.new(args_with_ltfu) %>
</div>
<% end %>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamiecarter7 Yes it is correctly implemented.

Statins card

Statin colour fixes and 18month data

Minor fixes

Sc 17708 (#5753)

**Story card:**
[sc-17708](https://app.shortcut.com/simpledotorg/story/17708/wire-dm-patients-with-controlled-bp-chart-to-dashboard)

The DM dashboard "DM patients with controlled BP" card was using dummy
data and needed backend support to display real metrics.

1. Adds backend methods in RegionSummarySchema to calculate DM patients
with controlled BP (<140/90 and <130/80)
2. Wires DmBpControlledComponent to use real data from
RepositoryPresenter
3. Adds specs for the new metrics

Suit test cases.

sc-17709: add backend for DM patients ≥40 prescribed statins chart (#5759)

**Story card:**
[sc-17709](https://app.shortcut.com/simpledotorg/story/17709/wire-dm-patients-40-prescribed-statins-chart-to-dashboard)
**Metabase report:** [Diabetes patients aged >=40 prescribed statins at
latest visit in past 12
months](https://metabase.bd.simple.org/question/647-diabetes-patients-aged-40-prescribed-statins-at-latest-visit-in-past-12-months)

The dashboard needs backend data to display DM patients aged ≥40 who are
prescribed statins, in order to track statin prescription rates for
diabetes management.

1. Adds backend methods to calculate DM patients ≥40 under care and
those prescribed statins
2. Wires these metrics into the dashboard data source for the “DM
patients ≥40 prescribed statins” chart
3. Applies facility group and eligibility filters
(months_since_registration >= 3, htn_care_state = 'under_care', age >=
40)

1. Run test cases

Add LTFU toggle to statins card

Add denominator string change when LTFU enable

SIMPLEBACK-36: fix ltfu toggle bug (#5765)

**Ticket**:  [ltfu toggle bug
](https://rtsl.atlassian.net/browse/SIMPLEBACK-36)

When the LTFU toggle is ON, the first three dashboard periods were
showing denominator = 0.
This happened because LTFU calculations rely on period.adjusted_period
(3-month lookback), but the required historical data was not included in
the query range.

1. Extends internal query range by REGISTRATION_BUFFER_IN_MONTHS (3
months) for denominator calculations
2. Keeps UI window strictly limited to original 18 months
3. Ensures first 3 periods correctly include cumulative assigned
patients
4. Maintains backward compatibility and does not expose buffer months to
UI

1. Enable LTFU toggle in [dashboard
charts](https://api-sandbox.simple.org/reports/regions/facility/chc-lonand-gaon/diabetes?period%5Btype%5D=month&period%5Bvalue%5D=2025-10-01&with_ltfu=true)
2. Verify first three periods show correct registered patient counts
3. Confirm UI still displays only 18 months
4. Run full test suite, all specs should pass

Adding flipper flag to new CVD and statins section

list issue
@Gyan-Gupta-Rtsl Gyan-Gupta-Rtsl force-pushed the dm-dashboard-new-controlled-bp-statin-cards branch from ec605f1 to 7d81d47 Compare February 20, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments