Closure has no disposition vocabulary, no review date, and two dead SLA constants feeding an unreachable chip

Open
#600 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start with backend-ts/src/case/case-actions.ts, then inspect backend-ts/src/case/case-read-models.ts and backend-ts/src/run/employee-profile.ts for the existing closure and SLA fields. Read ADR-083 and ADR-076 alongside the related issues before choosing the independently scoped workflow change. Done should include the accepted disposition metadata and outcome version, or a resolved decision on removing the dead SLA fields, without combining PCP, archive, and closure migrations.

Written by the indexing model from the issue text.

Description

backend

From the 2026-09-07 review, accepted 2026-09-08, unchanged. #569/ADR-083 did the part that mattered most — a staff-closed case now shows what CQL says today rather than reading as done — so what remains is the workflow half.

1. Closure has no vocabulary

A closure is free text plus closedReason: "MANUAL_RESOLVE" (backend-ts/src/case/case-actions.ts:137,155). Every distinct operational situation collapses to one token, so nothing can be counted, filtered or followed up by kind.

The vocabulary proposed and accepted:

AWAITING_PATIENT · AWAITING_EXTERNAL_RECORD · AWAITING_CLINICAL_ACTION · TEMPORARILY_DEFERRED · PATIENT_DECLINED · DATA_OR_ATTRIBUTION_REVIEW · TRANSFERRED_OR_DUPLICATE

…each recorded with recordedBy / recordedAt / owner / reviewAt, and the outcome version the disposition was made against — so a disposition taken when CQL said OVERDUE is distinguishable from one taken when it said something else. The system-derived MEASURE_RESOLVED stays separate from all of them.

2. There is no review date anywhere

grep -r "reviewAt\|review_at" backend-ts/src returns nothing. "Waiting on the patient" with no expiry is indistinguishable from "handled" a month later, which is exactly the shape #569 was about — a case that has left the list while the measure still counts the patient.

3. Two shipped constants feed an unreachable chip

backend-ts/src/case/case-read-models.ts:135-136 and backend-ts/src/run/employee-profile.ts:195-196:

slaRemainingDays: null,
slaBreached: false,

Hard-coded, never computed, and there is an SlaChip that can therefore never render. Either the SLA concept is real — in which case it is (2) above under a different name — or these should come out. Leaving a dead field that always says "not breached" is worse than having neither, because it reads as a checked condition.

4. An operator plan is not flagged when the ground moves

planNextAction preserves OPERATOR text while the outcome bucket is unchanged — correct, and ADR-076 d2's whole point. But on a multi-rate measure the missed rate can move while the bucket does not, and the operator's instruction was written about the old one. Nothing surfaces that.

The caution that came with the acceptance

"The enum and review date alone do not implement the workflow."

And: do not force PCP, archive and closure into one migration. This is at least two changes, and the first is worth doing alone.

Related: #569 / ADR-083, ADR-076, #552 (a neighbouring owner question on IN_PROGRESS and outreach).

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
6h 6m
Merged PRs (30d)
69

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Taleef7/workwell

All issues in Taleef7/workwell

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.