From 3a710e1e50494fb09100ff5cf45d251fe853f93d Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 13:19:58 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E7=97=85=E7=81=B6=E5=88=86=E8=A3=82?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingImageTaskService.cs | 41 +++++++++++-------- .../Interface/ILuganoCalculateService.cs | 19 +++++++++ .../LuganoCalculateService.cs | 6 ++- 3 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 626f5effc..be1720087 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -17,6 +17,7 @@ using IRaCIS.Core.Application.Filter; using DocumentFormat.OpenXml.Drawing; using EasyCaching.Core; using DocumentFormat.OpenXml.Drawing.Charts; +using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; namespace IRaCIS.Application.Services { @@ -48,7 +49,8 @@ namespace IRaCIS.Application.Services private readonly IRepository _trialDocumentRepository; private readonly IRepository _userRepository; private readonly IEasyCachingProvider _provider; - private readonly IRepository _readingCustomTagRepository; + private readonly ILuganoCalculateService _luganoCalculateService; + private readonly IRepository _readingCustomTagRepository; private readonly IRepository _readingTaskQuestionMarkRepository; private readonly IRepository _readingCriterionDictionaryRepository; private readonly IRepository _readingTrialCriterionDictionaryRepository; @@ -88,7 +90,8 @@ namespace IRaCIS.Application.Services IRepository trialDocumentRepository, IRepository userRepository, IEasyCachingProvider provider, - IRepository readingCustomTagRepository, + ILuganoCalculateService luganoCalculateService, + IRepository readingCustomTagRepository, IRepository readingTaskQuestionMarkRepository, IRepository readingCriterionDictionaryRepository, IRepository readingTrialCriterionDictionaryRepository, @@ -126,7 +129,8 @@ namespace IRaCIS.Application.Services this._trialDocumentRepository = trialDocumentRepository; this._userRepository = userRepository; this._provider = provider; - this._readingCustomTagRepository = readingCustomTagRepository; + this._luganoCalculateService = luganoCalculateService; + this._readingCustomTagRepository = readingCustomTagRepository; this._readingTaskQuestionMarkRepository = readingTaskQuestionMarkRepository; this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository; this._tumorAssessmentRepository = tumorAssessmentRepository; @@ -1808,9 +1812,7 @@ namespace IRaCIS.Application.Services public async Task SubmitTableQuestion(SubmitTableQuestionInDto inDto) { SubmitTableQuestionOutDto result = new SubmitTableQuestionOutDto(); - await VerifyTaskIsSign(inDto.VisitTaskId); - if (inDto.InstanceId != null && inDto.IsDicomReading) { if (!(await _dicomInstanceRepository.AnyAsync(x => x.Id == inDto.InstanceId && x.SeriesId == inDto.SeriesId))) @@ -1968,24 +1970,20 @@ namespace IRaCIS.Application.Services break; } - var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync(); var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync(); var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync(); var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList(); var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.RowId == inDto.RowId).ToListAsync(); - var tableQuestionIdGroup = tableQuestionIds.GroupBy(x => new { TableQuestionId = x }).Select(x => new TableQuestionData { TableQuestionId = x.Key.TableQuestionId, Count = x.Count() }).ToList(); - if (tableQuestionIdGroup.Any(x => x.Count > 1)) { throw new BusinessValidationFailedException(_localizer["ReadingImage_Twice"]); } - if (inDto.RowIndex % 1 == 0) { @@ -2105,15 +2103,11 @@ namespace IRaCIS.Application.Services { isCurrentTaskAdd = isCurrentTaskAddList[0]; } - - ReadingTableAnswerRowInfo? rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == (inDto.RowId ?? default(Guid))).IgnoreAutoIncludes().FirstOrDefaultAsync(); - rowInfo = rowInfo == null ? new ReadingTableAnswerRowInfo() : rowInfo; //await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.RowId == (inDto.RowId ?? default(Guid))); //await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.Id == (inDto.RowId ?? default(Guid))); - _mapper.Map(inDto, rowInfo); rowInfo.Id = inDto.RowId == null ? NewId.NextGuid() : inDto.RowId.Value; result.RowId = rowInfo.Id; @@ -2145,7 +2139,6 @@ namespace IRaCIS.Application.Services await _readingTableQuestionAnswerRepository.AddRangeAsync(answerList); } - else { await _readingTableAnswerRowInfoRepository.UpdateFromDTOAsync(inDto) ; @@ -2180,7 +2173,6 @@ namespace IRaCIS.Application.Services } - await _readingTableAnswerRowInfoRepository.SaveChangesAsync(); await this._readingCalculateService.CalculateTask(new CalculateTaskInDto() { @@ -2189,10 +2181,23 @@ namespace IRaCIS.Application.Services ComputationTrigger = ComputationTrigger.Lesion, }); + // 保存完了计算疾病进展 + switch (taskinfo.TrialReadingCriterion.CriterionType) + { + case CriterionType.Lugano2014: + if (inDto.RowIndex % 1 != 0) + { + await _luganoCalculateService.CalculateTargetLesionStatus(new CalculateTargetLesionStatusInDto() + { + QuestionId = inDto.QuestionId, + VisitTaskId = inDto.VisitTaskId, + RowNumber = inDto.RowIndex + }); + } + break; + } - - - return result; + return result; } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs new file mode 100644 index 000000000..6ee6012e7 --- /dev/null +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs @@ -0,0 +1,19 @@ +using IRaCIS.Core.Application.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.Service.ReadingCalculate.Interface +{ + public interface ILuganoCalculateService + { + /// + /// 计算靶病灶状态 + /// + /// + /// + Task CalculateTargetLesionStatus(CalculateTargetLesionStatusInDto inDto); + } +} diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index c7d12d6c6..ce4553016 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -14,13 +14,15 @@ using System.Reflection.Metadata.Ecma335; using System.Linq; using NPOI.SS.Formula.Functions; using DocumentFormat.OpenXml.Drawing.Charts; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; namespace IRaCIS.Core.Application.Service.ReadingCalculate { [ApiExplorerSettings(GroupName = "Reading")] - public class LuganoCalculateService : BaseService, ICriterionCalculateService - { + public class LuganoCalculateService : BaseService, ICriterionCalculateService, ILuganoCalculateService + { private readonly IRepository _readingTableQuestionAnswerRepository; private readonly IRepository _visitTaskRepository; private readonly IRepository _readingQuestionCriterionTrialRepository; From 8b86bc6b3ff21b36a95884dc65ec69a98786650c Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 14:12:21 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8F=AF=E8=9E=8D?= =?UTF-8?q?=E5=90=88=E7=9A=84=E7=97=85=E7=81=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 14 ++++ .../Reading/Dto/ReadingImageTaskViewModel.cs | 22 +++++- .../ReadingImageTaskService.cs | 74 +++++++++++++++++-- 3 files changed, 101 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 602e97a4b..e96b8314d 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -1310,6 +1310,13 @@ + + + 计算靶病灶状态 + + + + 获取Sod的值 @@ -13413,6 +13420,13 @@ + + + 获取可合并的病灶 + + + + 保存影像质量 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index ace138aac..3856305be 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -297,7 +297,27 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List CrterionDictionaryGroup { get; set; } } - public class MergeLesionInDto + + public class GetCanMergeLesionOutDto + { + public Guid RowId { get; set; } + + public string OrderMarkName { get; set; } + + public Guid? OrganInfoId { get; set; } + + public decimal RowIndex { get; set; } + + public string Part { get; set; } + } + + + public class GetCanMergeLesionInDto + { + public Guid RowId { get; set; } + } + + public class MergeLesionInDto { 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 be1720087..f4cea5994 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1515,19 +1515,77 @@ namespace IRaCIS.Application.Services } - - #endregion - - - - #region 访视任务 - Dicom 阅片 提交、修改 - /// - /// 保存影像质量 + /// 获取可合并的病灶 /// /// /// [HttpPost] + public async Task> GetCanMergeLesion(GetCanMergeLesionInDto inDto) + { + var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).Include(x=>x.ReadingQuestionTrial).FirstNotNullAsync(); + + // 需要排除的状态 + var needFilterState = new List(); + + switch (rowinfo.ReadingQuestionTrial.LesionType) + { + //状态为“消失”、“无法评估”的靶病灶不可融合; + case LesionType.TargetLesion: + needFilterState = new List() { + TargetState.Loss.GetEnumInt(), + TargetState.UnableEvaluate.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))) + .Select(x => new GetCanMergeLesionOutDto() + { + RowId = x.Id, + RowIndex = x.RowIndex, + OrderMarkName = x.ReadingQuestionTrial.OrderMark + x.RowIndex.GetLesionMark(), + OrganInfoId = x.OrganInfoId + }).OrderBy(x=>x.RowIndex).ToListAsync(); + + var organIds = result.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); + var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); + + result.ForEach(x => + { + + if (_userInfo.IsEn_Us) + { + x.Part = organList.Where(y => y.Id == x.OrganInfoId).Select(y => y.PartEN).FirstIsNullReturnEmpty(); + + } + else + { + x.Part = organList.Where(y => y.Id == x.OrganInfoId).Select(y => y.Part).FirstIsNullReturnEmpty(); + } + }); + + return result; + + } + + #endregion + + + + #region 访视任务 - Dicom 阅片 提交、修改 + + /// + /// 保存影像质量 + /// + /// + /// + [HttpPost] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] public async Task SaveImageQuality(ChangeDicomReadingQuestionAnswerInDto inDto) { From df187bed5805bd8e25b0ac6618b2db690dbe0e61 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 14:28:52 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E7=97=85=E7=81=B6=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingImageTaskViewModel.cs | 18 +++++-- .../ReadingImageTaskService.cs | 52 ++++--------------- .../ReadingTableAnswerRowInfo.cs | 18 +++++++ 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 3856305be..c29e64420 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -323,12 +323,24 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid QuestionId { get; set; } - public Guid MainRowId { get; set; } - + + /// + /// 融合的病灶 + /// public Guid MergeRowId { get; set; } + /// + /// 融向的病灶 + /// + public List MeltingInToLesionList { get; set; } - } + /// + /// 融合后病灶状态 + /// + public string LesionState { get; set; } + + + } public class SplitLesionInDto { diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index f4cea5994..c4f9fb605 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1467,52 +1467,21 @@ namespace IRaCIS.Application.Services { await VerifyTaskIsSign(inDto.VisitTaskId); await this.VerifyIsBaseLineTask(inDto.VisitTaskId); - - var rowsInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Id == inDto.MainRowId || x.Id == inDto.MergeRowId)).ToListAsync(); - - if (rowsInfo.Count != 2) + var mergeRow =await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.MergeRowId).FirstNotNullAsync(); + if (inDto.LesionState != string.Empty) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_NotaTask"]); - } - - - var minaid = rowsInfo.Where(x => x.Id == inDto.MainRowId).Select(x => x.Id).FirstOrDefault(); - var mergeid = rowsInfo.Where(x => x.Id == inDto.MergeRowId).Select(x => x.Id).FirstOrDefault(); - - List needRemoveMark = new List() + await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeRow.Id && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State, x => new ReadingTableQuestionAnswer() + { + Answer = inDto.LesionState, + }); + } + + await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeRowId, x => new ReadingTableAnswerRowInfo() { - QuestionMark.MajorAxis, - QuestionMark.ShortAxis, - }; - - var mainAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.RowId == minaid).Include(x => x.ReadingTableQuestionTrial).ToListAsync(); - - foreach (var item in mainAnswer) - { - await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeid && x.TableQuestionId == item.TableQuestionId, x => new ReadingTableQuestionAnswer() - { - Answer = needRemoveMark.Contains(item.ReadingTableQuestionTrial.QuestionMark) ? string.Empty : item.Answer, - }); - } - - - - await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(mergeid, x => new ReadingTableAnswerRowInfo() - { - MergeRowId = minaid, + MeltingInToLesion=JsonConvert.SerializeObject(inDto.MeltingInToLesionList), SplitOrMergeType = SplitOrMergeType.Merge, }); - - - await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(mergeid, x => new ReadingTableAnswerRowInfo() - { - MergeRowId = minaid, - SplitOrMergeType = SplitOrMergeType.Merge, - }); - await _readingTableAnswerRowInfoRepository.SaveChangesAsync(); - - } /// @@ -1545,6 +1514,7 @@ namespace IRaCIS.Application.Services 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() { RowId = x.Id, diff --git a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs index 4670ad302..cca4d2d9c 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs @@ -207,6 +207,24 @@ namespace IRaCIS.Core.Domain.Models /// public string MarkTool { get; set; } = string.Empty; + /// + /// 融向的病灶 + /// + public string MeltingInToLesion { get; set; } = "[]"; + + public List MeltingInToLesionList { get { + + try + { + return JsonConvert.DeserializeObject>(this.MeltingInToLesion); + } + catch (Exception) + { + + return new List(); + } + } } + [JsonIgnore] [ForeignKey("VisitTaskId")] From 88931a4a565d5147ff707d39e129c094dab490d3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 14:32:39 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=96=B0=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/Dto/ReadingImageTaskViewModel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index c29e64420..b1bdba483 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -1018,7 +1018,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public int? OtherNumberOfFrames { get; set; } - } + + public SplitOrMergeType? SplitOrMergeType { get; set; } + + } public class GetTableAnswerRowInfoInDto { From 8b7cc8a22067fdad7c393105cb2fe432934ed721 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 14:50:38 +0800 Subject: [PATCH 05/12] =?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.xml | 15 +++++++ .../Reading/Dto/ReadingImageTaskViewModel.cs | 8 ++-- .../ReadingImageTaskService.cs | 42 +++++++++++-------- 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index e96b8314d..8ded5c6c8 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -4867,6 +4867,21 @@ 序号标记 + + + 融合的病灶 + + + + + 融向的病灶 + + + + + 融合后病灶状态 + + 任务Id diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index b1bdba483..c6c8c9ddb 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -334,10 +334,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public List MeltingInToLesionList { get; set; } - /// - /// 融合后病灶状态 - /// - public string LesionState { get; set; } + ///// + ///// 融合后病灶状态 + ///// + //public string LesionState { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index c4f9fb605..c082cf892 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1465,24 +1465,30 @@ namespace IRaCIS.Application.Services [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] public async Task MergeLesion(MergeLesionInDto inDto) { - await VerifyTaskIsSign(inDto.VisitTaskId); - await this.VerifyIsBaseLineTask(inDto.VisitTaskId); - var mergeRow =await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.MergeRowId).FirstNotNullAsync(); - if (inDto.LesionState != string.Empty) - { - await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeRow.Id && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State, x => new ReadingTableQuestionAnswer() - { - Answer = inDto.LesionState, - }); - } - - await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeRowId, x => new ReadingTableAnswerRowInfo() - { - MeltingInToLesion=JsonConvert.SerializeObject(inDto.MeltingInToLesionList), - SplitOrMergeType = SplitOrMergeType.Merge, - }); - await _readingTableAnswerRowInfoRepository.SaveChangesAsync(); - } + await VerifyTaskIsSign(inDto.VisitTaskId); + await this.VerifyIsBaseLineTask(inDto.VisitTaskId); + var mergeRow = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.MergeRowId).FirstNotNullAsync(); + + await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeRow.Id && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State, x => new ReadingTableQuestionAnswer() + { + Answer = TargetState.Loss.GetEnumInt(), + }); + + + await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeRowId, x => new ReadingTableAnswerRowInfo() + { + MeltingInToLesion = JsonConvert.SerializeObject(inDto.MeltingInToLesionList), + SplitOrMergeType = SplitOrMergeType.Merge, + }); + await _readingTableAnswerRowInfoRepository.SaveChangesAsync(); + + await this._readingCalculateService.CalculateTask(new CalculateTaskInDto() + { + IsChangeOtherTask = false, + VisitTaskId = inDto.VisitTaskId, + ComputationTrigger = ComputationTrigger.Lesion, + }); + } /// /// 获取可合并的病灶 From b147ee1c9928733ff64aafaecd1f1949b98e85af Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 15:13:56 +0800 Subject: [PATCH 06/12] =?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/ReadingCalculate/LuganoCalculateService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index ce4553016..99af6f5fa 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1098,6 +1098,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate tableRowAnswers.ForEach(x => { + x.SplitOrMergeType = null; x.VisitTaskId = visitTaskId; x.IsCurrentTaskAdd = false; x.Id = NewId.NextGuid(); From 5a76275571dd4246c7114cceb8b297f82cdd152f Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 16:23:13 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingImageTask/ReadingImageTaskService.cs | 17 ++++++++++++----- .../ReadingCalculate/LuganoCalculateService.cs | 4 +++- .../ReadingTableAnswerRowInfo.cs | 5 +++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index c082cf892..0e9c3319e 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1364,6 +1364,7 @@ namespace IRaCIS.Application.Services answers.Add("RowIndex", x.ToString()); answers.Add("RowId", rowInfo==null?string.Empty: rowInfo.Id.ToString()); answers.Add("MarkTool", rowInfo.MarkTool); + answers.Add("MeltingInToLesionMarks", rowInfo.MeltingInToLesionMarks); answers.Add("StudyId", rowInfo.StudyId.ToString()); answers.Add("OrganInfoId", rowInfo.OrganInfoId.ToString()); answers.Add("IsFristAdd", (rowInfo.FristAddTaskId== TaskId).ToString()); @@ -1469,17 +1470,23 @@ namespace IRaCIS.Application.Services await this.VerifyIsBaseLineTask(inDto.VisitTaskId); var mergeRow = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.MergeRowId).FirstNotNullAsync(); + var meltingRows = await _readingTableAnswerRowInfoRepository.Where(x => inDto.MeltingInToLesionList.Contains(x.Id)).Include(x => x.ReadingQuestionTrial).ToListAsync(); + + var marks= meltingRows.OrderBy(x=>x.RowIndex).Select(x => x.ReadingQuestionTrial.OrderMark+x.RowIndex.GetLesionMark() ).ToList(): + await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeRow.Id && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State, x => new ReadingTableQuestionAnswer() { Answer = TargetState.Loss.GetEnumInt(), }); - await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeRowId, x => new ReadingTableAnswerRowInfo() - { - MeltingInToLesion = JsonConvert.SerializeObject(inDto.MeltingInToLesionList), - SplitOrMergeType = SplitOrMergeType.Merge, - }); + await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeRowId, x => new ReadingTableAnswerRowInfo() + { + MeltingInToLesion = JsonConvert.SerializeObject(inDto.MeltingInToLesionList), + MeltingInToLesionMarks = string.Join(',', marks), + + SplitOrMergeType = SplitOrMergeType.Merge, + }) ; await _readingTableAnswerRowInfoRepository.SaveChangesAsync(); await this._readingCalculateService.CalculateTask(new CalculateTaskInDto() diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 99af6f5fa..af600e2fc 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1106,7 +1106,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.InstanceId = null; x.MeasureData = string.Empty; x.PicturePath = string.Empty; - }); + + + }); tableRowAnswers.ForEach(x => { diff --git a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs index cca4d2d9c..d919544ef 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs @@ -212,6 +212,11 @@ namespace IRaCIS.Core.Domain.Models /// public string MeltingInToLesion { get; set; } = "[]"; + /// + /// 融向病灶的名称 + /// + public string MeltingInToLesionMarks { get; set; } = string.Empty; + public List MeltingInToLesionList { get { try From edf8af3e4d42cf60dc369b6e01decd663280ba1e Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 20 Feb 2024 16:30:20 +0800 Subject: [PATCH 08/12] =?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 ----- .../Reading/ReadingImageTask/ReadingImageTaskService.cs | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 8ded5c6c8..a37261aef 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -4877,11 +4877,6 @@ 融向的病灶 - - - 融合后病灶状态 - - 任务Id diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 0e9c3319e..6e5d247f7 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1472,7 +1472,7 @@ namespace IRaCIS.Application.Services var meltingRows = await _readingTableAnswerRowInfoRepository.Where(x => inDto.MeltingInToLesionList.Contains(x.Id)).Include(x => x.ReadingQuestionTrial).ToListAsync(); - var marks= meltingRows.OrderBy(x=>x.RowIndex).Select(x => x.ReadingQuestionTrial.OrderMark+x.RowIndex.GetLesionMark() ).ToList(): + List marks = meltingRows.OrderBy(x => x.RowIndex).Select(x => x.ReadingQuestionTrial.OrderMark + x.RowIndex.GetLesionMark()).ToList(); await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeRow.Id && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State, x => new ReadingTableQuestionAnswer() { From 2594ecd27e2e15fb922986d89d0fdcca57863b7d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 21 Feb 2024 09:30:41 +0800 Subject: [PATCH 09/12] =?UTF-8?q?[=E4=BF=AE=E6=94=B9=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=97=B6=EF=BC=8C=E5=90=AF=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/QCListService.cs | 3 ++- .../Service/TrialSiteUser/DTO/UserTrialViewModel.cs | 4 ++++ .../Service/TrialSiteUser/TrialSiteService.cs | 10 ++++++++++ IRaCIS.Core.Domain/TrialSiteUser/TrialSite.cs | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index 8cbbe14bb..89841ef0d 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -451,7 +451,8 @@ namespace IRaCIS.Core.Application.Image.QA //.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState) .ProjectTo(_mapper.ConfigurationProvider); - var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent) + " desc", nameof(QCVisitViewModel.AuditState) +" asc" }; + var defalutSortArray = new string[] { nameof(QCVisitViewModel.IsUrgent) + " desc", nameof(QCVisitViewModel.SubjectId), nameof(QCVisitViewModel.VisitNum) }; + //var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent) + " desc", nameof(QCVisitViewModel.AuditState) +" asc" }; var pageList = await query.ToPagedListAsync(visitSearchDTO.PageIndex, visitSearchDTO.PageSize, visitSearchDTO.SortField, visitSearchDTO.Asc, string.IsNullOrWhiteSpace(visitSearchDTO.SortField), defalutSortArray); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs index 6e0e3fe84..69f2ddcde 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs @@ -228,8 +228,12 @@ namespace IRaCIS.Application.Contracts public DateTime? DeletedTime { get; set; } + public DateTime? EnabledTime { get; set; } + public DateTime UpdateTime { get; set; } + public DateTime CreateTime { get; set; } + public string Site { get; set; } = String.Empty; public string SiteCode { get; set; } = String.Empty; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs index f8f5ed306..31808a25a 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs @@ -278,6 +278,16 @@ namespace IRaCIS.Core.Application.Services _mapper.Map(editTrialSiteCommand, dbEntity); + if (editTrialSiteCommand.IsDeleted) + { + dbEntity.EnabledTime = null; + + } + else + { + dbEntity.EnabledTime = DateTime.Now; + } + await _trialSiteRepository.SaveChangesAsync(); return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Domain/TrialSiteUser/TrialSite.cs b/IRaCIS.Core.Domain/TrialSiteUser/TrialSite.cs index 3dc6ef9a7..26597de4b 100644 --- a/IRaCIS.Core.Domain/TrialSiteUser/TrialSite.cs +++ b/IRaCIS.Core.Domain/TrialSiteUser/TrialSite.cs @@ -22,6 +22,7 @@ namespace IRaCIS.Core.Domain.Models public bool IsDeleted { get; set; } public DateTime? DeletedTime { get; set; } + public DateTime? EnabledTime { get; set; } public Guid? DeleteUserId { get; set; } From 7e5cbd92b4649a558a44a9e266f0a202d8385590 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Feb 2024 09:36:03 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UploadDownLoadController.cs | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index 12f4630f5..f8a63c8a9 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -33,6 +33,7 @@ using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.StaticFiles; using Microsoft.AspNetCore.WebUtilities; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; using MiniExcelLibs; @@ -235,13 +236,17 @@ namespace IRaCIS.Core.API.Controllers public IUserInfo _userInfo { get; set; } private readonly IMediator _mediator; - private readonly IWebHostEnvironment _hostEnvironment; + + public IStringLocalizer _localizer { get; set; } + + + private readonly IWebHostEnvironment _hostEnvironment; private readonly IRepository _repository; private readonly IEasyCachingProvider _provider; private readonly QCCommon _qCCommon; - public StudyController(IMapper mapper, IUserInfo userInfo, IWebHostEnvironment hostEnvironment, IMediator mediator, IEasyCachingProvider provider, + public StudyController(IMapper mapper, IStringLocalizer localizer, IUserInfo userInfo, IWebHostEnvironment hostEnvironment, IMediator mediator, IEasyCachingProvider provider, QCCommon qCCommon, IRepository repository) { @@ -249,8 +254,8 @@ namespace IRaCIS.Core.API.Controllers _provider = provider; _hostEnvironment = hostEnvironment; _mediator = mediator; - - _mapper = mapper; + _localizer = localizer; + _mapper = mapper; _userInfo = userInfo; _repository = repository; } @@ -313,7 +318,7 @@ namespace IRaCIS.Core.API.Controllers string.IsNullOrEmpty(mediaTypeHeader.Boundary.Value)) { //---不支持的MediaType - return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_UnsupportedMedia")); + return ResponseOutput.NotOk(_localizer["UploadDownLoad_UnsupportedMedia"]); } var archiveStudyCommand = new ArchiveStudyCommand() { AbandonStudyId = abandonStudyId, StudyInstanceUid = studyInstanceUid, SubjectVisitId = subjectVisitId }; @@ -407,7 +412,7 @@ namespace IRaCIS.Core.API.Controllers _provider.Remove($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}"); //---请求异常,请重试! - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_RequestError")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_RequestError"]); } studyMonitor.FileSize = (decimal)HttpContext.Request.ContentLength; @@ -559,7 +564,7 @@ namespace IRaCIS.Core.API.Controllers if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".csv") && !fileName.EndsWith(".xls")) { //---支持.xlsx、.xls、.csv格式的文件上传。 - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_SupportedFormats")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_SupportedFormats"]); } fileStream.CopyTo(templateFileStream); @@ -609,7 +614,7 @@ namespace IRaCIS.Core.API.Controllers //if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors)); - if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.TemplateErrors)); + if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(_localizer["UploadDownLoad_TemplateErrors"]); etcCheckList = import.Data.ToList(); } @@ -697,7 +702,7 @@ namespace IRaCIS.Core.API.Controllers if (etcCheckList == null || etcCheckList.Count == 0) { //---请保证上传数据符合模板文件中的样式,且存在有效数据。 - return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_InvalidData")); + return ResponseOutput.NotOk(_localizer["UploadDownLoad_InvalidData"]); } else { @@ -718,7 +723,7 @@ namespace IRaCIS.Core.API.Controllers if (etcCheckList.Count == 0) { //---请保证上传数据符合模板文件中的样式,且存在有效数据。 - return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_InvalidData")); + return ResponseOutput.NotOk(_localizer["UploadDownLoad_InvalidData"]); } } @@ -962,13 +967,14 @@ namespace IRaCIS.Core.API.Controllers public IMapper _mapper { get; set; } public IUserInfo _userInfo { get; set; } private readonly IMediator _mediator; + public IStringLocalizer _localizer { get; set; } + private readonly IWebHostEnvironment _hostEnvironment; - private readonly IWebHostEnvironment _hostEnvironment; - - public UploadDownLoadController(IMapper mapper, IUserInfo userInfo, IMediator mediator, IWebHostEnvironment hostEnvironment) + public UploadDownLoadController(IMapper mapper, IUserInfo userInfo, IStringLocalizer localizer, IMediator mediator, IWebHostEnvironment hostEnvironment) { _hostEnvironment = hostEnvironment; - _mediator = mediator; + _localizer= localizer, + _mediator = mediator; _mapper = mapper; _userInfo = userInfo; } @@ -994,7 +1000,7 @@ namespace IRaCIS.Core.API.Controllers if (!realFileName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase)) { // 请用提供格式的模板excel上传需要处理的数据 - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_TemplateUploadData")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_TemplateUploadData"]); } var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/SiteSurvey", realFileName); @@ -1015,7 +1021,7 @@ namespace IRaCIS.Core.API.Controllers if (excelList.Any(t => string.IsNullOrWhiteSpace(t.TrialSiteCode) || string.IsNullOrWhiteSpace(t.FirstName) || string.IsNullOrWhiteSpace(t.LastName) || string.IsNullOrWhiteSpace(t.Email) || string.IsNullOrWhiteSpace(t.UserTypeStr))) { //请确保Excel中 每一行的 中心编号,姓名,邮箱,用户类型数据记录完整再进行上传 - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_EnsureCompleteData")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_EnsureCompleteData"]); } var siteCodeList = excelList.Select(t => t.TrialSiteCode.Trim().ToUpper()).Distinct().ToList(); @@ -1023,31 +1029,31 @@ namespace IRaCIS.Core.API.Controllers if (_trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode.ToUpper())).Count() != siteCodeList.Count) { //在项目中未找到该Excel中部分或全部中心 - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidCenters")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidCenters"]); } if (excelList.GroupBy(t => new { t.TrialSiteCode, t.UserTypeStr, t.Email }).Any(g => g.Count() > 1)) { // 同一邮箱,同一用户类型,只能生成一个账户,请核查Excel数据 - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_CheckDuplicateAccounts")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_CheckDuplicateAccounts"]); } if (excelList.Any(t => !t.Email.Contains("@"))) { //有邮箱不符合邮箱格式,请核查Excel数据 - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidEmail")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidEmail"]); } var generateUserTypeList = new List() { "CRC", "CRA" }; if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper()))) { //用户类型仅能为 CRC,SR,CRA 请核查Excel数据 - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_InvalidUserType")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidUserType"]); } if (excelList.Count == 0) { - throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_NoValiddata")); + throw new BusinessValidationFailedException(_localizer["UploadDownLoad_NoValiddata"]); } //处理好 用户类型 和用户类型枚举 var sysUserTypeList = _usertypeRepository.Where(t => t.UserTypeEnum == UserTypeEnum.CRA || t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { UserTypeId = t.Id, t.UserTypeEnum }).ToList(); From dfdb3b59514ae94491e9b899fdd469ca1613141a Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Feb 2024 11:19:33 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E7=97=85=E7=81=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LuganoCalculateService.cs | 36 ++++++++++++------- IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs | 6 +++- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index af600e2fc..40a9ce076 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1098,7 +1098,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate tableRowAnswers.ForEach(x => { - x.SplitOrMergeType = null; + x.SplitOrMergeType = x.SplitOrMergeType==SplitOrMergeType.Merge|| x.SplitOrMergeType == SplitOrMergeType.Merged? SplitOrMergeType.Merged : null; x.VisitTaskId = visitTaskId; x.IsCurrentTaskAdd = false; x.Id = NewId.NextGuid(); @@ -1173,20 +1173,32 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }); } - var tableAnswers = copyTableAnswers.Select(x => new ReadingTableQuestionAnswer + var tableAnswers = new List(); + // 处理状态 + + var mergedRowIds = tableRowAnswers.Where(x => x.SplitOrMergeType == SplitOrMergeType.Merged).Select(x => x.Id).ToList(); + copyTableAnswers.ForEach(x => { - Id = NewId.NextGuid(), - Answer = needCopyMarks.Contains(x.QuestionMark) ? x.Answer : string.Empty, - QuestionId = x.QuestionId, - RowIndex = x.RowIndex, - RowId = tableRowAnswers.Where(y => y.OriginalId == x.RowId).Select(x => x.Id).FirstOrDefault(), - TableQuestionId = x.TableQuestionId, - TrialId = x.TrialId, - VisitTaskId = visitTaskId, + var tableAnswer = new ReadingTableQuestionAnswer() + { + Id = NewId.NextGuid(), + Answer = needCopyMarks.Contains(x.QuestionMark) ? x.Answer : string.Empty, + QuestionId = x.QuestionId, + RowIndex = x.RowIndex, + RowId = tableRowAnswers.Where(y => y.OriginalId == x.RowId).Select(x => x.Id).FirstOrDefault(), + TableQuestionId = x.TableQuestionId, + TrialId = x.TrialId, + VisitTaskId = visitTaskId, + }; + if (mergedRowIds.Contains(tableAnswer.RowId) && x.QuestionMark == QuestionMark.State) + { + tableAnswer.Answer = TargetState.Loss.GetEnumInt(); + + } + tableAnswers.Add(tableAnswer); }); - - var questionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId).Select(x => new ReadingTaskQuestionMark() + var questionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId).Select(x => new ReadingTaskQuestionMark() { VisitTaskId= visitTaskId, FirstAddTaskId=x.FirstAddTaskId, diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index d492b9a32..6040c46b6 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -644,7 +644,7 @@ namespace IRaCIS.Core.Domain.Share Split = 0, /// - /// 合并 + /// 融合 /// Merge = 1, @@ -653,6 +653,10 @@ namespace IRaCIS.Core.Domain.Share /// SplitMain = 2, + /// + /// 融合过 再之前任务融合了 + /// + Merged=3, } /// From 8f4a6fcf80e31203044d23cb424844133f1692cf Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Feb 2024 11:20:04 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Controllers/UploadDownLoadController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index f8a63c8a9..711c0940d 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -973,7 +973,7 @@ namespace IRaCIS.Core.API.Controllers public UploadDownLoadController(IMapper mapper, IUserInfo userInfo, IStringLocalizer localizer, IMediator mediator, IWebHostEnvironment hostEnvironment) { _hostEnvironment = hostEnvironment; - _localizer= localizer, + _localizer = localizer; _mediator = mediator; _mapper = mapper; _userInfo = userInfo;