From 4165afcc12975d9df5daa952c58ffbb355cb0ba1 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 24 Mar 2023 17:38:29 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Allocation/VisitTaskHelpeService.cs | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 597215059..5be426517 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -213,20 +213,36 @@ namespace IRaCIS.Core.Application.Service // 找到表格问题 var otherLesionTableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == otherLesionQuestion.Id).ToListAsync(); + // 找到病灶状态 + var newstateQuestionId = newLesionTableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x=>x.Id).FirstOrDefault(); + + + var stateAnswers = new List() { + NewLesionState.Loss.GetEnumInt(), + NewLesionState.Suspected.GetEnumInt(), + NewLesionState.UnableEvaluate.GetEnumInt() + }; + + var needRowIds= tableAnswer.Where(x => x.TableQuestionId == newstateQuestionId && stateAnswers.Contains(x.Answer)).Select(x => x.RowId).Distinct().ToList(); + + + + addrowInfo.ForEach(x => { - - if (x.QuestionId == newLesionQuestion.Id) + if (needRowIds.Contains(x.Id)) { x.QuestionId = otherLesionQuestion.Id; x.OrderMark = otherLesionQuestion.OrderMark; - x.RowMark = otherLesionQuestion.OrderMark+x.RowIndex.GetLesionMark(); + x.RowMark = otherLesionQuestion.OrderMark + x.RowIndex.GetLesionMark(); } + + }); tableAnswer.ForEach(x => { - if (x.QuestionId == newLesionQuestion.Id) + if (needRowIds.Contains(x.RowId)) { x.QuestionId = otherLesionQuestion.Id; From 6d87f7f1e397c63dc5fd74d6aabe7ed81d6500ea Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 24 Mar 2023 17:55:12 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskHelpeService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 5be426517..60ed0ddee 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -160,6 +160,7 @@ namespace IRaCIS.Core.Application.Service { x.VisitTaskId = taskInfo.Id; x.IsCurrentTaskAdd = false; + x.FristAddTaskId = taskInfo.Id; x.Id = NewId.NextGuid(); }); From c7869abfaafe6e8ad535e7554574fcd825fad4df Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 27 Mar 2023 11:35:30 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskHelpeService.cs | 2 ++ .../Service/Reading/Dto/ReadingImageTaskViewModel.cs | 8 ++++++++ .../Reading/ReadingImageTask/ReadingGlobalTaskService.cs | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 60ed0ddee..105f717c7 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -1626,6 +1626,7 @@ namespace IRaCIS.Core.Application.Service var task1 = await _visitTaskRepository.AddAsync(new VisitTask() { TrialId = trialId, + IsConvertedTask= originalTaskInfo.IsConvertedTask, SubjectId = item.SubjectId, IsUrgent = originalTaskInfo.IsUrgent, VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global], @@ -1677,6 +1678,7 @@ namespace IRaCIS.Core.Application.Service SubjectId = item.SubjectId, IsUrgent = originalTaskInfo.IsUrgent, TaskName = item.ReadingName, + IsConvertedTask= originalTaskInfo.IsConvertedTask, // 原任务是全局任务 加0.03 就好 VisitTaskNum = originalTaskInfo.VisitTaskNum + 0.03m, ArmEnum = Arm.TumorArm, //特殊 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 1fa3d0946..4932bb811 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -1141,6 +1141,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Arm ArmEnum { get; set; } + + /// + /// 是否是转变的任务(转为IRECIST) + /// + public bool IsConvertedTask { get; set; } = false; + + public bool IsFirstChangeTask { get; set; } = false; + public string AgreeOrNotAnswer { get diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs index b5db6c607..b29de6508 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs @@ -224,9 +224,11 @@ namespace IRaCIS.Application.Services VisitName = x.TaskName, BlindName = x.TaskBlindName, VisitTaskId = x.Id, + IsConvertedTask = x.IsConvertedTask, + IsFirstChangeTask = x.IsConvertedTask && x.BeforeConvertedTaskId != null, ArmEnum = taskInfo.ArmEnum, VisitNum = x.SourceSubjectVisit.VisitNum, - IsBaseLine=x.SourceSubjectVisit.IsBaseLine, + IsBaseLine = x.SourceSubjectVisit.IsBaseLine, VisitId = x.SourceSubjectVisitId.Value, CrterionDictionaryGroup= x.CrterionDictionaryGroup, BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) From 9f1ff445fa6ff19634295e2243da80dc8739429b Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 27 Mar 2023 14:08:53 +0800 Subject: [PATCH 4/6] =?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/ReadingImageTask/ReadingImageTaskService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 9f01135d2..2ab0fb67d 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1377,7 +1377,10 @@ namespace IRaCIS.Application.Services { await VerifyTaskIsSign(inDto.VisitTaskId); - var deleteRowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstNotNullAsync(); + + + var deleteRowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstOrDefaultAsync(); + if (deleteRowInfo == null) { return ResponseOutput.Ok(true); From 11e7cc68067859945a4ff9530f319b864bd8883e Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 27 Mar 2023 15:33:44 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRECIST1Point1CalculateService.cs | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index 50f0b4ee7..92300ec97 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -111,6 +111,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto() + { + QuestionId = x.Key.QuestionId, + Rowindexs = x.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList() + + }).ToListAsync(); + var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); @@ -198,19 +205,27 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var rowlist = tableAnsweRowInfos.Where(x => x.QuestionId == question.QuestionId).OrderBy(x => x.RowIndex).ToList(); + question.Childrens = new List(); - question.Childrens = rowlist.Select(x => new ReadingReportDto() + var rowoindexs = lesionsIndexs.Where(x => x.QuestionId == question.QuestionId).Select(x => x.Rowindexs.OrderBy(y => y).ToList()).FirstOrDefault(); + rowoindexs = rowoindexs == null ? new List() : rowoindexs; + foreach (var rowoindex in rowoindexs) { - QuestionName = question.OrderMark + x.RowIndex.GetLesionMark(), - SplitOrMergeLesionName = x.MergeName.IsNullOrEmpty() ? x.SplitName : x.MergeName, - SplitOrMergeType = x.SplitOrMergeType, - LesionType = question.LesionType, - IsShowInDicom = question.IsShowInDicom, - IsCanEditPosition = x.IsCanEditPosition, - RowIndex = x.RowIndex, - BlindName = x.BlindName, - ReportLayType = ReportLayType.Lesions, - }).ToList(); + var rowinfo = rowlist.Where(x => x.RowIndex == rowoindex).FirstOrDefault(); + question.Childrens.Add(new ReadingReportDto() + { + QuestionName = question.OrderMark + rowoindex.GetLesionMark(), + RowId = rowinfo?.Id, + IsShowInDicom = question.IsShowInDicom, + SplitOrMergeLesionName = rowinfo != null ? (rowinfo.MergeName.IsNullOrEmpty() ? rowinfo.SplitName : rowinfo.MergeName) : string.Empty, + SplitOrMergeType = rowinfo != null ? (rowinfo.SplitOrMergeType) : null, + LesionType = question.LesionType, + IsCanEditPosition = rowinfo != null ? (rowinfo.IsCanEditPosition) : false, + RowIndex = rowoindex, + BlindName = rowinfo != null ? rowinfo.BlindName : string.Empty, + ReportLayType = ReportLayType.Lesions, + }); + } foreach (var row in question.Childrens) From a123d6c25509667531c8fc3cf36870f89cf5632a Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 27 Mar 2023 15:53:39 +0800 Subject: [PATCH 6/6] =?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/IRaCIS.Core.Application.xml | 5 +++++ .../ReadingCalculate/IRECIST1Point1CalculateService.cs | 8 ++++---- .../ReadingCalculate/RECIST1Point1CalculateService.cs | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 65f65cf2e..278074b04 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -3494,6 +3494,11 @@ 当新答案为空的时候 是否是有原数据 + + + 是否是转变的任务(转为IRECIST) + + 问题类型 diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index 92300ec97..8cf435bfd 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { [ApiExplorerSettings(GroupName = "Reading")] - public class RECIST1Point1CalculateService : BaseService, ICriterionCalculateService + public class IRECIST1Point1CalculateService : BaseService, ICriterionCalculateService { private readonly IRepository _readingTableQuestionAnswerRepository; private readonly IRepository _visitTaskRepository; @@ -26,11 +26,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate private readonly IRepository _readingQuestionTrialRepository; private readonly IRepository _organInfoRepository; private readonly IRepository _subjectVisitRepository; - private readonly IRepository _tumorAssessmentRepository; + private readonly IRepository _tumorAssessmentRepository; private readonly IGeneralCalculateService _generalCalculateService; private readonly IRepository _readingTaskQuestionAnswerRepository; - public RECIST1Point1CalculateService( + public IRECIST1Point1CalculateService( IRepository readingTableQuestionAnswerRepository, IRepository visitTaskRepository, IRepository readingQuestionCriterionTrialRepository, @@ -39,7 +39,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository readingQuestionTrialRepository, IRepository organInfoRepository, IRepository subjectVisitRepository, - IRepository tumorAssessmentRepository, + IRepository tumorAssessmentRepository, IGeneralCalculateService generalCalculateService, IRepository readingTaskQuestionAnswerRepository ) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index 739a9e5c8..beb743dde 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { [ApiExplorerSettings(GroupName = "Reading")] - public class IRECIST1Point1CalculateService : BaseService, ICriterionCalculateService + public class RECIST1Point1CalculateService : BaseService, ICriterionCalculateService { private readonly IRepository _readingTableQuestionAnswerRepository; private readonly IRepository _visitTaskRepository; @@ -26,11 +26,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate private readonly IRepository _readingQuestionTrialRepository; private readonly IRepository _organInfoRepository; private readonly IRepository _subjectVisitRepository; - private readonly IRepository _tumorAssessmentRepository; + private readonly IRepository _tumorAssessmentRepository; private readonly IGeneralCalculateService _generalCalculateService; private readonly IRepository _readingTaskQuestionAnswerRepository; - public IRECIST1Point1CalculateService( + public RECIST1Point1CalculateService( IRepository readingTableQuestionAnswerRepository, IRepository visitTaskRepository, IRepository readingQuestionCriterionTrialRepository, @@ -39,7 +39,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository readingQuestionTrialRepository, IRepository organInfoRepository, IRepository subjectVisitRepository, - IRepository tumorAssessmentRepository, + IRepository tumorAssessmentRepository, IGeneralCalculateService generalCalculateService, IRepository readingTaskQuestionAnswerRepository )