From 22603038766156a164750da6c3d17d12601def07 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 23 Aug 2023 14:11:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingCalculateViewModel.cs | 10 ++++ .../LuganoCalculateService.cs | 55 ++++++++++++++++++ IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs | 58 ++++++++++++++++++- 3 files changed, 122 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs index a12d28ada..1cf028180 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs @@ -9,6 +9,16 @@ using System.Collections.Generic; namespace IRaCIS.Core.Application.Service.Reading.Dto { + public class GetPPDInfoInDto + { + public Guid VisitTaskId { get; set; } + + public Guid QuestionId { get; set; } + + public decimal RowIndex { get; set; } + + } + public class CalculateTaskInDto { public Guid VisitTaskId { get; set; } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index c87934ed2..d5babeb63 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -11,6 +11,7 @@ using Microsoft.Extensions.Caching.Memory; using IRaCIS.Core.Infrastructure; using MassTransit; +using System.Reflection.Metadata.Ecma335; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -351,7 +352,61 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate await ReadingCalculate(readingData,new List() { type}); } + /// + /// 获取最低PDD信息 + /// + /// + /// + [HttpPost] + public async Task GetLowPPDInfo(GetPPDInfoInDto inDto) + { + GetPPDInfoOutDto result = new GetPPDInfoOutDto(); + var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); + var visitTaskIds = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit && + x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId && + x.IsAnalysisCreate == taskinfo.IsAnalysisCreate && + x.DoctorUserId == taskinfo.DoctorUserId && + x.IsSelfAnalysis == taskinfo.IsSelfAnalysis && + x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == taskinfo.ArmEnum + && x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect + ).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).ToListAsync(); + var answerList = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId) + && x.QuestionId == inDto.QuestionId + && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD && x.RowIndex == inDto.RowIndex) + .Select(x => new + { + x.Answer, + x.VisitTaskId, + }).ToListAsync(); + + var lowPddTaskid = answerList.Select(x => new + { + Answer = x.Answer.IsNullOrEmptyReturn0(), + x.VisitTaskId + }).OrderBy(x => x.Answer).Select(x => x.VisitTaskId).FirstOrDefault(); + + if (lowPddTaskid != null&& lowPddTaskid!=default(Guid)) + { + + var lowPPDAnswerList = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId) + && x.QuestionId == inDto.QuestionId + && x.RowIndex == inDto.RowIndex).Include(x => x.ReadingTableQuestionTrial) + .Select(x => new + { + x.Answer, + x.ReadingTableQuestionTrial.QuestionMark, + }).ToListAsync(); + + result.LowPPDSDi = lowPPDAnswerList.Where(x => x.QuestionMark == QuestionMark.PPD).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + result.LowPPDLDi = lowPPDAnswerList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + result.LowPPDSDi = lowPPDAnswerList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + result.LowPPDVisit = await _visitTaskRepository.Where(x => x.Id == lowPddTaskid).Select(x => x.TaskBlindName).FirstOrDefaultAsync(); + } + + return result; + + } /// /// 计算任务 diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 99889d0b2..0558b4bff 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -1533,10 +1533,66 @@ namespace IRaCIS.Core.Domain.Share /// Part = 8, + /// + /// 首次标记访视 + /// + FirstMarkingVisit = 9, + + /// + /// 部位描述 + /// + BodyPartDescription = 10, + /// /// 病灶数量 /// - LesionNumber=11, + LesionNumber =11, + + /// + /// PPD + /// + PPD = 12, + + /// + /// 最低点PPD + /// + NadirPPD = 13, + + /// + /// PPD最低点所在访视 + /// + LowPPDVisit = 14, + + /// + /// PPD最低点LDi + /// + LowPPDLDi = 15, + + /// + /// PPD最低点SDi + /// + LowPPDSDi = 16, + + /// + /// 相比最低点PPD增加百分比 + /// + LowPPDAddPercent = 17, + + /// + /// 相比PPD最低点LDi增加值 + /// + LowPPDLDiAdded = 18, + + /// + /// 相比PPD最低点SDi增加值 + /// + LowPPDSDiAdded = 19, + + /// + /// SUVmax + /// + SUVmax = 20 + } /// From 32af01c8f4fa5e07f28f01023a4de5e42035f7b1 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 23 Aug 2023 14:31:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingCalculateViewModel.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs index 1cf028180..59d8244ce 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs @@ -19,6 +19,29 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } + public class GetPPDInfoOutDto + { + /// + /// 最低的PPD + /// + public decimal? NadirPPD { get; set; } + + /// + /// 最低PPD的访视 + /// + public string? LowPPDVisit { get; set; } + + /// + /// 该病灶PPD值最小的访视的长径 + /// + public decimal? LowPPDLDi { get; set; } + + /// + /// 该病灶PPD值最小的访视的短径 + /// + public decimal? LowPPDSDi { get; set; } + } + public class CalculateTaskInDto { public Guid VisitTaskId { get; set; } From 9d876b44cf51879e22620dd57929f9806bb66693 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 24 Aug 2023 13:30:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E9=98=85=E7=89=87=E5=AD=98=E5=9C=A8=E9=87=8D=E5=A4=8D=20?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=90=8C=E6=AD=A5=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/ReadingImageTask/ReadingGlobalTaskService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs index 4a5941163..f05a5e11c 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs @@ -113,7 +113,7 @@ namespace IRaCIS.Application.Services foreach (var item in inDto.QuestionList) { - await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == visitTaskId && x.GlobalAnswerType == item.GlobalAnswerType && x.QuestionId == item.QuestionId); + await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == item.VisitTaskId && x.GlobalAnswerType == item.GlobalAnswerType && x.QuestionId == item.QuestionId); await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == item.QuestionId && x.Answer != item.Answer && item.Answer != string.Empty && item.Answer != null @@ -124,6 +124,7 @@ namespace IRaCIS.Application.Services }); } + var createtime = DateTime.Now; await _readingGlobalTaskInfoRepository.AddRangeAsync(inDto.QuestionList.Select(x => new ReadingGlobalTaskInfo() { Answer = x.Answer, @@ -133,6 +134,7 @@ namespace IRaCIS.Application.Services GlobalAnswerType = x.GlobalAnswerType, TaskId = x.VisitTaskId, TrialId = inDto.TrialId, + CreateTime= createtime, }).ToList()); await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });