From 482871301e5c8c519b25da58018263974689ec02 Mon Sep 17 00:00:00 2001 From: iven Date: Tue, 5 May 2026 23:44:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(health):=20FHIR=20$everything=20=E5=AD=90?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0=20tenant=5Fid=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/erp-health/src/fhir/handler.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/erp-health/src/fhir/handler.rs b/crates/erp-health/src/fhir/handler.rs index 6cbf507..eff7ae0 100644 --- a/crates/erp-health/src/fhir/handler.rs +++ b/crates/erp-health/src/fhir/handler.rs @@ -687,6 +687,7 @@ pub async fn patient_everything( // 2. Observations(设备读数) let readings = crate::entity::device_readings::Entity::find() .filter(crate::entity::device_readings::Column::PatientId.eq(id)) + .filter(crate::entity::device_readings::Column::TenantId.eq(ctx.tenant_id)) .filter(crate::entity::device_readings::Column::DeletedAt.is_null()) .limit(200) .all(&state.db) @@ -700,6 +701,7 @@ pub async fn patient_everything( // 3. Devices let devices = crate::entity::patient_devices::Entity::find() .filter(crate::entity::patient_devices::Column::PatientId.eq(id)) + .filter(crate::entity::patient_devices::Column::TenantId.eq(ctx.tenant_id)) .filter(crate::entity::patient_devices::Column::DeletedAt.is_null()) .all(&state.db) .await?; @@ -710,6 +712,7 @@ pub async fn patient_everything( // 4. Encounters(咨询会话) let consultations = crate::entity::consultation_session::Entity::find() .filter(crate::entity::consultation_session::Column::PatientId.eq(id)) + .filter(crate::entity::consultation_session::Column::TenantId.eq(ctx.tenant_id)) .filter(crate::entity::consultation_session::Column::DeletedAt.is_null()) .all(&state.db) .await?; @@ -720,6 +723,7 @@ pub async fn patient_everything( // 5. Appointments let appointments = crate::entity::appointment::Entity::find() .filter(crate::entity::appointment::Column::PatientId.eq(id)) + .filter(crate::entity::appointment::Column::TenantId.eq(ctx.tenant_id)) .filter(crate::entity::appointment::Column::DeletedAt.is_null()) .all(&state.db) .await?; @@ -730,6 +734,7 @@ pub async fn patient_everything( // 6. Tasks(随访任务) let tasks = crate::entity::follow_up_task::Entity::find() .filter(crate::entity::follow_up_task::Column::PatientId.eq(id)) + .filter(crate::entity::follow_up_task::Column::TenantId.eq(ctx.tenant_id)) .filter(crate::entity::follow_up_task::Column::DeletedAt.is_null()) .limit(50) .all(&state.db) @@ -741,6 +746,7 @@ pub async fn patient_everything( // 7. DiagnosticReports(化验报告) let reports = crate::entity::lab_report::Entity::find() .filter(crate::entity::lab_report::Column::PatientId.eq(id)) + .filter(crate::entity::lab_report::Column::TenantId.eq(ctx.tenant_id)) .filter(crate::entity::lab_report::Column::DeletedAt.is_null()) .limit(50) .all(&state.db)