iven
|
4a95a83d6b
|
fix(miniprogram): 统一状态色映射,对齐设计系统色板
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
- 创建 utils/statusTag.ts 共享状态色工具(对齐 variables.scss)
- doctor/consultation: 使用共享状态色替代 Tailwind 硬编码
- doctor/followup: 使用共享状态色替代 Tailwind 硬编码
- doctor/action-inbox: SCSS 状态点替换为设计系统变量
- doctor/index: SCSS 告警/搜索区替换为设计系统变量
- pkg-health/alerts: SCSS 严重度标签替换为设计系统变量
|
2026-05-06 10:59:13 +08:00 |
|
iven
|
36275eb307
|
fix(web): 冻结推迟模块路由守卫
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-06 10:34:55 +08:00 |
|
iven
|
263bba264a
|
chore(db): 冻结推迟模块菜单迁移
|
2026-05-06 10:30:58 +08:00 |
|
iven
|
f7bf5a86ea
|
fix(server): CORS 生产环境拒绝通配符
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-06 10:21:50 +08:00 |
|
iven
|
d9818c263e
|
fix(ai): AI 提示词模板添加安全检查
|
2026-05-06 10:21:35 +08:00 |
|
iven
|
c452ae81d1
|
fix(health): OAuth JWT 配置缺失返回错误而非 panic
|
2026-05-06 10:21:25 +08:00 |
|
iven
|
a1cbb9fb1d
|
fix(server): readiness_check 隐藏内部错误详情
|
2026-05-06 10:21:13 +08:00 |
|
iven
|
a78ee2f154
|
fix(auth): Token 验证和撤销添加租户隔离
|
2026-05-06 10:21:07 +08:00 |
|
iven
|
51c41acfa7
|
fix(health): 审计日志加密字段替换为 REDACTED
|
2026-05-06 10:21:02 +08:00 |
|
iven
|
f668e64266
|
fix(health): FHIR converter 身份证号脱敏处理
|
2026-05-06 10:20:50 +08:00 |
|
iven
|
ced93934f1
|
fix(docker): 添加安全警告注释,补全 .env.example
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
|
2026-05-05 23:45:27 +08:00 |
|
iven
|
482871301e
|
fix(health): FHIR $everything 子查询添加 tenant_id 过滤
|
2026-05-05 23:44:25 +08:00 |
|
iven
|
087e23e57b
|
fix(ai): AI 分析队列 claim_next 添加租户隔离
|
2026-05-05 23:43:11 +08:00 |
|
iven
|
741aaf0e40
|
fix(health): FHIR allowed_patient_ids=None 拒绝所有访问
|
2026-05-05 23:42:29 +08:00 |
|
iven
|
4f84c94a42
|
docs(wiki): 添加 Ollama 配置文档和 AI 分析故障排除
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
- infrastructure.md: 新增 Ollama 服务连接、环境变量、GPU 注意事项
- index.md: 症状导航新增 qwen3 thinking、Ollama 内存/安全、模板渲染等问题
|
2026-05-05 22:56:30 +08:00 |
|
iven
|
b1a96ace1f
|
fix(ai): 修复 qwen3 模型 thinking 模式导致 AI 分析输出为空
CI / security-audit (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
qwen3:4b 默认启用 thinking 模式,流式 API 中 content 字段始终为空,
所有 token 消耗在 thinking 上。修复方案:
- 对 qwen3 模型改用非流式 API,从 content 中剥离 <think... 块
- 将清理后的内容按句子/段落分块模拟流式输出
- 自动提升 qwen3 的 num_predict 至 4096 确保 thinking + 回复完整
- 流式解析中跳过空 content chunk
- 新增 strip_think_block 函数及 5 个单元测试
|
2026-05-05 22:55:20 +08:00 |
|
iven
|
e9cfbd108a
|
fix(ai): 修复 AI 分析读取化验报告 items 为空的问题
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
- parse_lab_items 兼容两种存储格式(item_name/name, string/f64 value,
reference_range/reference_low+high)
- get_lab_report 添加 PII 解密步骤:数据库中 items 是加密存储的,
AI 分析前需要先解密再解析
- HealthDataProviderImpl 添加 PiiCrypto 字段用于解密
- pii_crypto 创建提前到 AI state 构建之前
- default.toml rate_limit.fail_close 改为 false(开发环境)
|
2026-05-05 22:05:45 +08:00 |
|
iven
|
049d230bae
|
docs(wiki): 更新 erp-ai 模块 — Ollama 对接 + bug 修复记录
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
- index.md: 迁移 123 个, 提交 577 次, 新增 AI 分析症状导航 4 条
- erp-ai.md: 新增 §4 Ollama 本地模型对接、已知限制、已修复 bug
- erp-ai.md: 更新 SSE 流程图(预校验 + 缓存回放修复)
- erp-ai.md: 3 个管理前端页面已实现
|
2026-05-05 20:07:24 +08:00 |
|
iven
|
a62332f1c4
|
fix(ai): AI 分析预校验 + prompt 非对话化
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
- 四个 SSE 端点增加数据完整性校验:items/sections 为空时返回 400
- 迁移 000123 更新全部 prompt system_prompt:明确非对话、输出结构化结果
- 前端用户看到的是分析结论,不再收到"请补充数据"的对话式回复
|
2026-05-05 19:53:04 +08:00 |
|
iven
|
1f91dcc5cc
|
fix(ai): 修复分析结果 JSON 嵌套 bug
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
- replay_cached 直接回放纯文本,不再包装 JSON 壳
- complete_analysis 跳过已完成的记录,防止缓存命中时覆写
- 前端 AnalysisContent 增加 extractPlainText 递归解析 JSON
|
2026-05-05 19:45:36 +08:00 |
|
iven
|
8a0c9670e6
|
feat(ai): 对接本地 Ollama qwen3:4b 模型
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 端点
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
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 自动注入临床规则
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 知识库查询
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
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 扩展迁移 — 知识库向量检索基础
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
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 改为入队模式
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 端点
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 测试发现的问题修复
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() 隔离
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 预加载医生列表 + 搜索错误处理
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): 添加患者存在性校验 + 质量验证汇总
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 映射 + 阈值优先级
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 表名 + 透析状态转换
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): 修复权限同步 + 迁移幂等性 + 缺失菜单种子数据
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
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 |
|