Commit Graph

448 Commits

Author SHA1 Message Date
iven
cac61637ce feat(health): Web 管理端设备数据集成补全 — Phase 2
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 新增告警三页面(仪表盘/列表/规则)+ 设备管理菜单种子数据
- 新增设备管理后端 API(GET /devices + DELETE /devices/{id})
- 新增设备数据查看组件 DeviceReadingsTab(原始数据 + 小时聚合)
- 新增设备管理页面 DeviceManage(列表/筛选/解绑)
- 患者详情页新增设备数据 Tab
2026-04-29 06:28:30 +08:00
iven
f6ccb8a35c fix(health): 设备数据管线 Phase 1 缺陷修复 + AI 产品策略讨论
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- device_readings 批量插入添加 ON CONFLICT 去重唯一索引
- 小程序 BLEManager 增加离线缓存(Storage 持久化 + 启动重传)
- 新增 device_readings 90 天数据保留清理定时任务
- 小米手环适配器增加 RACP 历史心率读取支持
- SSE 告警按医生过滤已确认实现(patient_doctor_relation)
- 新增 AI 产品策略与设备数据医院场景讨论记录
2026-04-29 06:17:23 +08:00
iven
a491eb19a6 fix(web+health): E2E flow 测试全面修复 — 15/15 通过
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- test-data: 接口对齐后端 DTO(VitalSigns/AlertRule/Schedule/FollowUp)
- api-client: 增强 HTTP 错误处理(parseJson 统一防护非 JSON 响应)
- auth.fixture: 每个测试获取新 token,避免共享 token 过期
- patient-detail: tab 名称修正为 '健康数据' → '体征数据'
- patient-list: DrawerForm 选择器适配(无 phone 字段、保存按钮在 extra)
- vital-signs-flow: API 录入 + 页面验证,避免复杂 DatePicker 交互
- alert-flow: 简化为规则 CRUD + 页面导航,condition_params 对齐后端格式
- follow-up-template handler: 权限码从 health.follow-up-template.* 修正为 health.follow-up.*
- playwright.config: workers=1 串行执行避免并发登录
- check-readiness: 健康端点路径修正为 /api/v1/health
2026-04-29 06:04:22 +08:00
iven
c6e8048bc5 test(web+mp): E2E 测试全量实施 — Web 5 flow + MP 4 flow + 基础设施
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
Web 端 (Playwright):
- fixtures: test-data 工厂 + API Client (乐观锁 version) + 增强 auth fixture
- pages: LoginPage, PatientListPage, PatientDetailPage, HealthDataPage, AppointmentPage
- flows: 患者全流程, 体征数据链路, 预约排班链路, 随访管理链路, 告警处理链路
- smoke tests 迁移到 smoke/ 目录,import 路径更新
- playwright.config.ts 更新: globalSetup 环境检查, 60s timeout, video retain

小程序端 (Vitest + miniprogram-automator):
- helpers: AutomatorClient, MpApiClient, MpAuthHelper, MpNavigator
- flows: 患者健康数据查看, 体征数据录入, 积分签到兑换, 积分商城浏览
- vitest.config.ts + check-readiness.ts
- vitest 4.1.5 依赖安装

