From cc84b203a76c47888a52ccdcecb74037cea8edfd Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 19 Oct 2022 10:12:45 +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 --- .../IRaCIS.Core.Application.xml | 11 +++++- .../RECIST1Point1CalculateService.cs | 34 +++++++++++++++---- IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs | 2 +- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index cec6bbff..b8f42727 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -881,6 +881,14 @@ 获取Sod的值 + + + 测试计算 + + + + + 计算任务 @@ -895,11 +903,12 @@ - + 自动计算 + diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index 8666dbac..29c5bc28 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -15,6 +15,7 @@ using MassTransit; namespace IRaCIS.Core.Application.Service.ReadingCalculate { + [ApiExplorerSettings(GroupName = "Reading")] public class RECIST1Point1CalculateService : BaseService, ICriterionCalculateService { private readonly IRepository _readingTableQuestionAnswerRepository; @@ -60,6 +61,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate private decimal? sODData; #endregion + /// + /// 测试计算 + /// + /// + /// + /// + [HttpPost] + public async Task TestCalculate(Guid visitTaskId, QuestionType type) + { + ReadingCalculateDto readingData = await GetReadingCalculateDto(visitTaskId); + await ReadingCalculate(readingData,new List() { type}); + } + + /// /// 计算任务 /// @@ -93,8 +108,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// 自动计算 /// /// + /// /// - public async Task ReadingCalculate(ReadingCalculateDto inDto) + public async Task ReadingCalculate(ReadingCalculateDto inDto,List calculateType=null) { #region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果 @@ -150,6 +166,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }; + if (calculateType != null) + { + calculateList = calculateList.Where(x => calculateType.Contains(x.QuestionType)).ToList(); + } var typeNAList = new List { @@ -1248,13 +1268,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NoTargetAssessment.PD; } //所有单个病灶/病灶组状态评估状态为“消失” - else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))) + else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))== tableQuestions.Count(x=> x.QuestionMark == QuestionMark.State)) { result = NoTargetAssessment.PD; } // 任意单个病灶/病灶组评估为“无法评估”并且没有“显著增大” - else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Increase)) && - !tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && !x.Answer.EqEnum(NoTargetState.Increase)) + else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.UnableEvaluate)) && + !tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Increase)) ) { result = NoTargetAssessment.NE; @@ -1267,8 +1287,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 所有单个病灶/病灶组评估为”存在”或者有些评估为“消失”有些评估为“存在”,且没有“显著增大”和“无法评估”的病灶 - else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && !x.Answer.EqEnum(NoTargetState.Exist)) - || (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Exist) || x.Answer.EqEnum(NoTargetState.Loss)) && !tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer != "显著增大" || x.Answer != "无法评估"))) + else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Exist)) + && !tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(NoTargetState.Increase) || x.Answer.EqEnum(NoTargetState.UnableEvaluate))) ) { @@ -1312,7 +1332,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NewLesionAssessment.Yes; } //当前访视不存在明确新病灶且存在至少一个疑似新病灶 - else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && !x.Answer.EqEnum(NewLesionState.Exist)) || + else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)) && tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Suspected)) ) { diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index b6a63035..c80947bf 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -673,7 +673,7 @@ namespace IRaCIS.Core.Domain.Share /// /// 新病灶 /// - NewLesions = 1, + NewLesions = 2, }