From 51c41acfa7002ed87d546c7ca607701b409329c1 Mon Sep 17 00:00:00 2001 From: iven Date: Wed, 6 May 2026 10:21:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(health):=20=E5=AE=A1=E8=AE=A1=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=8A=A0=E5=AF=86=E5=AD=97=E6=AE=B5=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=20REDACTED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp-health/src/service/patient_service/crud.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/erp-health/src/service/patient_service/crud.rs b/crates/erp-health/src/service/patient_service/crud.rs index 3863a76..6706f70 100644 --- a/crates/erp-health/src/service/patient_service/crud.rs +++ b/crates/erp-health/src/service/patient_service/crud.rs @@ -283,10 +283,10 @@ pub async fn update_patient( ])?; } - // 记录变更前的关键临床值(过敏史、病史、身份证号) + // 记录变更前的关键临床值(加密字段用 REDACTED 替代) let old_snapshot = serde_json::json!({ - "allergy_history": model.allergy_history, - "medical_history_summary": model.medical_history_summary, + "allergy_history": model.allergy_history.as_ref().map(|_| "[REDACTED]"), + "medical_history_summary": model.medical_history_summary.as_ref().map(|_| "[REDACTED]"), "status": model.status, "verification_status": model.verification_status, }); @@ -329,10 +329,10 @@ pub async fn update_patient( let updated = active.update(&state.db).await?; - // 变更后快照 + // 变更后快照(加密字段用 REDACTED 替代) let new_snapshot = serde_json::json!({ - "allergy_history": updated.allergy_history, - "medical_history_summary": updated.medical_history_summary, + "allergy_history": updated.allergy_history.as_ref().map(|_| "[REDACTED]"), + "medical_history_summary": updated.medical_history_summary.as_ref().map(|_| "[REDACTED]"), "status": updated.status, "verification_status": updated.verification_status, });