From a8b218ce95c076fd3c48b69e733435f5ff966422 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 17 May 2024 14:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E5=B8=A7=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImageAndDoc/DTO/DicomSeriesModel.cs | 2 +- .../Service/ImageAndDoc/SeriesService.cs | 37 ++++++------------- IRaCIS.Core.Domain/Visit/Subject.cs | 3 +- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs index c208c2a8d..86729714d 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs @@ -34,7 +34,7 @@ public bool IsReading { get; set; } = true; - public List InstanceInfoList { get; set; } + public List InstanceInfoList { get; set; }=new List(); public bool IsExistMutiFrames => InstanceInfoList.Any(t => t.NumberOfFrames > 1); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index c9247660c..16ac76e9e 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -39,36 +39,23 @@ namespace IRaCIS.Core.Application.Services ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - var idList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) + var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) - .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames,t.InstanceNumber }).ToListAsync();//.GroupBy(u => u.SeriesId); + .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames,t.InstanceNumber,t.HtmlPath }).ToListAsync();//.GroupBy(u => u.SeriesId); - foreach (var item in seriesList) + foreach (var series in seriesList) { - item.InstanceList = idList.Where(s => s.SeriesId == item.Id).Select(u => u.Id).ToList(); - //处理多帧 - item.InstancePathList = idList.Where(s => s.SeriesId == item.Id).OrderBy(t => t.InstanceNumber) - .SelectMany(u => - { + series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => + new InstanceBasicInfo() + { + Id = k.Id, + NumberOfFrames = k.NumberOfFrames, + HtmlPath = k.HtmlPath, + Path = k.Path, + InstanceNumber = k.InstanceNumber, - if (u.NumberOfFrames > 1) - { - var pathList = new List(); - - for (int i = 1; i <= u.NumberOfFrames; i++) - { - pathList.Add(u.Path + "?frame=" + (i - 1)); - } - return pathList; - } - else - { - return new List { u.Path }; - - } - }) - .ToList(); + }).ToList(); } #region 暂时废弃 diff --git a/IRaCIS.Core.Domain/Visit/Subject.cs b/IRaCIS.Core.Domain/Visit/Subject.cs index fa8a7c166..dbf5cedf5 100644 --- a/IRaCIS.Core.Domain/Visit/Subject.cs +++ b/IRaCIS.Core.Domain/Visit/Subject.cs @@ -12,7 +12,8 @@ namespace IRaCIS.Core.Domain.Models [Table("Subject")] public class Subject : Entity, IAuditAdd, IAuditUpdate, ISoftDelete { - + [JsonIgnore] + public List TaskStudyList { get; set; } = new List(); [JsonIgnore] public List SubjectVisitList { get; set; } = new List();