Playwright 发现 15 个测试 (5 flow + 10 smoke),全部就绪
2026-04-29 04:58:01 +08:00
iven
2f4be6dcd0 docs(e2e): 添加 E2E 测试实施计划
5 个 Chunk, 21 个 Task:
- Chunk 1: 基础设施(test-data + api-client + auth fixture + config)
- Chunk 2: Web Page Objects(5 个关键页面)
- Chunk 3: Web 业务链路(5 条 flow spec)
- Chunk 4: 小程序基础设施(automator + helpers + vitest config)
- Chunk 5: 小程序业务链路(4 条 flow spec)
2026-04-28 22:39:24 +08:00
iven
1bde4b44c0 fix(web): VitalSignsChart hooks 顺序修复 + 趋势线颜色区分度优化
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
修复 React hooks 在 early return 之后调用导致的渲染崩溃,
将所有 useMemo 移至条件返回之前。趋势图三系列改用高对比色:
实际值(原色实线)、移动平均(青色短虚线)、趋势线(琥珀色长虚线)。
2026-04-28 22:10:13 +08:00
iven
4eb874f52d docs(e2e): 添加 E2E 测试设计规格文档
流程链路式双端 E2E 测试体系设计:
- Web 端 5 条业务链路(Playwright + Page Object)
- 小程序端 4 条业务链路(Vitest + miniprogram-automator)
- API 驱动自建自毁数据策略,乐观锁 version 支持
- CI-ready 环境变量驱动设计
2026-04-28 21:57:19 +08:00
iven
5ab8bf8479 feat(server): 可观测性 Phase 1 — 健康检查路由 + Prometheus 指标 + 连接池/事件积压监控
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 添加 /health/live 存活探针别名(原 /health + /health/ready 保留)
- 新增 metrics middleware:http_requests_total 计数器 + http_request_duration_seconds 直方图
- Prometheus exporter 独立端口 9090(可通过 ERP__SERVER__METRICS_PORT 覆盖)
- 后台任务每 30s 采样 DB 连接池活跃/空闲连接数(pg_stat_activity)
- 后台任务每 30s 采样 EventBus pending 事件积压数
- UUID 路径归一化避免高基数(/api/v1/users/:id/posts)
2026-04-28 20:39:11 +08:00
iven
f99892ee16 feat(web+mp): AI 分析结果增强展示
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
Web 端 AiAnalysisList:
- 分析结果 Markdown 风格渲染(标题/列表/粗体/代码)
- 趋势分析类型显示统计方法提示
- 自动分析结果显示「系统自动分析」标签

小程序 ai-report/detail:
- 新增 result_metadata 字段
- 自动分析标记(紫色标签)
- 趋势分析统计方法说明卡片
2026-04-28 20:12:34 +08:00
iven
10c79c5e39 feat(mp): 医护端告警列表/详情页 + DoctorHome 告警 banner 增强
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 新增告警列表页:按状态筛选、分页、严重程度/状态标签
- 新增告警详情页:完整信息展示 + 确认/忽略/恢复操作
- doctor.ts 新增 listAlerts/acknowledgeAlert/dismissAlert/resolveAlert API
- DoctorHome 告警 banner 跳转目标改为告警列表页
- 注册 alerts/index + alerts/detail/index 到 doctor subPackage
2026-04-28 20:05:55 +08:00
iven
1cf5f59d8c feat(web): VitalSignsChart 集成趋势线 + 移动平均 + 异常标注
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
增强 VitalSignsChart 组件:
- 线性回归趋势线(虚线显示,斜率/R² 统计)
- 移动平均线(自适应窗口,平滑实线)
- 异常点检测(2倍标准差,红色标记)
- 概览卡片显示趋势方向箭头和异常警告图标
- 详情图下方图例说明各系列含义
2026-04-28 20:05:43 +08:00
iven
a84378ab50 feat(ai): 定期自动分析定时任务 — 每 24 小时扫描高风险患者
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
新增 auto_analysis.rs 服务:
- 启动后延迟 5 分钟,每 24 小时执行一次
- 查找所有活跃租户中高风险患者(异常体征指标)
- 自动调用趋势分析并存储分析结果
- 每租户限制 50 名患者,防止过载
- erp-server main.rs 中注册后台任务
2026-04-28 20:02:01 +08:00
iven
493b479373 feat(web): DoctorDashboard 集成告警摘要卡片
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
在医生工作台新增待处理告警摘要区域,展示最近 5 条
pending 状态告警,点击「查看全部」跳转告警仪表盘。
2026-04-28 20:01:11 +08:00
iven
27c32e5561 feat(web): 实时告警仪表盘页面 + SSE Hook + 告警详情面板
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 新增 AlertDashboard 页面:实时告警列表 + 统计摘要 + 详情面板
- 新增 useAlertSSE Hook:封装 SSE 连接、自动重连、事件分发
- 新增 AlertDetailPanel 组件:告警详情展示 + 确认/忽略/恢复操作
- alertApi.list 添加 doctor_id 参数支持
- 注册 /health/alert-dashboard 路由 + 面包屑映射
2026-04-28 19:59:51 +08:00
iven
cf844a561f feat(ai+db): 趋势分析 prompt 升级为结构化统计摘要
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 新增迁移 000093:更新 health_trend_analysis prompt,使用统计字段
  替代原始数据点遍历,引导 AI 专注 slope/R²/异常点分析
