Files
hms/docs/audits/01-feature-inventory.md
iven d712ad78c3 docs: 审计报告(8 份) + 讨论记录(4 份)
审计报告: 基线快照/功能清单/后端完整性/事件系统/参数配置/
差距模式/错误处理/测试覆盖/审计总结报告
讨论记录: 设备管线/端到端测试/三端审计/工作台重构
2026-05-03 19:32:15 +08:00

253 lines
12 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# HMS 功能审计 — Phase 1: 功能清单与路由映射
> 日期: 2026-04-30 | 审计范围: 后端 + Web + 小程序三端
## 总览
| 维度 | 数量 |
|------|------|
| 后端路由 | 328 个8 公开 + 320 受保护) |
| Web 前端 API 调用 | 235 个 |
| 小程序 API 调用 | 76 个 |
| Web 页面路由 | 38 个 |
| 小程序页面 | 40 个31 患者 + 9 医护) |
---
## 1. 模块路由分布
| 模块 | 后端路由 | Web API | 小程序 API | 状态 |
|------|---------|---------|-----------|------|
| erp-auth | 33 | 32 | 3 | 分叉正常Web=管理端MP=微信登录) |
| erp-health | 169 | 124 | 57 | 覆盖广泛 |
| erp-ai | 12 | 8 | 2 | Web 为主 |
| erp-dialysis | 12 | 6 | 0 | **MP 缺失** |
| erp-config | 26 | 26 | 0 | Web 专属(管理功能) |
| erp-workflow | 17 | 14 | 0 | Web 专属(管理功能) |
| erp-message | 13 | 8 | 0 | Web 专属 |
| erp-plugin | 38 | 35 | 0 | Web 专属 |
| erp-server | 8 | 1 | 1 | SSE + 健康检查 |
---
## 2. 三端对齐矩阵 — 健康模块(核心业务)
### 2.1 患者管理
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET /health/patients` | ✓ list | ✓ listPatients + getPatients | ALIGNED |
| `POST /health/patients` | ✓ create | ✓ createPatient | ALIGNED |
| `GET /health/patients/{id}` | ✓ get | ✓ getPatient | ALIGNED |
| `PUT /health/patients/{id}` | ✓ update | ✓ updatePatient | ALIGNED |
| `DELETE /health/patients/{id}` | ✓ delete | — | WEB-ONLY预期 |
| `POST /health/patients/{id}/tags` | ✓ manageTags | — | WEB-ONLY预期 |
| `GET /health/patient-tags` | ✓ listTags | ✓ listPatientTags | ALIGNED |
| `POST/PUT/DELETE /health/patient-tags` | ✓ CRUD | — | WEB-ONLY预期 |
| `GET /health/patients/{id}/health-summary` | — | ✓ getHealthSummary | **MP-ONLY** |
| `GET /health/patients/{id}/family-members` | ✓ list | — | WEB-ONLY |
| `POST/PUT/DELETE .../family-members` | ✓ CRUD | ✓ (pages) | MP 有独立页面 |
| `POST .../doctors` (assign) | ✓ | — | WEB-ONLY |
| `DELETE .../doctors/{did}` | ✓ | — | WEB-ONLY |
### 2.2 健康数据
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET/POST/PUT/DELETE .../vital-signs` | ✓ 全 CRUD | ✓ 仅 createinputVitalSign | 差异正常 |
| `GET /health/vital-signs/today` | — | ✓ getTodaySummary | **MP-ONLY** |
| `GET /health/vital-signs/trend` | — | ✓ getTrend | **MP-ONLY** |
| `GET .../trends` | ✓ listTrends | — | WEB-ONLY |
| `GET .../trends/{indicator}` | ✓ timeseries | — | WEB-ONLY |
| `POST .../trends/generate` | ✓ | — | **ORPHAN**(未见前端调用) |
| `GET/POST .../lab-reports` | ✓ 全 CRUD | ✓ list + get | MP 只读 |
| `PUT .../lab-reports/{id}/review` | ✓ review | ✓ review医护端 | ALIGNED |
| `GET/POST/PUT/DELETE .../health-records` | ✓ 全 CRUD | — | **WEB-ONLY** |
| `GET/POST/PUT/DELETE .../diagnoses` | ✓ 全 CRUD | — | **WEB-ONLY** |
| `GET/POST/PUT/DELETE .../daily-monitoring` | ✓ 全 CRUD | ✓ create + list | MP 仅创建+列表 |
| `GET/POST/PUT/DELETE .../medications` | ✓ 全 CRUD | — | **WEB-ONLY** |
| `GET/POST/PUT/DELETE .../medication-reminders` | ✓ 全 CRUD | — | **WEB-ONLY** |
### 2.3 预约管理
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET /health/appointments` | ✓ list | ✓ list + doctor list | ALIGNED |
| `POST /health/appointments` | ✓ create | ✓ create | ALIGNED |
| `GET /health/appointments/{id}` | ✓ get | ✓ get | ALIGNED |
| `PUT .../status` | ✓ updateStatus | ✓ cancelAppointment | ALIGNED |
| `GET/POST/PUT /health/doctor-schedules` | ✓ | ✓ get + calendar | Web 有管理 CRUD |
| `GET .../calendar` | ✓ calendar | ✓ calendarView | ALIGNED |
| `GET /health/doctors` | ✓ list | ✓ list | ALIGNED |
| `POST/PUT/DELETE /health/doctors` | ✓ CRUD | — | WEB-ONLY预期 |
### 2.4 随访管理
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET/POST/PUT/DELETE .../follow-up-tasks` | ✓ 全 CRUD | ✓ list + get | Web 有管理MP 只读 |
| `POST .../batch-create/assign/complete` | ✓ 批量操作 | — | WEB-ONLY |
| `POST .../records` (create) | ✓ | ✓ submit + doctor create | ALIGNED |
| `GET .../follow-up-records` | ✓ list | ✓ list | ALIGNED |
| `GET/POST/PUT/DELETE .../follow-up-templates` | ✓ 全 CRUD | — | WEB-ONLY |
### 2.5 咨询管理
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET/POST .../consultation-sessions` | ✓ list + create | ✓ list + doctor list | ALIGNED |
| `GET .../{id}` | ✓ get | ✓ get | ALIGNED |
| `GET .../{id}/messages` | ✓ list | ✓ list + doctor list | ALIGNED |
| `POST .../consultation-messages` | ✓ create | ✓ send + doctor send | ALIGNED |
| `PUT .../{id}/close` | ✓ close | ✓ doctor close | ALIGNED |
| `PUT .../{id}/read` | ✓ markRead | ✓ markRead | ALIGNED |
| `GET .../export` | ✓ export | — | WEB-ONLY预期 |
| `GET .../doctor/dashboard` | — | ✓ doctor dashboard | **MP-ONLY** |
### 2.6 内容管理(文章)
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET /health/articles` | ✓ list全状态 | ✓ list仅 published | 角色分叉(正常) |
| `GET /health/articles/{id}` | ✓ get | ✓ getDetail | ALIGNED |
| `POST/PUT/DELETE /health/articles` | ✓ 全 CRUD | — | WEB-ONLY预期 |
| `POST .../submit/approve/reject/unpublish` | ✓ 审核流程 | — | WEB-ONLY预期 |
| `POST .../view` | ✓ view | — | WEB-ONLY |
| `GET .../revisions` | ✓ revisions | — | WEB-ONLY |
| `GET/POST/PUT/DELETE .../article-categories` | ✓ CRUD | ✓ list | MP 只读 |
| `GET/POST/PUT/DELETE .../article-tags` | ✓ CRUD | — | WEB-ONLY |
### 2.7 积分商城
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET /health/points/account` | — | ✓ getAccount | **MP-ONLY** |
| `POST /health/points/checkin` | — | ✓ dailyCheckin | **MP-ONLY** |
| `GET /health/points/checkin/status` | — | ✓ getCheckinStatus | **MP-ONLY** |
| `GET .../products` | ✓ admin + patient | ✓ listProducts | ALIGNED |
| `POST .../exchange` | — | ✓ exchangeProduct | **MP-ONLY** |
| `GET .../orders` | ✓ admin list | ✓ listMyOrders | 角色分叉(正常) |
| `GET .../transactions` | — | ✓ listMyTransactions | **MP-ONLY** |
| `POST .../verify` | ✓ verifyOrder | — | WEB-ONLY |
| `GET .../offline-events` | ✓ admin + patient | ✓ list | ALIGNED |
| `POST .../offline-events/{id}/register` | — | ✓ registerEvent | **MP-ONLY** |
| `GET/POST/PUT/DELETE .../admin/points/rules` | ✓ CRUD | — | WEB-ONLY预期 |
| `GET/POST/PUT/DELETE .../admin/points/products` | ✓ CRUD | — | WEB-ONLY预期 |
| `GET .../admin/points/orders` | ✓ list | — | WEB-ONLY预期 |
| `GET .../admin/points/statistics` | ✓ | — | WEB-ONLY预期 |
| `GET .../admin/offline-events` | ✓ admin CRUD | — | WEB-ONLY预期 |
### 2.8 告警系统
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET /health/alerts` | ✓ list | ✓ list + doctor list | ALIGNED |
| `PUT .../acknowledge/dismiss/resolve` | ✓ | ✓ doctor acknowledge/dismiss/resolve | ALIGNED |
| `GET/POST/PUT .../alert-rules` | ✓ 全 CRUD | — | WEB-ONLY预期 |
| `GET/POST .../critical-alerts` | ✓ list/get/acknowledge | — | **WEB-ONLY** |
| `GET/POST/PUT/DELETE .../critical-value-thresholds` | ✓ 全 CRUD | — | **WEB-ONLY** |
### 2.9 设备与数据采集
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET .../devices` | ✓ list | — | WEB-ONLY |
| `DELETE .../devices/{id}` | ✓ unbind | — | WEB-ONLY |
| `POST .../device-readings/batch` | ✓ batchCreate | ✓ uploadReadings | ALIGNED |
| `GET .../device-readings` | ✓ query | ✓ query | ALIGNED |
| `GET .../device-readings/hourly` | ✓ hourly | ✓ queryHourly | ALIGNED |
### 2.10 AI 分析
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `POST /ai/analyze/*` (4 个 SSE) | — | — | **ORPHAN**(管理端未接入) |
| `GET /ai/analysis/history` | ✓ list | ✓ list | ALIGNED |
| `GET /ai/analysis/{id}` | ✓ get | ✓ getDetail | ALIGNED |
| `GET/POST .../prompts` | ✓ CRUD | — | WEB-ONLY预期 |
| `POST .../prompts/{id}/activate/rollback` | ✓ | — | WEB-ONLY |
| `GET .../usage/overview + by-type` | ✓ | — | WEB-ONLY |
### 2.11 透析管理
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET .../dialysis-records` | ✓ list | — | **WEB-ONLY** |
| `POST/PUT/DELETE .../dialysis-records` | ✓ 全 CRUD | — | **WEB-ONLY** |
| `PUT .../dialysis-records/{id}/review` | ✓ review | — | **WEB-ONLY** |
| `GET/POST/PUT/DELETE .../dialysis-prescriptions` | ✓ 全 CRUD | — | **WEB-ONLY** |
| `GET .../admin/statistics/dialysis` | ✓ | — | **WEB-ONLY** |
### 2.12 知情同意
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET .../consents` | ✓ list | — | **WEB-ONLY** |
| `POST .../consents` (grant) | ✓ | — | **WEB-ONLY** |
| `PUT .../consents/{id}/revoke` | ✓ | — | **WEB-ONLY** |
### 2.13 统计仪表盘
| 后端路由 | Web | 小程序 | 状态 |
|----------|-----|--------|------|
| `GET .../admin/statistics/*` (9 个) | ✓ 全部 | ✓ 3 个doctor 端) | Web 完整MP 部分覆盖 |
---
## 3. 差距模式摘要
### 3.1 预期分叉(管理员 vs 患者角色)
以下差异是**正常的角色分叉**Web 面向管理员,小程序面向患者/医护:
- 用户/角色/组织管理 → 仅 Web
- 系统配置(字典/菜单/设置/主题/语言/编号) → 仅 Web
- 工作流引擎 → 仅 Web
- 消息管理 → 仅 Web
- 插件系统 → 仅 Web
- 微信登录 → 仅小程序
- 积分签到/兑换 → 仅小程序
- BLE 设备同步 → 仅小程序
- 每日摘要/趋势 → 仅小程序
- 医生仪表盘 → 仅小程序(医护端)
### 3.2 需关注的差距
| 差距 | 影响范围 | 优先级 |
|------|---------|--------|
| 透析管理 — 小程序完全无入口 | 患者无法在移动端查看透析记录 | P1 |
| 知情同意 — 小程序无入口 | 患者无法在移动端管理同意书 | P1 |
| AI 分析 SSE 端点 — 两端都无管理 UI 调用 | AI 功能可能仅通过直接 API 测试使用 | P2 |
| 药物管理 — 小程序有页面但无 API 调用对应 | MP 药物页面可能使用其他 API 或硬编码 | P2 |
| 趋势生成 `POST .../trends/generate` — 无前端调用 | 后台功能可能仅通过定时任务触发 | P3 |
| 危急值告警/阈值管理 — 小程序无入口 | 仅 Web 管理端可操作 | P3 |
| 健康记录 CRUD — 小程序无入口 | 患者移动端无法查看健康档案 | P2 |
| 诊断记录 CRUD — 小程序无入口 | 患者移动端无法查看诊断 | P2 |
### 3.3 后端孤立路由(无任何前端调用者)
| 路由 | 说明 |
|------|------|
| `POST /health/patients/{id}/trends/generate` | 趋势报告生成,可能为内部任务 |
| `POST /ai/analyze/*` (4 个 SSE) | AI 分析接口,可能通过 API 工具直接调用 |
---
## 4. 功能完成度评估
| 功能域 | 后端 | Web | 小程序 | 整体完成度 |
|--------|------|-----|--------|-----------|
| 患者管理 | 100% | 100% | 85%(无删除) | 95% |
| 医生/排班 | 100% | 100% | 40%(只读) | 80% |
| 健康数据 | 100% | 100% | 60%(体征+化验+监测) | 87% |
| 预约管理 | 100% | 100% | 90% | 97% |
| 随访管理 | 100% | 100% | 70%(医护端完善) | 90% |
| 咨询管理 | 100% | 100% | 95% | 98% |
| 内容管理 | 100% | 100% | 50%(只读列表) | 83% |
| 积分商城 | 100% | 80%(管理端) | 100%(患者端) | 93% |
| 告警系统 | 100% | 100% | 60%(仅查看/处理) | 87% |
| AI 分析 | 100% | 70%(无 SSE 调用) | 30%(仅历史查看) | 67% |
| 透析管理 | 100% | 100% | 0% | 67% |
| 知情同意 | 100% | 100% | 0% | 67% |
| 统计仪表盘 | 100% | 100% | 30%(医护端部分) | 77% |