From 8d8b41253e61ed89d29f4a84ad6a5e2d220bca10 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 14 Sep 2023 14:02:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=97=AE=E9=A2=98=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingImageTaskViewModel.cs | 19 +++++ .../Reading/Dto/ReadingQuestionViewModel.cs | 70 +++++++++++++------ .../Interface/IReadingImageTaskService.cs | 3 +- .../ReadingImageTaskService.cs | 17 +++-- IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs | 12 ++++ .../ReadingQuestionSystem.cs | 4 ++ .../ReadingQuestionTrial.cs | 7 +- .../ReadingTableQuestionSystem.cs | 7 +- .../ReadingTableQuestionTrial.cs | 7 +- 9 files changed, 117 insertions(+), 29 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 60cc90cc6..b37c865bc 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -499,6 +499,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid VisitTaskId { get; set; } public Guid TrialId { get; set; } + + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } } public class ReadingTableAnswerRowInfoBase @@ -719,6 +724,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { [NotDefault] public Guid VisitTaskId { get; set; } + + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } } public class GetReadingTableQuestionOutDto @@ -795,6 +805,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List OrganInfos { get; set; } = new List(); + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } public bool IsGetallQuestion { get; set; } = false; /// @@ -947,6 +961,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid TrialId { get; set; } public Guid VisitTaskId { get; set; } + + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } } #endregion diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index a132692ea..89b0b5bb0 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -336,10 +336,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueOfType? ValueType { get; set; } - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } /// /// 限制编辑 @@ -440,10 +445,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueOfType? ValueType { get; set; } - /// - /// 数据来源 - /// - public DataSources? DataSource { get; set; } = DataSources.ManualEntry; + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + /// + /// 数据来源 + /// + public DataSources? DataSource { get; set; } = DataSources.ManualEntry; /// /// 单位 @@ -976,10 +986,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueOfType? ValueType { get; set; } - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } /// @@ -1040,6 +1055,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueOfType? ValueType { get; set; } + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + public List ParentTriggerValueList { get; set; } = new List(); public List RelevanceValueList { get; set; } = new List(); @@ -1560,10 +1580,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueOfType? ValueType { get; set; } - /// - /// 限制编辑 - /// - public LimitEdit LimitEdit { get; set; } = LimitEdit.None; + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + /// + /// 限制编辑 + /// + public LimitEdit LimitEdit { get; set; } = LimitEdit.None; /// /// 最大答案长度 @@ -1909,10 +1934,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueOfType? ValueType { get; set; } - /// - /// 数据来源 - /// - public DataSources? DataSource { get; set; } = DataSources.ManualEntry; + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + /// + /// 数据来源 + /// + public DataSources? DataSource { get; set; } = DataSources.ManualEntry; /// /// 单位 diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs index 88728c9a4..99d4cc7de 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs @@ -6,6 +6,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Contracts { @@ -22,7 +23,7 @@ namespace IRaCIS.Core.Application.Contracts Task GetGlobalReadingInfo(GetGlobalReadingInfoInDto inDto); - Task> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId); + Task> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId,QuestionClassify? questionClassify); Task GetReadingTableQuestion(GetReadingTableQuestionOrAnswerInDto inDto); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 55064037c..0a349b71d 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -696,7 +696,7 @@ namespace IRaCIS.Application.Services { //await AddDefaultValueToTask(inDto.VisitTaskId); var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); - var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id); + var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id, inDto.QuestionClassify); return (result, new { @@ -712,7 +712,7 @@ namespace IRaCIS.Application.Services /// /// [NonDynamicMethod] - public async Task> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId) + public async Task> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId, QuestionClassify? questionClassify) { @@ -721,6 +721,7 @@ namespace IRaCIS.Application.Services //排除表格问题 var questions = await _readingQuestionTrialRepository + .WhereIf(questionClassify!=null,x=>x.QuestionClassify== questionClassify) .WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table) .WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table) @@ -885,6 +886,7 @@ namespace IRaCIS.Application.Services TableAnswers = tableAnswers, TableAnsweRowInfos = tableAnsweRowInfos, OrganInfos = organList, + QuestionClassify=inDto.QuestionClassify, } @@ -935,7 +937,8 @@ namespace IRaCIS.Application.Services TableAnswers = tableAnswers, TableAnsweRowInfos = tableAnsweRowInfos, IsGetallQuestion = true, - OrganInfos = organList + OrganInfos = organList, + QuestionClassify=inDto.QuestionClassify, } ), new @@ -956,7 +959,9 @@ namespace IRaCIS.Application.Services { var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); - var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider, new + var qusetionList = await _readingQuestionTrialRepository + .WhereIf(inDto.QuestionClassify!=null,x=>x.QuestionClassify==inDto.QuestionClassify) + .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us @@ -1032,7 +1037,9 @@ namespace IRaCIS.Application.Services var groupList = new List(); var qusetionIds = qusetionList.Select(x => x.Id).ToList(); - var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId)) + var tableQuestionList = await _readingTableQuestionTrialRepository + .WhereIf(inDto.QuestionClassify != null, x => x.QuestionClassify == inDto.QuestionClassify) + .Where(x => qusetionIds.Contains(x.ReadingQuestionId)) .ProjectTo(_mapper.ConfigurationProvider, new { diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 596aae365..f8e93eb38 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -325,6 +325,18 @@ namespace IRaCIS.Core.Domain.Share Automatic = 1 } + /// + /// 问题分类 + /// + public enum QuestionClassify + { + /// + /// PET + /// + PET = 0, + + } + /// /// 自定义计算标记 diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs index 5470d094c..764d72254 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs @@ -203,6 +203,10 @@ namespace IRaCIS.Core.Domain.Models /// public string? FileType { get; set; } + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } [JsonIgnore] [ForeignKey("GroupId")] diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs index 8af84fed2..771a12133 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs @@ -261,7 +261,12 @@ namespace IRaCIS.Core.Domain.Models /// public Guid? GroupId { get; set; } - [JsonIgnore] + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + [JsonIgnore] [ForeignKey("GroupId")] public ReadingQuestionTrial GroupInfo { get; set; } diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs index 56172b94e..936eff75f 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionSystem.cs @@ -176,7 +176,12 @@ namespace IRaCIS.Core.Domain.Models /// public string? FileType { get; set; } - [ForeignKey("DependParentId")] + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + [ForeignKey("DependParentId")] [JsonIgnore] public ReadingTableQuestionSystem DependParentQuestion { get; set; } diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs index df02d648c..fdb03ecf7 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs @@ -195,7 +195,12 @@ namespace IRaCIS.Core.Domain.Models /// public string? FileType { get; set; } - [JsonIgnore] + /// + /// 问题分类 + /// + public QuestionClassify? QuestionClassify { get; set; } + + [JsonIgnore] [ForeignKey("DependParentId")] public ReadingTableQuestionTrial DependParentQuestion { get; set; }