- erp-ai handler: stream_trends 改用 get_trend_analysis_data()
  替代 get_vital_signs(),传递预计算趋势特征
- sanitizer: 新增 sanitize_trend_analysis() 方法
2026-04-28 19:57:51 +08:00
iven
1c9e7ccf1d feat(core+health): HealthDataProvider 扩展趋势分析预计算数据
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- erp-core: 新增 get_trend_analysis_data() trait 方法和配套 DTO
  (TrendAnalysisDto, MetricTrendAnalysis, RegressionStats, AnomalyInfo)
- erp-health: 实现 get_trend_analysis_data(),查询 vital_signs 时间序列
  后调用 trend_stats 模块计算线性回归和异常检测,返回结构化统计摘要
2026-04-28 19:55:06 +08:00
iven
8aac96b62f feat(health): 告警列表 API 添加 doctor_id 过滤参数
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
alert_handler 的 AlertListQuery 新增 doctor_id 参数。
alert_service::list_alerts 先查询 patient_doctor_relation
获取该医生负责的患者列表,再用 patient_id.is_in() 过滤。
医生无管床患者时直接返回空结果。新增 2 个单元测试。
2026-04-28 19:54:12 +08:00
iven
4745b1e824 feat(health): 统计计算模块 — 线性回归、移动平均、异常检测
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
新增 trend_stats.rs 纯函数模块,提供三个统计计算能力:
- compute_linear_regression: 最小二乘法线性回归,返回 slope/intercept/R^2/方向/日变化/周期变化
- compute_moving_average: 简单移动平均,支持任意窗口大小
- detect_anomalies: 均值 +/- N 标准差异常检测

