feat(ai): KDIGO 透析专用风险评分器 — Phase 1 关怀引擎 MVP 第二步
新增 DialysisRiskScorer:12 条 KDIGO 规则覆盖 Kt/V、血磷、血钾、血红蛋白、 体重增长、eGFR、白蛋白,含 KDIGO CKD G1-G5 分期。同步暴露 POST /ai/dialysis/risk-assessment 端点。76 个测试全部通过。
This commit is contained in:
@@ -487,6 +487,22 @@ where
|
||||
Ok(Json(ApiResponse::ok(result)))
|
||||
}
|
||||
|
||||
// === 透析风险评估(KDIGO 规则) ===
|
||||
|
||||
pub async fn assess_dialysis_risk<S>(
|
||||
Extension(ctx): Extension<TenantContext>,
|
||||
Json(body): Json<crate::service::dialysis_risk_scorer::DialysisLabInput>,
|
||||
) -> Result<Json<ApiResponse<crate::service::dialysis_risk_scorer::DialysisRiskAssessment>>, erp_core::error::AppError>
|
||||
where
|
||||
AiState: FromRef<S>,
|
||||
S: Clone + Send + Sync + 'static,
|
||||
{
|
||||
require_permission(&ctx, "ai.analysis.manage")?;
|
||||
let scorer = crate::service::dialysis_risk_scorer::DialysisRiskScorer::new();
|
||||
let result = scorer.assess(&body);
|
||||
Ok(Json(ApiResponse::ok(result)))
|
||||
}
|
||||
|
||||
// === SSE 流构建辅助 ===
|
||||
|
||||
fn build_sse_stream(
|
||||
|
||||
Reference in New Issue
Block a user