diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index e55631197..a8b548954 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -1442,7 +1442,22 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 是否是第一次转化的任务 /// public bool IsFirstChangeTask { get; set; } = false; - } + + /// + /// 融合的PTSeriesId + /// + public Guid? PTSeriesId { get; set; } + + /// + /// 融合的CTSeriesId + /// + public Guid? CTSeriesId { get; set; } + + /// + /// StudyId + /// + public Guid? OtherStudyId { get; set; } + } public class GetVisitReadingQuestionOutDto { diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 2427928c1..8c233c226 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -612,7 +612,22 @@ namespace IRaCIS.Application.Services result = result.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToList(); } - foreach (var item in result) + + var visitaskIds = result.Select(x => x.VisitTaskId).ToList(); + + var otherStudys = await _readingTableAnswerRowInfoRepository.Where(x => visitaskIds.Contains(x.VisitTaskId)) + .Where(x=>x.CTSeriesId!=null&&x.PTSeriesId!=null) + .Select(x => new + { + x.OtherStudyId, + x.CTSeriesId, + x.PTSeriesId, + x.VisitTaskId, + x.UpdateTime + }).ToListAsync(); + + + foreach (var item in result) { var clinicalDataList = await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto() { @@ -623,7 +638,15 @@ namespace IRaCIS.Application.Services }); item.IsExistsClinicalData = clinicalDataList.Count > 0; - } + var otherStudy = otherStudys.Where(x => x.VisitTaskId == item.VisitTaskId).OrderByDescending(x => x.UpdateTime).FirstOrDefault(); + if (otherStudy != null) + { + item.PTSeriesId = otherStudy.PTSeriesId; + item.CTSeriesId = otherStudy.CTSeriesId; + item.OtherStudyId = otherStudy.OtherStudyId; + } + + }