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, });