Skip to content

fix(people): tell same-named people apart; a history of finished runs, each with its time and run, read as the patient page reads it (#655) - #722

Merged
Taleef7 merged 6 commits into
mainfrom
fix/people-page
Sep 28, 2026
Merged

Taleef7 merged 6 commits into
mainfrom
fix/people-page

Conversation

@Taleef7

@Taleef7 Taleef7 commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Three items from the #655 checklist, all checked on live Maui first (admin seat, 2026-09-28).

What was wrong

  • Same-named patients were indistinguishable. /people rendered only a name. Three rows in a row read "Adriana Aoki", with nothing to tell them apart.
  • Duplicate history rows. pat-04403's history had 147 rows, and same-day rows looked identical (for example, three "9/24/2026 Breast Cancer Screening MISSING DATA" rows). The history read every outcome of every run and dropped the time of day. That included rows from runs still going or failed, and rows for measures the deployment no longer runs.
  • "MISSING DATA" where the patient page says "Not in population". A 30-year-old's breast screening, colorectal screening and CMS137 rows showed the stored bucket.

What changed

  • The list shows an identifying line under each name: the id, the date of birth and the clinic.
  • The history keeps only rows that are answers:
  • Each row names its run. It carries its runId and what started it: Nightly, Manual run, Single-patient run, Rerun to verify, or Seed (synthetic). The page shows the date and time, so two evaluations on one day read as two runs.
  • Status is the measure's reading of each row (deriveCell), so out-of-population rows read "Not in population". The patient page's cohort overlay is deliberately not applied to history, because it would rewrite every past row whenever a segment or a role changed.
  • Run lookup in one read. The runs behind a person's rows come from a new RunStore.getRunsByIds, which is one read in both stores and is contract-tested. It replaces one round trip per run, which grew with every nightly on a stack that never compacts.
  • Patient-page link. Each linked record now links to its patient page.

Out of scope

These stay on #655:

  • the unmasked national-id column (a PHI-phase decision; always empty on Maui);
  • the patient page reading its newest row from any run, including one still going.

The journal line follows once #721 merges, to avoid a conflict in the same day's section.

Verification

  • Backend:
    • typecheck;
    • identity, employees and SQLite store suites (169 pass);
    • the Postgres store contract runs in CI (Docker is not available locally).
  • Frontend: lint, and new vitests for both People pages (neither had any).
  • 12 mutations across the new tests, all killed.
  • My own code review before opening. Its two important findings are fixed in ce1ef97:
    • the cohort overlay rewriting history;
    • an unbounded per-run query loop.

Taleef added 3 commits September 28, 2026 14:15
…ures, reads status as the patient page does, and names each row's run (#655)

The history read every outcome of every run: rows from runs still going or
failed, rows for measures the deployment no longer runs, and the stored
MISSING_DATA where the patient page shows "Not in population". Each row now
carries its run and what started it, so two evaluations on one day read as two
runs rather than a duplicate. The patient page's reading is one shared helper.
…story shows each row's time, run and the patient page's status (#655)

The People list was a bare name per row, and the pilot has several same-named
patients. A person's history dropped the time of day and showed the stored
MISSING_DATA; it now shows date and time, what ran (nightly, manual run,
single-patient rerun), and "Not in population" as the patient page does.
Each linked record links to its patient page.
… not today's cohort, and reads its runs in one query

- displayStatus is deriveCell's reading of each row. The patient page's cohort
  overlay applies to the newest row only; applied to history it rewrote every
  past row whenever a segment or a role changed. The shared helper is reverted.
- The runs behind a person's rows come from one getRunsByIds read (both
  stores, contract-tested) instead of one round trip per run, which grew with
  every nightly on a stack that never compacts.
- Run labels follow Run History's vocabulary: a one-subject run is not called
  a rerun, a case's rerun reads "Rerun to verify", and seeded rows say they
  are synthetic. PARTIAL_FAILURE, CASE and SEED are covered by the test.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce1ef9745d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/app/(dashboard)/people/[personId]/page.tsx Outdated
@Taleef7 Taleef7 self-assigned this Sep 28, 2026
@Taleef7
Taleef7 merged commit f07b49b into main Sep 28, 2026
14 checks passed
@Taleef7
Taleef7 deleted the fix/people-page branch September 28, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant