From c7abcc153e205fb75ddb8514d049719d3f89d605 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 12 Mar 2024 14:05:14 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessFilter/ProjectExceptionFilter.cs | 4 +++- .../ReadingImageTask/ReadingImageTaskService.cs | 6 +++--- .../ReadingImageTask/ReadingTaskQuestionService.cs | 2 +- .../Exception/BusinessValidationFailedException.cs | 13 +++++++++---- .../_IRaCIS/Output/ApiResponseCodeEnum.cs | 1 + 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs b/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs index 2948ee64f..5638e52ea 100644 --- a/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs @@ -32,7 +32,9 @@ namespace IRaCIS.Core.Application.Filter if (context.Exception.GetType() == typeof(BusinessValidationFailedException)) { - context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message,ApiResponseCodeEnum.BusinessValidationFailed)); + var error = context.Exception as BusinessValidationFailedException; + + context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message, error!.Code)); } else if(context.Exception.GetType() == typeof(QueryBusinessObjectNotExistException)) { diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 8ee67f3ea..3451ebb15 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -2600,7 +2600,7 @@ namespace IRaCIS.Application.Services if (currentSubject == null) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]); + throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows); } task = currentSubject.UnReadCanReadTaskList.Select(x => new GetReadingTaskDto() @@ -2627,7 +2627,7 @@ namespace IRaCIS.Application.Services var count = await query.CountAsync(); if (count == 0) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]); + throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows); } Random random = new Random(); var skipcount = 0; @@ -2653,7 +2653,7 @@ namespace IRaCIS.Application.Services if (task == null) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]); + throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows); } if (task.SubjectCode.IsNullOrEmpty()) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index 82a62dead..241ea07c2 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -285,7 +285,7 @@ namespace IRaCIS.Application.Services //qusetionList = qusetionList.Where(x => x.ParentId == null).ToList(); - groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); + groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group ).ToList(); groupList.ForEach(x => { this.FindSystemChildQuestion(x, qusetionList, tableQuestionList); diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs index ccda66221..cbe9ec767 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs @@ -1,17 +1,22 @@ -using System; +using IRaCIS.Core.Infrastructure.Extention; +using System; namespace IRaCIS.Core.Infrastructure { public class BusinessValidationFailedException : Exception { - public BusinessValidationFailedException() + public ApiResponseCodeEnum Code { get; set; } + + public BusinessValidationFailedException() { } - public BusinessValidationFailedException( string message) : base(message) + public BusinessValidationFailedException(string message, ApiResponseCodeEnum code = ApiResponseCodeEnum.BusinessValidationFailed) : base(message) { - } + Code = code; + + } } } diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs index 0fb88dff2..f96a2d6ba 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs @@ -30,6 +30,7 @@ namespace IRaCIS.Core.Infrastructure.Extention NeedTips = 5, + CloseCurrentWindows=6, From e19c03412daae02d357ee723d9aeea470b4e88f3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 12 Mar 2024 14:13:26 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/Dto/ReadingImageTaskViewModel.cs | 7 ++++++- .../Reading/ReadingImageTask/ReadingTaskQuestionService.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index dc1c15b6c..3d781e084 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -2404,7 +2404,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid Id { get; set; } - /// + /// + /// 分组ID + /// + public Guid? GroupId { get; set; } + + /// /// 系统标准Id /// public Guid ReadingQuestionCriterionSystemId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index 241ea07c2..e7d0f29e6 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -308,7 +308,7 @@ namespace IRaCIS.Application.Services /// public void FindSystemChildQuestion(GetSystemReadingQuestionOutDto item, List questionlists, List tableQuestions) { - item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName)).ToList(); + item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupId == item.Id)).ToList(); item.Childrens.AddRange(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).Select(x => new GetSystemReadingQuestionOutDto { From b102d23477a2751db6f682091e6345d119e92ef7 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 12 Mar 2024 14:30:43 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/MedicalAudit/ReadingMedicineQuestionService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs index 4de2b3f2c..09e7465cb 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs @@ -530,6 +530,7 @@ namespace IRaCIS.Core.Application.Service var maxOrder = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).OrderByDescending(x => x.ShowOrder).Select(x => x.ShowOrder).FirstOrDefaultAsync(); List needList = await _readingMedicineSystemQuestionRepository + .Where(x=>x.IsEnable) .Where(x=>x.LanguageType==inDto.LanguageType) .Where(x =>needAddCategory.Contains(x.ReadingCategory) && x.CriterionTypeEnum == criterionInfo.CriterionType) .Select(x => new TrialDataFromSystem() @@ -554,6 +555,7 @@ namespace IRaCIS.Core.Application.Service if (!needList.Any(x => x.ReadingCategory == item)) { needList.AddRange(await _readingMedicineSystemQuestionRepository + .Where(x => x.IsEnable) .Where(x => x.LanguageType == inDto.LanguageType) .Where(x => x.ReadingCategory == item && x.IsGeneral) .Select(x => new TrialDataFromSystem() @@ -561,6 +563,7 @@ namespace IRaCIS.Core.Application.Service ShowOrder = x.ShowOrder, IsEnable = x.IsEnable, + LanguageType = x.LanguageType, IsRequired = x.IsRequired, QuestionName = x.QuestionName, From 7d63f3f5cba7bcf289b1a3c6dba2a67a6cecec61 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 12 Mar 2024 14:31:56 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/MedicalAudit/ReadingMedicineQuestionService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs index 09e7465cb..84962df64 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs @@ -555,7 +555,7 @@ namespace IRaCIS.Core.Application.Service if (!needList.Any(x => x.ReadingCategory == item)) { needList.AddRange(await _readingMedicineSystemQuestionRepository - .Where(x => x.IsEnable) + .Where(x => x.IsEnable) .Where(x => x.LanguageType == inDto.LanguageType) .Where(x => x.ReadingCategory == item && x.IsGeneral) .Select(x => new TrialDataFromSystem() From a66bb421263c58619db67d103b85efcb90fbea2a Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 12 Mar 2024 15:15:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=97=85=E7=81=B6=E8=9E=8D=E5=90=88?= =?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 | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 3451ebb15..6b4640d40 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1543,8 +1543,13 @@ namespace IRaCIS.Application.Services Answer = TargetState.Loss.GetEnumInt(), }); + await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => inDto.MergeRowIdList.Contains(x.RowId) &&( x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis || x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis), x => new ReadingTableQuestionAnswer() + { + Answer = "0", + }); - await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x=> inDto.MergeRowIdList.Contains(x.Id), x => new ReadingTableAnswerRowInfo() + + await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x=> inDto.MergeRowIdList.Contains(x.Id), x => new ReadingTableAnswerRowInfo() { MergeRowId=inDto.MergeMainRowId, SplitOrMergeType = SplitOrMergeType.Merge, @@ -1587,29 +1592,29 @@ namespace IRaCIS.Application.Services { var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).Include(x=>x.ReadingQuestionTrial).FirstNotNullAsync(); + var taskInfo = await _visitTaskRepository.Where(x => x.Id == rowinfo.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); // 需要排除的状态 var needFilterState = new List(); - switch (rowinfo.ReadingQuestionTrial.LesionType) + var query = _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == rowinfo.VisitTaskId && x.QuestionId == rowinfo.QuestionId && x.Id != rowinfo.Id) + .Where(x => x.SplitOrMergeType != SplitOrMergeType.Split && x.SplitOrMergeType != SplitOrMergeType.SplitMain); + + switch (taskInfo.TrialReadingCriterion.CriterionType) { - //状态为“消失”、“无法评估”的靶病灶不可融合; - case LesionType.TargetLesion: - needFilterState = new List() { - TargetState.Loss.GetEnumInt(), - TargetState.UnableEvaluate.GetEnumInt(), - string.Empty, - }; + + case CriterionType.Lugano2014: + query = query.Where(x => x.MeasureData == string.Empty || + (x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && y.Answer == TargetState.Loss.GetEnumInt()) && + x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.IsLymph && y.Answer == ReadingYesOrNo.No.GetEnumInt()) + )); break; } - var result = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == rowinfo.VisitTaskId && x.QuestionId == rowinfo.QuestionId && x.Id != rowinfo.Id) - // 筛选状态 - .Where(x => x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && !needFilterState.Contains(y.Answer))) - .Where(x=>x.SplitOrMergeType!=SplitOrMergeType.Split&&x.SplitOrMergeType!=SplitOrMergeType.SplitMain) - .Select(x => new GetCanMergeLesionOutDto() + var result = await query + .Select(x => new GetCanMergeLesionOutDto() { RowId = x.Id, RowIndex = x.RowIndex,