Commit Graph

661 Commits

Author SHA1 Message Date
iven
8a0c9670e6 feat(ai): 对接本地 Ollama qwen3:4b 模型
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
- default_provider 从 claude 切换到 ollama
- main.rs 支持 ollama/openai/claude 三种 provider 动态选择
- 新增 [ai.providers.ollama] 配置段(base_url/model/temperature)
- 前端 SSE AI 分析全链路验证通过
2026-05-05 19:12:55 +08:00
iven
7dac749eff feat(ai): 新增预算状态 + 成本估算 API 端点
Some checks failed
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
Phase 3 Task 25:
- GET /ai/budget/status — 租户月度预算状态和告警等级
- GET /ai/cost/estimate — 按分析类型+模型估算单次成本
2026-05-05 16:05:00 +08:00
iven
0da59c6a0e feat(ai): 成本估算 + 预算告警服务 — CostService
Some checks failed
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
Phase 3 Task 24:
- 按分析类型+模型估算 token 用量和 USD 成本
- 查询租户月度预算状态和告警等级(Normal/Warning/Critical/Exceeded)
2026-05-05 16:03:32 +08:00
iven
d2512ca9db feat(ai): 集成知识库到 AnalysisService — system_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
Phase 3 Task 23: AnalysisService 新增可选 knowledge_source,
stream_analyze 前自动查询 L1/L2/L3 知识并注入 system_prompt
2026-05-05 16:01:52 +08:00
iven
70f69a2008 feat(ai): 实现 StructuredKnowledgeSource — L1/L2/L3 知识库查询
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
Phase 3 Task 22: 从 rules/references/guides 表构建 Prompt 注入上下文
- 规则按优先级排序,参考资料附带引用,指南截取前 2000 字
- 总上下文不超过 8000 字符,confidence 根据 L1/L2 匹配度计算
2026-05-05 15:58:54 +08:00
iven
3592b55556 feat(ai+db): 知识库 3 表迁移 + Entity — rules/references/guides
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
Phase 3 Task 21:
- ai_knowledge_rules: L1 规则表(条件表达式 + 动作文本)
- ai_knowledge_references: L2 参考表(摘要 + pgvector 嵌入)
- ai_knowledge_guides: L3 指南表(全文 + pgvector 嵌入)
2026-05-05 15:55:20 +08:00
iven
2d2e1e191e feat(db): 添加 pgvector 扩展迁移 — 知识库向量检索基础
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
Phase 3 Task 20: CREATE EXTENSION IF NOT EXISTS vector
2026-05-05 15:52:12 +08:00
iven
75a70d2e46 feat(ai): 添加知识库 trait 和 DTO — KnowledgeSource/PatientSummary/Reference
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
Phase 3 Task 19: 定义统一知识获取接口,支持未来向量检索扩展
2026-05-05 15:50:57 +08:00
iven
54116d1a1f refactor(ai): auto_analysis 改为入队模式
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
高风险患者扫描结果构造 AnalysisJob 入队而非直接调用 Provider
保留定时扫描逻辑(每 24h),分析执行由队列消费者负责
2026-05-05 15:41:30 +08:00
iven
553de13cd5 feat(ai): 扩展事件订阅自动入队分析
订阅 health_data.critical_alert → 趋势分析 (priority=2)
订阅 lab_report.uploaded → 化验单解读 (priority=1)
订阅 dialysis.record.created → KDIGO 风险评估 (priority=2)
tokio::select! 多通道并发消费
2026-05-05 15:40:15 +08:00
iven
7fb92714c7 feat(ai): 实现 AnalysisQueue 服务
支持 enqueue/claim_next/mark_completed/mark_failed 状态机
失败自动重试(retry_count < max_retries → pending),queue_status 聚合查询
2026-05-05 15:38:14 +08:00
iven
3186c5aee9 feat(ai): 添加 ai_analysis_queue 迁移 + Entity
异步分析队列表,支持优先级/重试/状态机(pending→running→completed/failed)
索引覆盖租户状态查询和调度扫描,迁移号 000118
2026-05-05 15:35:59 +08:00
iven
c268229311 feat(ai): 实现 CacheService 两级缓存 + 集成到 AiState
Redis TTL (L1) + DB SHA-256 hash (L2),Redis 不可用时自动降级
CacheKey 基于 tenant_id + analysis_type + input_hash + prompt_version
AiState 新增 cache 字段,main.rs 注入共享 Redis Client
2026-05-05 15:33:58 +08:00
iven
50b9e8d683 feat(ai): 添加 Provider 管理 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
GET /ai/providers — 列出已注册提供商
GET /ai/providers/health — 各提供商健康状态
GET /ai/quota/summary — 租户配额使用摘要
2026-05-05 15:19:49 +08:00
iven
a16e86bf04 feat(ai): 重构 AiState 集成 ProviderRegistry + QuotaService
AiState 新增 provider_registry 和 quota 字段
main.rs 启动时按配置注册 Claude/OpenAI/Ollama Provider
支持多 Provider 并发注册和健康检查
2026-05-05 15:18:26 +08:00
iven
63ff8660fc feat(ai): 实现 QuotaService 租户配额检查
月度 Token 预算 + 每日患者分析次数限制,raw SQL 聚合查询
可全局开关 (quota_check_enabled),无配置时默认放行
2026-05-05 15:16:09 +08:00
iven
105cae0565 feat(ai): 添加 ai_tenant_configs 迁移 + Entity
支持租户级 Provider 路由配置、月度 Token 预算、每日患者限制
unique 索引确保每租户一条配置,迁移号 000117
2026-05-05 15:13:05 +08:00
iven
37acd34154 feat(ai): 实现 OllamaProvider 本地模型支持
使用 /api/chat 端点,无需 API Key,支持流式/非流式生成
健康检查通过 /api/tags,含 7 个单元测试
2026-05-05 15:10:43 +08:00
iven
b728618d61 feat(ai): 实现 OpenAIProvider 兼容 OpenAI API 格式
支持 /v1/chat/completions 端点的流式/非流式生成 + 健康检查
含序列化/反序列化单元测试
2026-05-05 15:08:41 +08:00
iven
74b1d44068 feat(ai): 实现 ProviderRegistry 并发安全多提供商注册与路由
DashMap 支持并发注册,resolve() 按首选→回退→任意可用顺序
实时健康检查,含 4 个单元测试覆盖正常/降级/全不可用场景
2026-05-05 15:07:19 +08:00
iven
24bb8e7bca feat(ai): 扩展 AiError 支持配额/缓存/知识库/队列/配置错误变体
新增 QuotaExhausted→429, CacheError/KnowledgeError/QueueError/ConfigError→500
2026-05-05 15:02:38 +08:00
iven
4d02b2b531 feat(ai): 扩展 AiConfig 支持多 Provider 配置
- config/default.toml 新增 providers 子段(claude/openai/ollama)
- erp-server/config.rs AiConfig 新增 quota_check_enabled + providers HashMap
- erp-ai/config.rs 新增 ProviderType 枚举 + ProviderConfig 结构体
2026-05-05 15:01:24 +08:00
iven
93f6e87220 fix(web+config): E2E 测试发现的问题修复
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
- 排班状态过滤 'active' → 'enabled'(与后端 validation.rs 一致)
- 全局 403 拦截器不再弹出"权限不足" toast(AuthButton 已隐藏入口)
- 角色未关联菜单时回退显示全部(避免种子数据阶段菜单空白)
2026-05-05 13:01:14 +08:00
iven
84b671d1e5 fix(server+health): 修复路由 middleware 泄漏 — FHIR/Gateway 改用 .nest() 隔离
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
Axum 的 .merge() 会将子 Router 的 middleware 泄漏到整个路由树,
导致 FHIR OAuth middleware 和 Gateway auth middleware 拦截所有请求。

