From d21632dbefbff7f0cebfb96ccde01c8d15c967e8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 3 Mar 2023 17:11:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=B4=E5=BA=8A=E6=95=B0?= =?UTF-8?q?=E6=8D=AENA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/AuditingData.cs | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 905af45ab..05ea90c17 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1691,6 +1691,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as ReadingClinicalData; + var config= await _dbContext.ClinicalDataTrialSet.FindAsync(entity.ClinicalDataTrialSetId); + await InsertInspection(item.Entity as ReadingClinicalData, type, x => new InspectionConvertDTO() { @@ -1701,7 +1703,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId = entity.ClinicalDataTrialSetId, //ObjectRelationParentId2 = x.IsVisit == false?x.ReadingId:null - }); ; + },new {FileCountViewStr= config?.ClinicalDataLevel==ClinicalLevel.Subject && config?.ClinicalUploadType==ClinicalUploadType.Table?"NA": entity.FileCount.ToString() }); } //阅片期计划 @@ -2622,8 +2624,23 @@ namespace IRaCIS.Core.Infra.EFCore.Common { var info = await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { SubjectId = x.Id, x.SiteId, x.TrialId, SubjectCode = x.Code, TrialSiteCode = x.TrialSite.TrialSiteCode }).FirstOrDefaultAsync(); - generalData.TrialId = info?.TrialId ?? generalData.TrialId; - generalData.SiteId = info?.SiteId ?? generalData.SiteId; + if (info == null) + { + var subject= _dbContext.Subject.Find(generalData.SubjectId); + + generalData.TrialId = subject?.TrialId; + generalData.SiteId = subject?.SiteId; + } + else + { + generalData.TrialId = info?.TrialId ?? generalData.TrialId; + generalData.SiteId = info?.SiteId ?? generalData.SiteId; + } + + + + + //以后移除 generalData.SiteCode = info?.TrialSiteCode ?? generalData.SiteCode;