- 管理员订单列表:新增 admin_list_orders 不按 patient_id 过滤 - 分配医生:添加 doctor_profile 存在性验证防止孤立关联 - 标签管理:将软删除+插入包裹在事务中防止标签丢失 - HealthDataProvider:标记为 experimental,改进错误消息 - 预约 CAS:添加注释说明匹配字段与唯一索引的关系 - 小程序 DTO:inputVitalSign 映射 indicator_type 到结构化字段 - 小程序数据隔离:listAppointments/listTasks 添加 patient_id 参数 - 小程序字段名:family-add 修复 birthday → birth_date
62 lines
1.7 KiB
Rust
62 lines
1.7 KiB
Rust
use async_trait::async_trait;
|
||
use erp_core::error::{AppError, AppResult};
|
||
use erp_core::health_provider::{
|
||
HealthDataProvider, HealthReportDto, LabReportDto, PatientSummaryDto, TimeRange, VitalSignDto,
|
||
};
|
||
use uuid::Uuid;
|
||
|
||
/// # Experimental
|
||
///
|
||
/// 此实现为渐进式开发中的 stub。所有方法当前返回 "尚未实现" 错误。
|
||
/// 调用方不应在生产路径中依赖此实现。等 AI 集成需求明确后将渐进实现各方法。
|
||
/// 参见: docs/superpowers/specs/2026-04-25-notification-realtime-architecture-design.md Phase E
|
||
pub struct HealthDataProviderImpl {
|
||
pub db: sea_orm::DatabaseConnection,
|
||
}
|
||
|
||
macro_rules! stub_unimplemented {
|
||
($method:ident) => {
|
||
Err(AppError::Internal(format!(
|
||
"HealthDataProvider::{} 尚未实现 — 此 trait 为 experimental,不应在生产路径中调用",
|
||
stringify!($method),
|
||
)))
|
||
};
|
||
}
|
||
|
||
#[async_trait]
|
||
impl HealthDataProvider for HealthDataProviderImpl {
|
||
async fn get_lab_report(
|
||
&self,
|
||
_tenant_id: Uuid,
|
||
_report_id: Uuid,
|
||
) -> AppResult<LabReportDto> {
|
||
stub_unimplemented!(get_lab_report)
|
||
}
|
||
|
||
async fn get_vital_signs(
|
||
&self,
|
||
_tenant_id: Uuid,
|
||
_patient_id: Uuid,
|
||
_metrics: &[String],
|
||
_range: &TimeRange,
|
||
) -> AppResult<Vec<VitalSignDto>> {
|
||
stub_unimplemented!(get_vital_signs)
|
||
}
|
||
|
||
async fn get_patient_summary(
|
||
&self,
|
||
_tenant_id: Uuid,
|
||
_patient_id: Uuid,
|
||
) -> AppResult<PatientSummaryDto> {
|
||
stub_unimplemented!(get_patient_summary)
|
||
}
|
||
|
||
async fn get_full_report(
|
||
&self,
|
||
_tenant_id: Uuid,
|
||
_report_id: Uuid,
|
||
) -> AppResult<HealthReportDto> {
|
||
stub_unimplemented!(get_full_report)
|
||
}
|
||
}
|