feat(health): 护理计划实体与服务 — Phase 1 关怀引擎 MVP 第一步
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

新增护理计划(Care Plan)完整 CRUD:3 张表(care_plans / care_plan_items /
care_plan_outcomes)、3 个 SeaORM Entity、15 个 API 端点、4 个事件常量、
2 个权限码。支持透析/慢性/预防/康复计划类型,条目分干预/监测/目标/教育四类,
预后测量含基线/目标/当前值追踪。
This commit is contained in:
iven
2026-05-04 18:40:22 +08:00
parent c35ea83799
commit ef422f354d
16 changed files with 1662 additions and 2 deletions

View File

@@ -83,6 +83,15 @@ pub enum HealthError {
#[error("药物提醒不存在")]
MedicationReminderNotFound,
#[error("护理计划不存在")]
CarePlanNotFound,
#[error("护理计划条目不存在")]
CarePlanItemNotFound,
#[error("护理计划预后不存在")]
CarePlanOutcomeNotFound,
#[error("状态转换无效: {0}")]
InvalidStatusTransition(String),
@@ -121,7 +130,10 @@ impl From<HealthError> for AppError {
| HealthError::AlertNotFound
| HealthError::FollowUpTemplateNotFound
| HealthError::CriticalAlertNotFound
| HealthError::MedicationReminderNotFound => AppError::NotFound(err.to_string()),
| HealthError::MedicationReminderNotFound
| HealthError::CarePlanNotFound
| HealthError::CarePlanItemNotFound
| HealthError::CarePlanOutcomeNotFound => AppError::NotFound(err.to_string()),
HealthError::ScheduleFull => AppError::Validation(err.to_string()),
HealthError::InvalidStatusTransition(s) => AppError::Validation(s),
HealthError::VersionMismatch => AppError::VersionMismatch,