feat(health): 透析方案管理 CRUD — dialysis_prescription 全栈
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

新增透析方案实体和完整 CRUD:
- Entity: 20 字段含抗凝/血管通路/透析参数
- DTO: f64 类型适配 utoipa ToSchema
- Service: 抗凝类型 + 血管通路类型校验
- Handler: 5 端点 + RBAC 权限控制
- 路由: /api/v1/health/dialysis-prescriptions
This commit is contained in:
iven
2026-04-27 14:26:41 +08:00
parent 19cb2bf8bf
commit ca96310a84
10 changed files with 597 additions and 2 deletions

View File

@@ -74,6 +74,9 @@ pub enum HealthError {
#[error("告警记录不存在")]
AlertNotFound,
#[error("透析方案不存在")]
DialysisPrescriptionNotFound,
#[error("状态转换无效: {0}")]
InvalidStatusTransition(String),
@@ -109,7 +112,8 @@ impl From<HealthError> for AppError {
| HealthError::ThresholdNotFound
| HealthError::ConsentNotFound
| HealthError::AlertRuleNotFound
| HealthError::AlertNotFound => AppError::NotFound(err.to_string()),
| HealthError::AlertNotFound
| HealthError::DialysisPrescriptionNotFound => AppError::NotFound(err.to_string()),
HealthError::ScheduleFull => AppError::Validation(err.to_string()),
HealthError::InvalidStatusTransition(s) => AppError::Validation(s),
HealthError::VersionMismatch => AppError::VersionMismatch,