# 老人床位联动优化

## Goal

Improve the existing elder and bed workspaces so operators can see relevant cross-module context without leaving the workflow: current admission, bed, recent care tasks, health abnormal records, and safety incidents.

## Confirmed Facts

- `老人档案` already supports persisted elder CRUD.
- `床位房间` already supports persisted room, bed, admission, transfer, and discharge workflows.
- Elder rows already show current active bed labels from admissions.
- Bed rows already show current elder names where occupied.
- Health, care, and emergency modules will add additional context after their child tasks.

## Requirements

- Add cross-module context to elder and bed surfaces only after the relevant underlying persisted data exists.
- Elder detail/edit surfaces should expose concise recent context:
  - current bed/admission state
  - recent care execution records
  - recent health abnormalities or latest vital summary
  - open safety/emergency incidents tied to the elder when available
- Bed workspace should expose concise current occupant context:
  - elder status and care level
  - active/recent care tasks for the occupant
  - open safety/emergency incidents for the bed/occupant when available
- The UI should remain dense and operational; avoid nested cards or large explanatory blocks.
- Cross-module data must be read-only context unless the user is in that module's own workflow.
- Server data loading should stay scoped by active organization.

## Acceptance Criteria

- [ ] Elder pages show current bed/admission context from persisted data.
- [ ] Elder pages show recent health/care/emergency context once those records exist.
- [ ] Bed workspace shows current occupant context without requiring manual lookup.
- [ ] Cross-module context does not fabricate records when a module has no data.
- [ ] Unauthorized users do not see context that they lack permission to read.
- [ ] Existing elder CRUD and bed/admission workflows still work.
- [ ] `pnpm lint` passes.
- [ ] `pnpm type-check` passes.
- [ ] `pnpm build` passes.

## Dependencies

- Should run after health data management, care execution workspace, and emergency incident workspace have shipped basic persisted data.

## Out Of Scope

- Moving all workflows into a single giant elder detail page.
- Editing health/care/emergency records from elder or bed context panels.
- Replacing existing elder or bed workspace architecture.

## Open Questions

- None currently blocking planning.