修复方式:
- fhir_routes 内部路径去掉 /fhir 前缀,main.rs 用 .nest("/fhir", ...) 注册
- gateway_routes 内部路径去掉 /health/gateway 前缀,main.rs 用 .nest("/health/gateway", ...) 注册
- 透析患者查询表名 patients → patient(与 Entity 一致)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 11:56:42 +08:00
iven
062b4493e4 fix(web): DoctorSelect 预加载医生列表 + 搜索错误处理
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
- 组件挂载时预加载最多 50 条医生数据,下拉框打开即有选项
- 搜索清空时保留已有列表(不再置空)
- 搜索失败时 catch 错误,保留初始列表不静默丢失
- 更新质量验证报告:全部 MEDIUM 问题已关闭
2026-05-05 11:15:12 +08:00
iven
0f55d26076 fix(dialysis): 添加患者存在性校验 + 质量验证汇总
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
- create_dialysis_record 中添加患者存在性校验,修复集成测试
  test_dialysis_create_without_patient_returns_error
- 添加质量验证汇总报告 (docs/qa/quality-verification-summary.md)
2026-05-05 10:35:37 +08:00
iven
15b5781dbb fix(health): 危急值告警全链路修复 — 消费者生命周期 + payload 映射 + 阈值优先级
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
1. CRITICAL: 修复 SubscriptionHandle 提前 drop 导致所有事件消费者失效
   - register_handlers_with_state 中所有 handle 在函数返回时被 drop
   - cancel channel 关闭导致 subscribe_filtered 的过滤任务退出
   - 方案: 收集所有 handle 并 std::mem::forget,生命周期与进程一致

