From ae14a8a530540e6b53e90229633116e4c55b10d3 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 15:52:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E4=B8=8D=E9=98=85=E7=89=87=E5=BD=B1=E5=83=8F=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 1f2645602..c5b9898bc 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -261,6 +261,8 @@ namespace IRaCIS.Core.Application.Services IsReading=k.IsReading, IsDeleted=k.IsDeleted, }).ToList(); + + series.InstanceCount=series.InstanceInfoList.Count; } ); From 8bdd9e29abf2de5841bd46bfd939e5384b604d1d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 16:13:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=85=E7=89=87?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=E5=BE=97instance=20=E5=BA=8F=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/SubjectVisitService.cs | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index c5b9898bc..907bb76f8 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -31,7 +31,7 @@ namespace IRaCIS.Core.Application.Services [HttpPost] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] [UnitOfWork] //[Authorize(Policy = IRaCISPolicy.CRC)] public async Task> AddOrUpdateSV(SubjectVisitCommand svCommand) @@ -161,7 +161,7 @@ namespace IRaCIS.Core.Application.Services [HttpPut("{trialId:guid}/{subjectVisitId:guid}/{isUrgent:bool}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] //[Authorize(Policy = IRaCISPolicy.PM_IQC)] public async Task SetSubjectVisitUrgent(Guid subjectVisitId, bool isUrgent) { @@ -173,7 +173,7 @@ namespace IRaCIS.Core.Application.Services [HttpDelete, Route("{trialId:guid}/{id:guid}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] //[Authorize(Policy = IRaCISPolicy.CRC)] public async Task DeleteSV(Guid id) { @@ -238,7 +238,7 @@ namespace IRaCIS.Core.Application.Services var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)) .WhereIf(isReading == 1, s => s.IsReading) - .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath,t.IsDeleted,t.IsReading }).ToListAsync(); + .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsDeleted, t.IsReading }).ToListAsync(); foreach (var t in studyList) { @@ -258,11 +258,11 @@ namespace IRaCIS.Core.Application.Services HtmlPath = k.HtmlPath, Path = k.Path, InstanceNumber = k.InstanceNumber, - IsReading=k.IsReading, - IsDeleted=k.IsDeleted, + IsReading = k.IsReading, + IsDeleted = k.IsDeleted, }).ToList(); - series.InstanceCount=series.InstanceInfoList.Count; + series.InstanceCount = series.InstanceInfoList.Count; } ); @@ -503,7 +503,7 @@ namespace IRaCIS.Core.Application.Services var studyIds = dicomStudyList.Select(t => t.StudyId).ToList(); var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId) && t.IsReading) - .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath,t.IsReading }).ToListAsync(); + .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.IsReading }).ToListAsync(); List seriesLists = await _dicomSeriesRepository.Where(s => studyIds.Contains(s.StudyId)) .WhereIf(isManualGenerate == false, t => t.IsReading) @@ -527,6 +527,9 @@ namespace IRaCIS.Core.Application.Services }).ToList(); + // 设置阅片 不阅片,数字要要重新统计 + series.InstanceCount = series.InstanceInfoList.Count; + //series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth; //series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter; }); @@ -612,7 +615,7 @@ namespace IRaCIS.Core.Application.Services item.InstanceInfoList.ForEach(x => { - var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0&&y.NumberOfFrames!=null).Select(y => y.NumberOfFrames).Distinct().ToList(); + var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0 && y.NumberOfFrames != null).Select(y => y.NumberOfFrames).Distinct().ToList(); if (keyFramesList.Count() > 0) { @@ -726,9 +729,18 @@ namespace IRaCIS.Core.Application.Services #endregion + #region 过滤空序列得检查 过滤空instance得序列 + + foreach (var study in studyList) + { + study.SeriesList = study.SeriesList.Where(t => t.InstanceCount > 0).ToList(); + } var result = studyList.Where(x => x.SeriesCount > 0).ToList(); + #endregion + + return result; @@ -743,7 +755,7 @@ namespace IRaCIS.Core.Application.Services /// /// [HttpPut("{trialId:guid}/{subjectVisitId:guid}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] [Obsolete] public async Task SetSVExecuted(Guid subjectVisitId) {