feat(ai): 实现 AI 数据桥接 — 4 个 HealthDataProvider 方法从 stub 替换为真实查询
- 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:
@@ -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>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user