2. HIGH: 修复 critical_alert 消费者 payload 字段映射不匹配
   - 消费者读取 alert_type/metric_name 等顶层字段,但实际在 alert 嵌套对象中
   - 更新消费者从 alert 对象提取 indicator/value/threshold/level
   - handle_critical_alert_event 增加 severity 参数

3. MEDIUM: 修复 check_indicator 优先匹配最高严重级别
   - 原实现返回第一个匹配的阈值(可能匹配 warning 而非 critical)
   - 改为遍历所有匹配阈值,选择 severity 最高的(critical > warning)

4. MEDIUM: 修复危急值阈值页面不自动加载数据
   - CriticalValueThresholdList 添加 useEffect 初始化加载
2026-05-05 10:11:06 +08:00
iven
2acd9485c7 fix(health+dialysis): S2 smoke test 修复 — Entity 表名 + 透析状态转换
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
- 修复 6 个 Entity table_name 与迁移不匹配: shift, handoff_log,
  patient_assignment, blind_index, critical_alert, critical_alert_response
- 添加透析记录 draft→completed 状态转换 API (PUT /complete)
- 修复 family_proxy_service 告警状态过滤 (active→pending/acknowledged)
- dev.ps1 添加 RATE_LIMIT__FAIL_CLOSE=false 开发模式
- S2 透析日流程 smoke test 报告
2026-05-05 03:07:41 +08:00
iven
99dad17eac fix(server+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
- sync_module_permissions 每次启动都确保 admin 拥有所有权限(修复 CRITICAL-001)
- 新增迁移 m20260505_000116: 补充 11 项缺失的健康管理菜单(多租户安全)
- 修复 000101: UUID 格式错误(缺少第 4 段)
- 修复 000104/000106/000107: Expr::val → Expr::cust(SQL 函数不应被引号包裹)
- 修复 000109: 外键创建改为 IF NOT EXISTS 模式
- 修复 000110: 表名 critical_alerts → critical_alert(匹配实际表名)
- 修复 000111/000112: create_table + create_index 添加 if_not_exists()
- 修复 000113: 改为 raw SQL 幂等模式,修正 FK 目标表名 patients → patient
2026-05-05 02:02:45 +08:00
iven
bef2ea7169 feat(miniprogram): 适老化修复 — Phase 2e
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
M6: 创建 utils/date.ts 统一日期工具函数(formatDate/formatDateTime/toRelativeDate 等)
M8: 28 个 SCSS 文件 font-size 20px → 22px 全量适老化
M7: request.ts 增加 403 权限不足/5xx 服务器错误/网络超时异常统一拦截
2026-05-05 00:22:49 +08:00
iven
8d288cadfa fix(health+ai): 后端质量修复 — Phase 2d
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
H3: 设备数据摄入增加 tracing 日志(事务保护待 ConnectionTrait 重构)
M4: care_plan/shift/ble_gateway/vital_signs_daily 补全 tracing 入口日志
M1: AI 分析缓存命中检查 + 缓存结果 Stream 回放
H4: 透析→KDIGO 自动串联(dialysis_notifier 发布 ai.dialysis.kdigo_requested 事件)
2026-05-05 00:19:22 +08:00
iven
888fa108ef feat(web): 家庭健康代理 + 知情同意 Web UI — Phase 2c
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
家庭代理:关联患者列表 + 健康摘要查看 + 授权/撤销访问
知情同意:患者范围 CRUD 列表页(类型/范围/签署/撤销)
2026-05-05 00:02:39 +08:00
iven
0774dd75ad feat(web): 危急值阈值 + 诊断记录 Web UI — Phase 2b-2/2b-3
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
危急值阈值:CRUD 列表页(指标/方向/阈值/级别/科室/年龄范围)
诊断记录:患者范围 CRUD 列表页(ICD编码/类型/状态/确诊日期)
2026-05-04 23:59:22 +08:00
iven
b6838c1bc1 feat(web): BLE 网关管理 UI — Phase 2b-1
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
网关 CRUD 列表页(状态筛选/密钥刷新/API Key 创建展示)
+ 网关详情页(信息面板/设备绑定管理 Tab)
2026-05-04 23:47:21 +08:00
iven
438f9ca3f4 feat(web): 药物记录 Web UI — Phase 2a-3
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
新增药物记录管理前端页面,接入后端 4 条孤立路由:
- API 模块: medicationRecords.ts(CRUD + 频次/途径常量)
- 列表页: MedicationRecordList.tsx(患者 ID 查询 + 药物列表 CRUD)
  支持药品名/通用名/剂量/频次/途径/日期/在用状态
- 路由注册: /health/medications

权限: health.medication-records.list / health.medication-records.manage
2026-05-04 23:41:04 +08:00
iven
68ced2bae9 feat(web): 班次管理 Web UI — Phase 2a-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
新增班次管理前端页面,接入后端 12 条孤立路由:
- API 模块: shifts.ts(班次 CRUD + 患者分配 + 批量分配 + 交接日志)
- 列表页: ShiftList.tsx(日期/班次/状态筛选 + 统计概览)
- 详情页: ShiftDetail.tsx(班次信息 + 患者分配 Tab + 交接记录 Tab)
- 路由注册: /health/shifts + /health/shifts/:id

权限: health.shifts.list / health.shifts.manage
2026-05-04 23:36:15 +08:00
iven
3aa436f872 feat(web): 护理计划 Web UI — Phase 2a-1
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 条孤立路由:
- API 模块: carePlans.ts(计划 + 干预项目 + 预后测量 CRUD)
- 列表页: CarePlanList.tsx(筛选/新建/编辑/删除/跳转详情)
- 详情页: CarePlanDetail.tsx(计划信息 + Items/Outcomes 双 Tab CRUD)
- 路由注册: /health/care-plans + /health/care-plans/:id
- 菜单标题: routeTitleFallback 映射

权限: health.care-plan.list / health.care-plan.manage
2026-05-04 23:26:28 +08:00
iven
2b90db4028 fix(health): P0 安全修复 — SQL注入 + FHIR越权 + OAuth权限 + JWT硬编码
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
C1: action_inbox_service.rs 中 patient_id/user_id 的 format! 拼接改为
    参数化查询 ($2/$3/$4/$5 绑定),消除 SQL 注入风险
C2: fhir/handler.rs 所有患者相关端点强制执行 allowed_patient_ids 范围
    过滤,search 端点用 is_in 过滤,get 端点用 enforce_patient_scope 校验
H5: oauth/handler.rs 5 个管理端点添加 require_permission 校验
M3: oauth/handler.rs 和 middleware.rs 移除 "dev-secret-key" fallback,
    缺少环境变量时启动失败(token)/返回 500(middleware)
2026-05-04 23:09:25 +08:00
iven
95fa09c383 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
Phase 1 Care Engine MVP 最后一项 (#8):
- 迁移: patient_family_member 表新增 user_id/consent_status/access_level/consented_at/consent_revoked_at
- 实体: 更新 patient_family_member Model 含新字段
- DTO: FamilyMemberResp 扩展 + 新增 GrantFamilyAccessReq/FamilyPatientSummaryResp/FamilyHealthSummaryResp
- Service: 授权/撤销访问、家庭成员查看关联患者列表、查看健康摘要(按 access_level 分级)
- Handler: 5 个端点(grant/revoke/list/summary/link-user)
- 路由: /health/patients/{id}/family-members/{fid}/grant-access 等
- 权限: health.family-proxy.list/manage
- 已有 CRUD 适配新字段(list/create/update 返回 consent 状态)
2026-05-04 20:57:24 +08:00
iven
0a9272bcf6 feat(dialysis+workflow): 透析会话 BPMN 工作流集成
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
- dialysis_record 新增 workflow_instance_id 列,关联工作流实例
- 种子 dialysis_session BPMN 流程定义:透前评估→上机确认→透中监测→透后评估→医生审核
- 事件驱动编排器:dialysis.record.created → 自动启动 BPMN 工作流
- 工作流启动后自动回写 instance_id 到透析记录
- 编排器在 erp-server 层实现(遵循星型依赖架构)
2026-05-04 20:38:56 +08:00
iven
7e57565ecd feat(health): BLE 网关后端接入 — 网关管理 + API Key 认证 + 多患者批量上报
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
- 新增 ble_gateways + gateway_patient_bindings 表迁移 (000113)
- 网关 CRUD:注册/编辑/删除/重生成 API Key,含患者绑定管理
- API Key 认证中间件(SHA-256 hash + prefix 快速查找)
- 网关数据上报端点:多患者批量读数,复用 device_reading_service 管道
- 网关心跳端点:固件版本/IP 更新 + last_heartbeat_at
- 10 个管理端路由(JWT)+ 2 个网关端路由(API Key)
- health.ble-gateways.list/manage 权限声明
- 修复 000112 迁移 ForeignKey 借用错误
2026-05-04 20:28:26 +08:00
iven
7b17f94bc0 feat(health): 班次管理与护士分配 — Shift/PatientAssignment/HandoffLog CRUD
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
- 新增 3 张数据表迁移 (shifts, patient_assignments, shift_handoff_log)
- 3 个 SeaORM Entity (shift, patient_assignment, handoff_log)
- 完整 CRUD 服务层:班次管理、患者分配(含批量分配)、交接记录
- 12 个 API 端点 + health.shifts.list/manage 权限
- 班次列表含患者分配摘要 (patient_count/critical_count/attention_count)
- 乐观锁、软删除、审计日志、事件发布
- 输入验证:period/shift_status/care_level 白名单
2026-05-04 20:11:07 +08:00
iven
3ff17382ff feat(health+message): 关怀已送达通知管道 — care.action.performed 事件 + 温暖消息推送
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
- 新增 CARE_ACTION_PERFORMED 事件常量(care.action.performed)
- care_plan_service 在护理项完成、测量数据更新、干预项创建时发布关怀行动事件
- erp-message 新增 care_plan.activated/completed + care.action.performed 消息处理
- 温暖消息文案:护理计划启动/完成通知、关怀已送达、健康数据已更新
- 事件测试覆盖新常量、payload 契约、通知分支逻辑
2026-05-04 18:56:52 +08:00
iven
0a5290aee4 feat(ai): KDIGO 透析专用风险评分器 — Phase 1 关怀引擎 MVP 第二步
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
新增 DialysisRiskScorer:12 条 KDIGO 规则覆盖 Kt/V、血磷、血钾、血红蛋白、
体重增长、eGFR、白蛋白,含 KDIGO CKD G1-G5 分期。同步暴露
POST /ai/dialysis/risk-assessment 端点。76 个测试全部通过。
2026-05-04 18:44:22 +08:00
iven
ef422f354d feat(health): 护理计划实体与服务 — Phase 1 关怀引擎 MVP 第一步
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
新增护理计划(Care Plan)完整 CRUD:3 张表(care_plans / care_plan_items /
care_plan_outcomes)、3 个 SeaORM Entity、15 个 API 端点、4 个事件常量、
2 个权限码。支持透析/慢性/预防/康复计划类型,条目分干预/监测/目标/教育四类,
预后测量含基线/目标/当前值追踪。
2026-05-04 18:40:22 +08:00
iven
c35ea83799 test(web): 核心健康管理页面测试 — 12 个页面 51 个测试用例
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
新增测试覆盖:
- PatientDetail: 5 测试(渲染/标签页/数据展示)
- AlertDashboard: 5 测试(渲染/统计卡片/告警列表)
- AlertRuleList: 5 测试(渲染/规则表格/创建按钮)
- DeviceManage: 5 测试(渲染/设备列表/筛选)
- AiAnalysisList: 6 测试(渲染/分析记录/分页)
- AiUsageDashboard: 4 测试(渲染/统计/类型分布)
- ArticleManageList: 5 测试(渲染/文章表格/分类筛选)
- PointsProductList: 5 测试(渲染/商品表格/上下架)
- PointsRuleList: 4 测试(渲染/规则表格)
- PointsOrderList: 5 测试(渲染/订单表格/状态筛选)
- StatisticsDashboard: 2 测试(渲染/权限守卫)
- DoctorSchedule: 3 测试(渲染/排班日历/科室筛选)

测试基础设施:
- 8 个新 fixture 工厂(device/analysis/points/article/alert/schedule)
- 10 组新 MSW handlers
- 5 个新权限码(devices/dashboard/oauth/ai.usage)

前端测试:527/530 通过(3 个预存失败未受影响)
2026-05-04 18:02:55 +08:00
iven
f54fb336dc feat(web): 护士工作台 Phase 1 前端 — NurseWorkbench 组件
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
- 新增 NurseWorkbench 组件:问候行 + 统计卡片 + 班次患者 + 待办 + 右面板
- actionInbox API 客户端:新增 assigned_to_me/patient_id 参数 + myPatients 端点
- Home.tsx 护士角色路由到 NurseWorkbench(其他角色不受影响)
- 班次患者列表:显示今日分配给护士的患者 + 风险优先级色点
- 快捷操作面板:随访/体征/AI分析/咨询入口
- 今日进度条:完成百分比可视化
2026-05-04 17:48:50 +08:00
iven
a5b3396adc feat(health): 护士工作台 Phase 1 后端 — 用户范围过滤 + 班次患者端点
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
- ActionInboxQuery 新增 assigned_to_me 和 patient_id 过滤参数
- list_action_items 支持按 user_id 过滤随访任务段
- get_workbench_stats 支持用户范围随访统计
- 新增 get_nurse_patients: 今日分配给护士的患者列表
- 新增 GET /health/action-inbox/my-patients 端点
- handler 从 TenantContext 提取 user_id 实现无感过滤
2026-05-04 17:45:23 +08:00
iven
69c3de15f5 Merge branch 'worktree-agent-ae2e5c31258292fcf'
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-05-04 14:09:06 +08:00
iven
b235f67c31 refactor(health): 拆分 4 个千行 service 文件为子模块
points_service.rs (1863行) → points_service/ (mod + account + checkin + product + event)
patient_service.rs (1118行) → patient_service/ (mod + helper + crud + relation + tag)
health_data_service.rs (1056行) → health_data_service/ (mod + vital_signs + lab_report + health_record + alert)
stats_service.rs (1117行) → stats_service/ (mod + operations + health + personal + dashboard)

所有公开 API 通过 pub use 保持不变,handler 层无需修改。
cargo check: 0 error, 0 warning
cargo test: 232 passed, 0 failed
2026-05-04 14:09:02 +08:00