包含 21 个单元测试,覆盖边界条件和正常用例。
2026-04-28 19:50:46 +08:00
iven
781e1191a5 feat(message): SSE 告警/体征推送添加医患关系过滤
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
alert.triggered 和 device.readings.synced 事件现在只推送给
该患者的管床医生(通过 patient_doctor_relation 表查询),
而非广播给租户内所有用户。新增 3 个单元测试验证 payload
解析逻辑。
2026-04-28 19:49:38 +08:00
iven
e5546efa41 refactor(web): alerts + deviceReadings API 迁移为对象风格导出
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- alerts.ts: listAlerts → alertApi.list, acknowledgeAlert → alertApi.acknowledge 等
- deviceReadings.ts: batchCreateReadings → deviceReadingApi.batchCreate 等
- AlertList/AlertRuleList 引用处同步更新
- 其余 19 个函数式 API 文件记为待迁移(旧文件不强制迁移)
2026-04-28 19:47:48 +08:00
iven
99093d8143 refactor(web): 16 个列表页 columns 定义 useMemo 化 — 减少 Table 不必要 re-render
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- AiPromptList/AiAnalysisList/AppointmentList 等 14 个主页面
- HealthRecordsTab/LabReportsTab 2 个 Tab 组件
- 每个 columns 依赖数组包含其引用的闭包变量(handleDelete/navigate 等)
2026-04-28 19:45:14 +08:00
iven
e76f4feb4f feat(health): 告警微信模板消息通知 + alert.triggered 事件消费者
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-28 19:43:57 +08:00
iven
601b2d7f52 feat(mp): 首页设备状态卡片组件 — 血压计/血糖仪快捷入口 2026-04-28 19:42:24 +08:00
iven
00f615d8e5 feat(health): 新增血压/血糖临床阈值告警规则 + alert engine 直接查 device_readings 2026-04-28 19:40:25 +08:00
iven
8a61ae3f8e feat(health): device_readings 双写 vital_signs — 血压/血糖自动归档 2026-04-28 19:37:43 +08:00
iven
d715647a73 feat(mp): BloodPressureAdapter + GlucoseMeterAdapter — BLE 0x1810/0x1808 标准协议适配器 2026-04-28 19:30:03 +08:00
iven
e7b2e6382a chore(web): 降低 chunkSizeWarningLimit 从 600 至 500
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-28 19:28:37 +08:00
iven
8a5b14e087 feat(mp): DeviceType 扩展支持 blood_pressure/blood_glucose + 适配器接口改数组返回 2026-04-28 19:27:14 +08:00
iven
83e243f03e feat(db): device_readings 新增 metric 字段用于多行拆分存储 2026-04-28 19:24:32 +08:00
iven
679d83d3b6 refactor(web): 迁移 3 个健康页面错误处理到 useApiRequest — 消除内联 catch/message.error
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- PatientList: handleCreateOrEdit/handleDelete/openEditModal 使用 execute
- AppointmentList: handleStatusChange(2处)/handleSubmit 使用 execute
- FollowUpTaskList: handleCreate/handleRecordSubmit/handleAssign/handleDelete 使用 execute
- 移除不再需要的 message 导入(PatientList/FollowUpTaskList)
2026-04-28 19:24:07 +08:00
iven
40a71e5a1c feat(health): 扩展 device_type 枚举支持 blood_pressure 和 blood_glucose 2026-04-28 19:21:21 +08:00
iven
0aab27295c feat(ai): 实现 AI 数据桥接 — 4 个 HealthDataProvider 方法从 stub 替换为真实查询
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- get_lab_report: 查询 lab_report + patient,解析 JSON items 构造 LabReportDto
- get_vital_signs: 查询 vital_signs 时间序列,按指标提取 8 种体征数据
- get_patient_summary: 聚合 patient + diagnosis + medication_record + health_record
- get_full_report: 查询 health_record + 关联诊断和化验报告构造章节
- AiState 新增 health_provider 字段,erp-server 注入 HealthDataProviderImpl
- 4 个 SSE handler 从 placeholder JSON 改为调用 provider + sanitizer 真实数据流
2026-04-28 19:08:38 +08:00
iven
ace04ee56d test(config): erp-config 从 50 增至 66 个单元测试 — fallback_chain + model_to_resp + ThemeResp
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- setting_service: 7 个测试(5 个 fallback_chain 作用域解析 + 2 个 model_to_resp 映射)
- theme_handler: 2 个测试(default_theme 默认值 + ThemeResp serde round-trip)
2026-04-28 18:31:01 +08:00
iven
26aa66d6e3 test(message): erp-message 从 45 增至 69 个单元测试 — DND 时间窗 + TransactionError + model_to_resp
Some checks failed
CI / frontend-build (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- module.rs: 提取 is_in_dnd_window 纯函数 + 14 个 DND 时间窗测试(正常范围/跨午夜/边界)
- error.rs: 2 个 TransactionError 转换测试(Connection/Transaction)
- message_service: 2 个 model_to_resp 字段映射测试
- template_service: 1 个 model_to_resp 字段映射测试
- subscription_service: 1 个 model_to_resp 字段映射测试
2026-04-28 18:26:36 +08:00
iven
50e63530d9 test(ai): erp-ai 从零增至 34 个单元测试 — 覆盖 DTO/error/prompt/sanitization
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- dto.rs: 8 个测试(AnalysisType 映射、serde round-trip、SSE 事件、默认值)
- error.rs: 10 个测试(AiError 全部 10 个变体 → AppError 映射)
- prompt: 8 个测试(变量替换、嵌套对象、数组迭代、条件、严格模式缺失变量)
- sanitization: 8 个测试(4 种 DTO 脱敏通过、PII 字段检测、空数据边界)
2026-04-28 18:17:19 +08:00
iven
dde6b09017 test(workflow): erp-workflow 单元测试从 16 增至 63 — 覆盖 model/error/parser/expression/executor
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- model.rs: 13 个 FlowGraph 测试(build/outgoing/incoming/start-end 边界)
- error.rs: 7 个 WorkflowError → AppError 转换测试
- parser.rs: 11 个新增验证边界测试(空图/多起点/幽灵边/网关约束)
- expression.rs: 13 个新增求值测试(float/bool/string/复合表达式/空白容错)
- executor.rs: 3 个 is_join_gateway 纯函数测试
2026-04-28 18:04:06 +08:00
iven
5941a6b764 feat(dialysis): 激活 erp-dialysis 独立模块 — 注册到 erp-server
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- workspace Cargo.toml 添加 erp-dialysis 依赖声明
- erp-server 注册 DialysisModule 并挂载透析路由
- 修复权限码:health.health-data.* → health.dialysis.list/manage
- 集成测试迁移:erp_health → erp_dialysis import + DialysisState
- TestApp 新增 dialysis_state() 方法
- cargo check 通过,erp-dialysis 10 个单元测试全部通过
2026-04-28 15:21:13 +08:00
iven
75cd305996 docs(wiki): 全景梳理 — 更新 9 个 wiki + CLAUDE.md scope + 头脑风暴记录
Some checks failed
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
基于 3 个并行探索代理的全面扫描结果,更新 wiki 数据至实际状态:
- index.md: 18 crate / 76 迁移 / 44 实体 / 77k 行 / 409 提交
- erp-health.md: 44 实体 / 21 handler / 22 权限 / 25 事件 / 6 消费者
- erp-server.md: 9 后台任务 / RLS 中间件栈
- architecture.md: 新增 erp-ai/dialysis 到依赖图 / 测试覆盖表
- testing.md: 225 单元 + 159 集成 / 4 模块零测试警告
- database.md: 76 迁移 / RLS+哈希链+盲索引+Dead Letter
- erp-core.md: PiiCrypto 加密体系 / EventBus 完整描述
- frontend.md: 163 文件 / 5 store / 10 API 文件
- CLAUDE.md: 新增 health/ai/dialysis/assessment scope

头脑风暴 4 个议题决策:
- dialysis: 接入激活
- 测试: 按风险排序(workflow > ai > message > config)
- AI: 数据桥接优先
- 路线图: AI 驱动 3 个月 5 Phase
2026-04-28 14:53:04 +08:00
iven
ac1033dbaf refactor: 积分系统拆分为独立 erp-points crate
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 新建 erp-points crate(8 Entity + account/product service + handler)
- 商品 CRUD 和账户管理完整实现,订单/签到/规则端点暂返回 501
- 注册到 workspace + erp-server 路由 /api/v1/points/*
- API 路径不变,前端无需修改
2026-04-28 14:32:16 +08:00
iven
fa9278590d refactor(dialysis): 透析模块拆分为独立 erp-dialysis crate
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 创建 erp-dialysis crate(DialysisState + DialysisError + DialysisModule)
- 迁移 2 Entity + 2 Service + 2 Handler + 2 DTO 共 8 个文件
- Entity 移除跨 crate patient Relation(FK 列保留)
- Service 内联 validation 逻辑,移除 patient 存在性检查(FK 约束保证)
- erp-health 的 stats/consultation 中 dialysis 查询改为 raw SQL
- ReviewLabReportReq 从 dialysis_dto 移至 health_data_dto(正确归属)
- workspace 全量编译通过
2026-04-28 12:37:23 +08:00
iven
e00c2abdcd feat(health): P1 事件消费者补全 — patient/appointment/follow_up
- patient.created → 发布欢迎消息事件(message.send 模板通知)
- appointment.confirmed → 通知医生预约确认
- appointment.cancelled → 号源释放标记
- follow_up.overdue → 逾期随访升级通知
- 所有消费者含幂等检查(processed_events 表)
2026-04-28 12:17:54 +08:00
iven
147fd886e3 feat(plugin): 评估量表 WASM 编译通过 — 170KB cdylib 组件
- wasm32-unknown-unknown target 编译成功
- 插件通过 API upload/install 注册,无需手动配置
2026-04-28 12:13:52 +08:00
iven
96c9a8ada9 feat(plugin): 评估量表插件骨架 — assessment_scale + assessment_response + PHQ-9 默认数据
- 创建 erp-plugin-assessment cdylib crate
- 实现 Guest trait(init/on_tenant_created/handle_event)
- on_tenant_created 自动插入 PHQ-9 抑郁筛查量表
- plugin.toml 声明 2 实体 + 4 权限 + 触发事件
2026-04-28 12:12:47 +08:00
iven
ade8497c2d docs(plan): 架构反思实施计划 — WASM 评估量表 + 透析拆分 + P1 事件消费者
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
8 Tasks / 3 Chunks:
- Chunk 1: WASM 评估量表插件 (PHQ-9) — crate 骨架 + 默认数据 + WASM 编译
- Chunk 2: 透析模块拆分 erp-dialysis — 8 文件 ~1100 行迁移
- Chunk 3: P1 事件消费者补全 — patient.created / appointment 通知 / follow_up.overdue
2026-04-28 11:58:01 +08:00
iven
be8fca1d76 feat(core): EventBus dead-letter + consume_with_retry 辅助函数
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 新增 dead_letter_events 表 + Entity
- consume_with_retry: 幂等检查 + 成功标记 + 失败转入 dead-letter
- insert_dead_letter: 写入失败事件供后续排查和手动重试
2026-04-28 11:47:44 +08:00
iven
10755cde0e docs: 架构反思讨论记录 + CLAUDE.md 事件消费者制度约束
Some checks failed
CI / frontend-build (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 讨论结论:WASM 插件积极使用(评估量表)、积分/透析拆独立 crate、事件驱动制度化
- CLAUDE.md §3.4 新增铁律:每个事件必须有至少一个消费者,否则功能不算完成
2026-04-28 11:46:31 +08:00
iven
e03a2be1b6 docs(wiki): 更新小程序 wiki 性能优化记录 + 待优化项状态
Some checks failed
CI / frontend-build (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-28 11:46:05 +08:00
iven
fcfc0ba5d9 perf(miniprogram): 全面性能优化 — 分包加载 + 请求缓存 + 渲染优化
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
分包加载(主包从 517KB 降至 275KB,-47%):
- 将 27 个页面拆入 6 个分包(health/doctor/mall/profile/content/device)
- vendors.js 从 192KB 降至 36KB(-81%)
- echarts 514KB 仅在访问健康趋势页时按需加载

请求层优化:
- GET 请求增加 in-flight 去重 + 60s TTL 响应缓存
- 新建 points store 集中管理积分/签到状态(消除 5 处重复调用)
- health store todaySummary 增加 60s TTL
- mutation 后自动失效缓存(health input/daily-monitoring)
- logout 时清空请求缓存

渲染优化:
- 7 个组件添加 React.memo(EcCanvas/TrendChart/Loading/EmptyState 等)
- 修复 TrendChart setChartReady 导致的双重渲染
- 静态数组(quickServices/quickActions/trendLinks)提取到模块级
- restoreAuth 从页面级提升到 App 级别
- 文章列表图片添加 lazyLoad

构建优化:
- prod 配置添加 terser(drop_console + drop_debugger)
- crypto-js 从全量引入改为按需引入(AES + Utf8)
2026-04-28 11:44:37 +08:00
iven
1bece3d41f feat(health): 危急值告警消费者 — 幂等处理 + Handler + 路由
Some checks failed
CI / frontend-build (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- event.rs: 消费 health_data.critical_alert 事件创建告警记录
- handler: list/get/acknowledge 三个端点
- 路由: /health/critical-alerts, /health/critical-alerts/{id}/acknowledge
- 权限: health.critical-alert.list / health.critical-alert.manage
2026-04-28 11:43:32 +08:00
iven
b7b09c0727 feat(health): 危急值告警 service — 创建/确认/升级扫描/列表查询
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- handle_critical_alert_event: 消费事件创建告警记录
- acknowledge_alert: 医生确认 + 创建响应记录
- scan_escalation: 30min→L1, 60min→L2 分级升级
- list_pending_alerts / get_alert: 查询接口
2026-04-28 11:39:38 +08:00