From f6be3186e743db84e021e4c54434d189b2cdb317 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 22 Oct 2025 15:12:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9D=9EDicom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingImageTaskViewModel.cs | 2 + .../ReadingImageTaskService.cs | 41 ++++++++++++++++--- .../Service/Reading/_MapConfig.cs | 6 +++ 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index f6197429c..bbb267c68 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -972,6 +972,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 问题分类 /// public QuestionClassify? QuestionClassify { get; set; } + + public bool IsDicomReading { get; set; } = true; } public class GetReadingTableQuestionOutDto diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 7394a74c3..14b93c989 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1,4 +1,5 @@ using DocumentFormat.OpenXml; +using DocumentFormat.OpenXml.Drawing.Charts; using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; @@ -1309,14 +1310,44 @@ namespace IRaCIS.Core.Application.Service var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); + var tableQuestionMarkList=new List(); + if (inDto.IsDicomReading) + { + // 删除病灶不删除病灶标记 所以查询question的时候 已经删除的病灶对应的标记的信息要排除 + var rowids = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Select(x => x.Id).ToListAsync(); - // 删除病灶不删除病灶标记 所以查询question的时候 已经删除的病灶对应的标记的信息要排除 - var rowids = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Select(x => x.Id).ToListAsync(); + List rowidnull = rowids.Select(x => (Guid?)x).ToList(); - List rowidnull = rowids.Select(x => (Guid?)x).ToList(); + tableQuestionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId != null + ).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + } + else + { + var markList = await _readingNoneDicomMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId + ).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + var bingList= await _readingNoneDicomMarkBindingRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId) + .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + + tableQuestionMarkList = markList + .GroupJoin( + bingList, + l => l.MarkId, + r => r.MarkId, + (l, rs) => rs.DefaultIfEmpty() + .Select(r => + { + var info = l.Clone(); + info.QuestionId = r?.QuestionId; + info.TableQuestionId = r?.TableQuestionId; + info.RowId = r?.RowId; + return info; + })) + .SelectMany(g => g).ToList(); + + } - var tableQuestionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId&&x.QuestionId!=null - ).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); return (await GetReadingTableQuestion( new GetReadingTableQuestionOrAnswerInDto() diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 0ac0989db..cde092e49 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -124,6 +124,12 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.FristAddTaskId, u => u.MapFrom(s => s.FristAddTaskId!.Value)); CreateMap(); + + CreateMap() + .ForMember(d => d.PicturePath, u => u.MapFrom(s => s.Path)); + + CreateMap(); + CreateMap(); //CreateMap(); // CreateMap()