From 2774f36538c194db045b20892a9661cd77cdbc95 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 13 Dec 2022 11:41:25 +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 --- .../ReadingImageTaskService.cs | 27 +++++++++++++++++++ .../Common/ReadingCommon.cs | 16 +++++++++++ 2 files changed, 43 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 127725f2..61883fbf 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1310,6 +1310,33 @@ namespace IRaCIS.Application.Services #region Dicom 非dicom 公用 + /// + /// 验证默认问题是否回答 + /// + /// + /// + /// + [HttpPost] + public async Task VerifyDefaultQuestionBeAnswer(VerifyVisitTaskQuestionsInDto inDto) + { + await VerifyTaskIsSign(inDto.VisitTaskId); + var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); + + var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId + && (x.IsJudgeQuestion || (x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show)&&x.Type==ReadingCommon.QuestionType.Calculation) + ).ToListAsync(); + + var answerQuestionIds = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Select(x => x.ReadingQuestionTrialId).ToListAsync(); + + readingQuestionList = readingQuestionList.Where(x => !answerQuestionIds.Contains(x.Id)).ToList(); + + if (readingQuestionList.Count() > 0) + { + throw new BusinessValidationFailedException($" 必填问题{string.Join(',', readingQuestionList.Select(x => x.QuestionName))}的答案为空或未保存"); + } + return ResponseOutput.Ok(true); + } + /// /// 验证访视提交 diff --git a/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs b/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs index 44528c84..ce44e85a 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs @@ -29,6 +29,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// public const string OncologyAssess = "OncologyAssessType"; + + + /// /// 标准字典需要配置的相 /// @@ -39,6 +42,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common }; } + + /// + /// 阅片问题类型 + /// + public static class QuestionType + { + + /// + /// 类型自动计算 + /// + public const string Calculation = "calculation"; + } +