Skip to content

fix: every number on a Programs card and hierarchy row describes one population (#699, #643) - #723

Merged
Taleef7 merged 3 commits into
mainfrom
fix/card-numbers
Sep 28, 2026
Merged

Taleef7 merged 3 commits into
mainfrom
fix/card-numbers

Conversation

@Taleef7

@Taleef7 Taleef7 commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Closes #643, closes #699.

Two places where a number sat next to another that described a different population, and nothing on screen said so.

#699: Programs has no date range

  • The problem. The header's Date range scoped each card's "Open cases (N)" but not the rate or chips beside it. On the Maui sandbox, "Last 7 days" put "Overdue 1,643" next to "Open cases (364)" and left every trend box empty.
  • The fix. Rates are measurement-year figures, so Programs and the hierarchy no longer send the range. The header hides the Date range selector on /programs and /programs/*, and keeps it on every other page. A range already in the URL is kept for those pages.
  • Also fixed. The card's "Open cases (N)" link dropped the site. With Kihei Clinic selected, CMS125 read "Open cases (340)" but opened Cases for all sites (1,643). The link now carries the site.

#643: the hierarchy shows what its rate is made of

  • The problem.
    • The table showed Evaluated · Compliant · Compliance, but the rate divides by the population, which was never shown. Patients reading "Evaluated 6 · Compliant 1" showed 50%, 100%, 25% or 33.3%.
    • Filtered to CMS122, it showed Compliance 53.9% while the CMS122 card read Poor control 46.1%.
  • The fix. The columns are now In population · Compliant · Compliance. Each row's rate, numerator and denominator come from displayRate, the function the Programs card uses. Filtered to one lower-is-better measure, the table reads Poorly controlled · Poor control, as its card does. A note under the filters says what the rate divides by.
  • Unchanged. The all-measures Compliance values: the denominator is the same one the backend's complianceRateOf divides by.

Frontend only; the API still accepts from/to.

Tests

  • layout.date-range.test.tsx: the selector is hidden on the three Programs paths in both the header and the mobile bar, and kept on /worklist, /cases, /runs and /programsx.
  • programs/__tests__/page.range.test.tsx: no from/to is sent even when a range is set, and "Open cases" carries the site.
  • hierarchy/__tests__/page.numbers.test.tsx:
    • the column set;
    • two patients with equal Evaluated/Compliant counts at 50% and 25%;
    • exclusions and out-of-population rows left out of In population;
    • CMS122 read as Poor control 75%;
    • no range sent.

Each test was mutation-checked: 10 mutations, all caught. The full frontend suite (577 tests), lint and build pass locally.

Taleef added 3 commits September 28, 2026 15:46
…site (#699)

The range scoped each card's open-case count but not the rate or chips beside it, so a card read
"Overdue 1,643" by "Open cases (364)" and every trend box went empty. Rates are measurement-year
figures: Programs no longer sends the range, and the header hides the selector on the Programs pages
while keeping it (and any range set) for the pages that use it.

The Open cases link dropped the site, so with a clinic selected it opened Cases for every site
(340 on the card, 1,643 on arrival). It now carries the site.
…ad as the Programs card reads it (#643)

Evaluated sat beside a rate made from a denominator the table never showed, so two patients reading
"Evaluated 6, Compliant 1" showed 50% and 25%. In population replaces Evaluated, and each row's rate,
numerator and denominator come from displayRate, the Programs card's reader. Filtered to one
lower-is-better measure the table reads Poor control, as its card does (CMS122 showed Compliance 53.9%
beside a card reading Poor control 46.1%). The hierarchy also stops sending the date range (#699).
… leaves out and describes the table; a fixture with exclusions and out-of-population rows
@Taleef7 Taleef7 self-assigned this Sep 28, 2026
@Taleef7
Taleef7 merged commit a1bc7b0 into main Sep 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant