From 3a65046c4835d15cf0f6efd573a5c3d2822fc47c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 21 Aug 2025 13:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E9=A2=98=E7=BB=84?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs | 2 +- IRaCIS.Core.Domain/Image/SCPStudy.cs | 3 +++ .../EntityConfigration/ImageConfigration.cs | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index 5d6765990..6c44d1ba3 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -1069,7 +1069,7 @@ namespace IRaCIS.Application.Contracts public List HospitalGroupList { get; set; } - public List CurrentUserHospitalGroupList { get; set; } + public List CurrentUserHospitalGroupList { get; set; } = new List(); public List ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList(); diff --git a/IRaCIS.Core.Domain/Image/SCPStudy.cs b/IRaCIS.Core.Domain/Image/SCPStudy.cs index ad69ac672..59a352c51 100644 --- a/IRaCIS.Core.Domain/Image/SCPStudy.cs +++ b/IRaCIS.Core.Domain/Image/SCPStudy.cs @@ -80,8 +80,11 @@ public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId public class SCPStudyHospitalGroup : BaseFullAuditEntity { #region MyRegion + [ForeignKey("HospitalGroupId")] [JsonIgnore] public HospitalGroup HospitalGroup { get; set; } + + [ForeignKey("SCPStudyId")] [JsonIgnore] public SCPStudy SCPStudy { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs index 1d3a4a86d..fc1cb27cf 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs @@ -91,6 +91,8 @@ public class SCPStudyConfigration : IEntityTypeConfiguration builder.HasMany(s => s.InstanceList).WithOne(se => se.SCPStudy).HasForeignKey(se => se.StudyId).HasPrincipalKey(st => st.Id); + builder.HasMany(s => s.HospitalGroupList).WithOne(se => se.SCPStudy).HasForeignKey(se => se.SCPStudyId).HasPrincipalKey(st => st.Id); + } }