From 72b70f531106894f78110dd4a24f02c174e3a489 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 18 Apr 2024 17:24:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LuganoCalculateService.cs | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 6961be8d3..fe29dd0b5 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -2521,34 +2521,32 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } - // 如果不是保存肝脏血池和纵隔血池 - if (inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool) + + // 先在数据库查这几个值 + List needSearchTypes = new List() + { + QuestionType.SUVmax, + QuestionType.PET5PS, + }; + + var dataBaseDataList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && needSearchTypes.Contains(x.ReadingQuestionTrial.QuestionType)).Select(x => new + { + x.Answer, + x.ReadingQuestionTrial.QuestionType + }).ToListAsync(); ; + + + // 数据库中最大SUVmax + var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty(); + + // 如果不是保存肝脏血池和纵隔血池 + if (inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool&& dataBaseSUVmax == (await GetSuvMax(inDto)).ToString()) { - // 先在数据库查这几个值 - List needSearchTypes = new List() - { - QuestionType.SUVmax, - QuestionType.PET5PS, - }; - - var dataBaseDataList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && needSearchTypes.Contains(x.ReadingQuestionTrial.QuestionType)).Select(x => new - { - x.Answer, - x.ReadingQuestionTrial.QuestionType - }).ToListAsync(); ; - // 数据库中最大SUVmax - var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty(); + return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty(); - // 如果SUVmax没变 就不重新计算 - if (dataBaseSUVmax == (await GetSuvMax(inDto)).ToString()) - { - return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty(); - - } - - } + } @@ -2557,7 +2555,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // return SpleenAssessment.Stabilization.GetEnumInt(); //} - if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt())) + else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt())) { return PET5PSScore.NE.GetEnumInt(); }