feat(health): 家庭成员健康代理 — 同意追踪 + 健康摘要查看
Phase 1 Care Engine MVP 最后一项 (#8): - 迁移: patient_family_member 表新增 user_id/consent_status/access_level/consented_at/consent_revoked_at - 实体: 更新 patient_family_member Model 含新字段 - DTO: FamilyMemberResp 扩展 + 新增 GrantFamilyAccessReq/FamilyPatientSummaryResp/FamilyHealthSummaryResp - Service: 授权/撤销访问、家庭成员查看关联患者列表、查看健康摘要(按 access_level 分级) - Handler: 5 个端点(grant/revoke/list/summary/link-user) - 路由: /health/patients/{id}/family-members/{fid}/grant-access 等 - 权限: health.family-proxy.list/manage - 已有 CRUD 适配新字段(list/create/update 返回 consent 状态)
This commit is contained in:
@@ -18,6 +18,17 @@ pub struct Model {
|
||||
pub birth_date: Option<chrono::NaiveDate>,
|
||||
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||
pub notes: Option<String>,
|
||||
/// 关联系统用户(家庭成员绑定账号后可登录查看)
|
||||
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||
pub user_id: Option<Uuid>,
|
||||
/// none / pending / granted / revoked
|
||||
pub consent_status: String,
|
||||
/// none / summary / full / limited
|
||||
pub access_level: String,
|
||||
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||
pub consented_at: Option<DateTimeUtc>,
|
||||
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||
pub consent_revoked_at: Option<DateTimeUtc>,
|
||||
pub created_at: DateTimeUtc,
|
||||
pub updated_at: DateTimeUtc,
|
||||
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||
|
||||
Reference in New Issue
Block a user