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 真实数据流
This commit is contained in:
iven
2026-04-28 19:08:38 +08:00
parent ace04ee56d
commit 0aab27295c
4 changed files with 419 additions and 77 deletions

View File

@@ -1,6 +1,7 @@
use std::sync::Arc;
use erp_core::events::EventBus;
use erp_core::health_provider::HealthDataProvider;
use sea_orm::DatabaseConnection;
use crate::service::analysis::AnalysisService;
@@ -14,4 +15,5 @@ pub struct AiState {
pub analysis: Arc<AnalysisService>,
pub prompt: Arc<PromptService>,
pub usage: Arc<UsageService>,
pub health_provider: Arc<dyn HealthDataProvider>,
}