diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index b336482c7..d09adad8e 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -3834,6 +3834,16 @@ 字典code + + + 是否存在疾病 + + + + + 整体肿瘤评估 + + 任务Id diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 4530544ce..6fb1dca6e 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -176,7 +176,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public object ReportCalculateResult{ get; set; } - public object CalculateResult { get; set; } + public GetReportVerifyOutDto CalculateResult { get; set; } public ReadingTaskState ReadingTaskState { get; set; } public List VisitTaskList { get; set; } @@ -1687,6 +1687,19 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Func> Fun { get; set; } } + public class GetReportVerifyOutDto + { + /// + /// 是否存在疾病 + /// + public string? IsExistDisease { get; set; } + + /// + /// 整体肿瘤评估 + /// + public string? TumorEvaluate { get; set; } + } + public class GetReportVerifyInDto { public Guid VisitTaskId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 151e25924..d985796c8 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1406,7 +1406,40 @@ namespace IRaCIS.Application.Services public async Task ChangeDicomReadingQuestionAnswer(ChangeDicomReadingQuestionAnswerInDto inDto) { await VerifyTaskIsSign(inDto.VisitTaskId); + + + var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); + + var tumorQuestionId = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.QuestionType == QuestionType.Tumor).Select(x => x.Id).FirstOrDefaultAsync(); + + var tumorAnswer = inDto.Answers.Where(x => x.Id == tumorQuestionId).FirstOrDefault(); + if (tumorAnswer != null) + { + var isConvertedTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.IsConvertedTask).FirstOrDefaultAsync(); + var reportVerify = await _readingCalculateService.GetReportVerify(new GetReportVerifyInDto() { + BeforeConvertedTaskId= taskInfo.BeforeConvertedTaskId, + IsConvertTask= isConvertedTask, + VisitTaskId=inDto.VisitTaskId + }); + + if (tumorAnswer.Answer == reportVerify.TumorEvaluate) + { + await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask() + { + IsChangeTumorEvaluate = false + }); + } + else + { + await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask() + { + IsChangeTumorEvaluate = true + }); + } + } + + var criterionId = taskInfo.TrialReadingCriterionId; var questionIds = inDto.Answers.Select(x => x.Id).ToList(); await _readingTaskQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && questionIds.Contains(x.ReadingQuestionTrialId)); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs index 6fffbc2b4..44a48cfa5 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs @@ -155,7 +155,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { var originalTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); - var taskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == beforeConvertedTaskId && x.ReadingQuestionTrial.Type != "calculation").IgnoreAutoIncludes().AsNoTracking().ToListAsync(); + var taskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == beforeConvertedTaskId &&x.ReadingQuestionTrial.QuestionType!=QuestionType.AdjustReason && x.ReadingQuestionTrial.Type != "calculation").IgnoreAutoIncludes().AsNoTracking().ToListAsync(); taskAnswer.ForEach(x => { diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs index 91e3c1ede..6b37448c4 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs @@ -162,7 +162,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task GetReportVerify(GetReportVerifyInDto inDto) + public async Task GetReportVerify(GetReportVerifyInDto inDto) { var service = await this.GetService(inDto.VisitTaskId); @@ -173,7 +173,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } else { - return new { }; + return new GetReportVerifyOutDto() { }; } } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index 4471b153b..319964f68 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -409,7 +409,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task GetReportVerify(GetReportVerifyInDto inDto) + public async Task GetReportVerify(GetReportVerifyInDto inDto) { var tumorEvaluate = string.Empty; var readingCalculateDto= await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId); @@ -428,7 +428,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate tumorEvaluate = await GetIRECSITTargetLesionEvaluate(readingCalculateDto); } - return new + return new GetReportVerifyOutDto() { TumorEvaluate = tumorEvaluate, IsExistDisease = await this.GetReportIsExistDisease(inDto.VisitTaskId), diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs index bda18fd44..8405d7aeb 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs @@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Service /// /// /// - Task GetReportVerify(GetReportVerifyInDto inDto); + Task GetReportVerify(GetReportVerifyInDto inDto); /// /// 获取阅片报告 diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs index ffe22c606..0aad0c08c 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs @@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Service /// /// /// - Task GetReportVerify(GetReportVerifyInDto inDto); + Task GetReportVerify(GetReportVerifyInDto inDto); /// /// 获取阅片报告 diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index 1c12533a1..845f43f6e 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -1018,9 +1018,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - public async Task GetReportVerify(GetReportVerifyInDto inDto) + public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new() { + return new GetReportVerifyOutDto() { }; } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index a17147ac7..85eee1514 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -371,9 +371,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task GetReportVerify(GetReportVerifyInDto inDto) + public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new + return new GetReportVerifyOutDto() { TumorEvaluate = await this.GetReportTumor(inDto.VisitTaskId), IsExistDisease = await this.GetReportIsExistDisease(inDto.VisitTaskId), diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs index 72b331209..3fd7eecc2 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs @@ -367,9 +367,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task GetReportVerify(GetReportVerifyInDto inDto) + public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new + return new GetReportVerifyOutDto() { TumorEvaluate = await this.GetReportTumor(inDto.VisitTaskId), IsExistDisease = await this.GetReportIsExistDisease(inDto.VisitTaskId), diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs index d6ed8fe62..e0b34c9fa 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs @@ -506,9 +506,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate - public async Task GetReportVerify(GetReportVerifyInDto inDto) + public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new() { + return new GetReportVerifyOutDto() { }; } diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index 1f4ebc15f..73daba8ce 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -335,6 +335,10 @@ namespace IRaCIS.Core.Domain.Models ).Any(); + /// + /// 是否修改了整体肿瘤评估 + /// + public bool IsChangeTumorEvaluate { get; set; } = false; ///