diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index d01799838..521715495 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) { @@ -258,11 +258,9 @@ 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; } ); @@ -503,7 +501,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 +525,9 @@ namespace IRaCIS.Core.Application.Services }).ToList(); + // 设置阅片 不阅片,数字要要重新统计 + series.InstanceCount = series.InstanceInfoList.Count; + //series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth; //series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter; }); @@ -612,7 +613,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 +727,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 +753,7 @@ namespace IRaCIS.Core.Application.Services /// /// [HttpPut("{trialId:guid}/{subjectVisitId:guid}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] [Obsolete] public async Task SetSVExecuted(Guid subjectVisitId) {