feat(health): 危急值告警消费者 — 幂等处理 + Handler + 路由
Some checks failed
CI / frontend-build (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- event.rs: 消费 health_data.critical_alert 事件创建告警记录
- handler: list/get/acknowledge 三个端点
- 路由: /health/critical-alerts, /health/critical-alerts/{id}/acknowledge
- 权限: health.critical-alert.list / health.critical-alert.manage
This commit is contained in:
iven
2026-04-28 11:43:32 +08:00
parent b7b09c0727
commit 1bece3d41f
4 changed files with 160 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ use erp_core::module::{ErpModule, PermissionDescriptor};
use crate::handler::{
alert_handler, alert_rule_handler,
appointment_handler, article_category_handler, article_handler, article_tag_handler, consultation_handler, consent_handler, critical_value_threshold_handler, daily_monitoring_handler, device_reading_handler, diagnosis_handler, dialysis_handler, dialysis_prescription_handler, doctor_handler, follow_up_handler, follow_up_template_handler,
appointment_handler, article_category_handler, article_handler, article_tag_handler, consultation_handler, consent_handler, critical_alert_handler, critical_value_threshold_handler, daily_monitoring_handler, device_reading_handler, diagnosis_handler, dialysis_handler, dialysis_prescription_handler, doctor_handler, follow_up_handler, follow_up_template_handler,
health_data_handler, medication_record_handler, patient_handler, points_handler, stats_handler,
};
@@ -635,6 +635,19 @@ impl HealthModule {
"/health/alerts/{id}/resolve",
axum::routing::put(alert_handler::resolve),
)
// 危急值告警路由
.route(
"/health/critical-alerts",
axum::routing::get(critical_alert_handler::list_critical_alerts),
)
.route(
"/health/critical-alerts/{id}",
axum::routing::get(critical_alert_handler::get_critical_alert),
)
.route(
"/health/critical-alerts/{id}/acknowledge",
axum::routing::post(critical_alert_handler::acknowledge_critical_alert),
)
.route(
"/health/alert-rules",
axum::routing::get(alert_rule_handler::list_rules)