feat: add health data management workspace

This commit is contained in:
2026-07-03 00:25:11 -07:00
parent dc034b6d85
commit 41807ff557
53 changed files with 7367 additions and 3 deletions

View File

@@ -0,0 +1 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}

View File

@@ -0,0 +1 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}

View File

@@ -0,0 +1,76 @@
# 护理服务执行工作台
## Goal
Replace the current `护理服务` placeholder with a real daily care execution workspace. The MVP unit is a persisted care task / service execution record, not a care-plan generation engine.
## Confirmed Facts
- `/app/care` currently renders `ModulePage` only.
- `/app/{organizationSlug}/care` delegates to the unscoped care page.
- Existing elder, bed, and admission data are persisted in Drizzle.
- Navigation already exposes `护理服务` under the operation group.
- Historical product direction includes care tasks, dispatch,巡检打卡, service records, and service evaluation.
## Requirements
- Add Drizzle-backed care execution records scoped by organization.
- Care records should link to a real elder where applicable.
- Care records should support at least:
- title/name
- care type
- priority
- status
- scheduled time or due time
- assignee label or executor label
- execution notes
- completed time
- Replace `/app/care` and `/app/{organizationSlug}/care` with a real workspace.
- The workspace should show summary metrics, filters, and a dense care task table/list.
- Operators must be able to filter by status, priority, care type, and elder/search terms.
- Authorized operators can mark care items as in progress and completed.
- Completion must persist notes and completion timestamp.
- Mutations must record audit logs.
- Default workspace seed data must include representative care examples covering multiple statuses and care types.
## Permissions
- Prefer explicit care permissions if adding new permissions is practical:
- `care:read`
- `care:manage`
- If scope needs to stay smaller, reuse existing `elder:update` temporarily only if documented in the design.
- Server-side permissions are required for all mutation APIs.
## Acceptance Criteria
- [ ] `/app/care` no longer renders the generic placeholder.
- [ ] `/app/{organizationSlug}/care` renders the same real care workspace.
- [ ] Care records are loaded from Drizzle and scoped to the active organization.
- [ ] Default seeded workspace includes care tasks tied to seeded elders.
- [ ] The UI shows pending, in-progress, completed, and overdue/high-priority examples.
- [ ] Authorized users can move a care item to in-progress and completed from the UI.
- [ ] Completed care items persist execution notes and completion time.
- [ ] Unauthorized mutation attempts return structured failures.
- [ ] Care mutations write audit log entries.
- [ ] `pnpm db:generate` is run if schema changes are made.
- [ ] `pnpm lint` passes.
- [ ] `pnpm type-check` passes.
- [ ] `pnpm build` passes.
## Dependencies
- Can start after or parallel with health management because it primarily depends on existing elder/admission data.
- Dashboard integration should wait until this task is complete.
## Out Of Scope
- Care plan template management.
- Automatic recurring task generation.
- Service billing or pricing.
- Family notifications.
- Mobile QR/NFC check-in.
- AI care recommendations.
## Open Questions
- None currently blocking planning.

View File

@@ -0,0 +1,26 @@
{
"id": "care-execution-workspace",
"name": "care-execution-workspace",
"title": "护理服务执行工作台",
"description": "",
"status": "planning",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "TalexDreamSoul",
"assignee": "TalexDreamSoul",
"createdAt": "2026-07-02",
"completedAt": null,
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": "07-02-operations-module-roadmap",
"relatedFiles": [],
"notes": "",
"meta": {}
}