Skip to content

Give the community desk's ED heads-up a narrow scoped list (D-154) - #1632

Merged
BigSimmo merged 3 commits into
mainfrom
claude/project-thread-083quc
Nov 11, 2026
Merged

BigSimmo merged 3 commits into
mainfrom
claude/project-thread-083quc

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

What this changes

This is the follow-up to #1606 that Josh approved ("Yes, in a follow-up PR", then "Yes I approve", 11 Nov 2026). It is recorded as D-154.

The item 46 "Your patients in ED" card (D-133, D-141) now works on a community team desk. That desk's scoped view only holds the journeys its own role may see, so the card had nothing to read. Now the desk's scoped workspace carries communityEdArrivals, a narrow list of the team's own open-episode patients who are in an ED now.

  • Narrow by design: each item is the UMRN, the ED's name and the time the stay was recorded, keyed by the journey id, and nothing else. The ED journey itself and the patient record are still not sent to the desk.
  • One source for episodes: the mock-up community episodes' team and status moved to patients/community-episode-teams.ts, the one place they are typed. patient-record-extras.ts spreads those entries, so the card and the record can't disagree.
  • Card: home-team-heads-up-card.tsx reads the projected list through useCommunityEdArrivals() when it exists, and otherwise works it out from the whole workspace as before.
  • Not covered: shared mode. A shared community desk's copy comes from the server's scopeWardFlowState, which does not send this list yet, so the card stays empty there. Noted in D-154.

Evidence (local)

  • npm run typecheck:internal: clean.
  • tests/ward-community-ed-arrivals-scope.test.ts (new, 5 tests) checks:
    • The Midland desk gets exactly one item, with only edName, key, since and umrn.
    • The ED movement and the patient are not in the desk's view.
    • The list matches what the whole workspace says.
    • Bentley gets an empty list.
    • The ED and coordinator desks get none.
    • The record mock-ups read the same episode list.
  • The new test plus the related access-scope, ward-access, heads-up and record-extras test files all pass: 17 files, 175 tests.
  • D-154 entry and index row added. OWNER-RULINGS.md regenerated, and the decisions anchor check passes.

Synthetic data only. Display only. No event, stored field or signed clinical value changes.


Generated by Claude Code

View guided diff

A community team desk's movements hold only its own referrals' journeys,
so the Your patients in ED card was empty there. scopeWorkspace now adds
communityEdArrivals for a community team desk: its open-episode patients
in an ED now, as UMRN, ED name and time only, read from the whole
workspace. The ED journey and the person's record stay out of the view.
The card reads the list through a new shell context. The mock episode
team and status now live in one small list that the record mock-ups
spread, so the access code does not load the record mock-ups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GxPPxjdesrEjVU1zKyiFhd
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 105 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 82e6b0a2-f24f-4c58-a3ce-77897bc5abf6
Commits

Reviewing files that changed from the base of the PR and between 0b657ad and bd2bc0e.

Files selected for processing: 11

  • docs/FACTS.md
  • docs/script-budget-history/2026-11-11-pr1632-community-ed-arrivals.md
  • docs/ward-flow/OWNER-RULINGS.md
  • docs/ward-flow/decisions.md
  • script-budget.json
  • src/components/ward-management/home-team-heads-up-card.tsx
  • src/components/ward-management/patients/community-episode-teams.ts
  • src/components/ward-management/patients/patient-record-extras.ts
  • src/components/ward-management/shell/ward-access.tsx
  • src/components/ward-management/ward-access-scope.ts
  • tests/ward-community-ed-arrivals-scope.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@BigSimmo
BigSimmo marked this pull request as ready for review November 11, 2026 22:24
@BigSimmo
BigSimmo enabled auto-merge November 11, 2026 22:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T22:25:43.712810Z 08e0d62 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gitar-bot

gitar-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Gitar is working

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Gitar

BigSimmo pushed a commit that referenced this pull request Nov 11, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GxPPxn8xZAWHw5dJPGdUjY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GxPPxjdesrEjVU1zKyiFhd
@BigSimmo
BigSimmo merged commit 02817bb into main Nov 11, 2026
22 checks passed
@BigSimmo
BigSimmo deleted the claude/project-thread-083quc branch November 11, 2026 23:00
BigSimmo pushed a commit that referenced this pull request Nov 11, 2026
BigSimmo pushed a commit that referenced this pull request Nov 11, 2026
Conflicts: decisions.md keeps main's D-154 before this PR's D-155 and
D-156, and D-155's gap note now says both D-153 and D-154 are recorded;
script-budget.json takes main's limits plus this PR's own raises (Home
+0.5, Movement +0.5, ED site +3.4); FACTS.md and OWNER-RULINGS.md
regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GxPPxn8xZAWHw5dJPGdUjY
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.

2 participants