From 2de504005e74cb13fe99d625584ef21bcdfd696b Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Aug 2024 17:15:01 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7=E5=88=86?= =?UTF-8?q?=E6=9E=90=E5=AE=8C=E5=85=A8=E9=9A=8F=E6=9C=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskHelpeService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 3be59de67..a2b7f630b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -1431,6 +1431,7 @@ namespace IRaCIS.Core.Application.Service case GenerateTaskCategory.SelfConsistent: var readingCriterionId = generateTaskCommand.GenerataConsistentTaskList.First().TrialReadingCriterionId; + var isReadingTaskViewInOrder = await _trialReadingCriterionRepository.Where(t => t.Id == readingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstNotNullAsync(); var subjectId = generateTaskCommand.GenerataConsistentTaskList.First().SubjectId; //var trialReadingCriterion=_trialReadingCriterionRepository.Where(t=>t.Id== trialReadingCriterionId).FirstOrDefault(); @@ -1473,7 +1474,11 @@ namespace IRaCIS.Core.Application.Service foreach (var task in generateTaskCommand.GenerataConsistentTaskList) { - var exsitPDF = await _readingClinicalDataRepository.AnyAsync(t => t.TrialId == trialId && + + + var exsitPDF = await _readingClinicalDataRepository + .WhereIf(isReadingTaskViewInOrder== ReadingOrder.Random,t=>t.ReadingId== task.SouceReadModuleId|| t.ReadingId == task.SourceSubjectVisitId) + .AnyAsync(t => t.TrialId == trialId && t.SubjectId== task.SubjectId&& t.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == readingCriterionId) From f744124f17e4c5470ba8b7d6238f4ab5713a3cfd Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Aug 2024 17:23:31 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B7=BB=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/Allocation/DTO/TaskConsistentRuleViewModel.cs | 5 ++++- IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs index 0a566607e..d9470af0a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs @@ -33,7 +33,10 @@ namespace IRaCIS.Core.Application.ViewModel public class TaskConsistentRuleBasic : TaskConsistentRuleAddOrEdit { - + /// + /// 任务展示访视 读片任务显示是否顺序 + /// + public ReadingOrder IsReadingTaskViewInOrder { get; set; } = ReadingOrder.InOrder; } public class SubjectGeneratedTask diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 00dc9b3ef..f56b27d40 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -293,7 +293,8 @@ namespace IRaCIS.Core.Application.Service //CreateMap() // .ForMember(o => o.GeneratedSubjectCount, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(t => t.IsAnalysisCreate && t.TaskConsistentRuleId == u.Id).Select(t => t.SubjectId).Distinct().Count())) ; - CreateMap(); + CreateMap() + .ForMember(o => o.IsReadingTaskViewInOrder, t => t.MapFrom(u => u.TrialReadingCriterion.IsReadingTaskViewInOrder)); CreateMap(); From 7a6cfc897886406eb61bc4afbc77b8dfeafe2663 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 21 Aug 2024 17:26:15 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=BD=B1=E5=83=8F=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/_MapConfig.cs | 1 + .../Service/Visit/PatientService.cs | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs index 5b3886fee..8e41acc53 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs @@ -90,6 +90,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.IsReading, t => t.MapFrom(u => u.DicomSerie.IsReading)); CreateMap(); CreateMap(); + CreateMap(); diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 2953f522f..cea8434bb 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -69,6 +69,43 @@ namespace IRaCIS.Application.Services } + + public async Task>> GetPatientSeriesList(Guid scpStudyId, + [FromServices] IRepository _seriesRepository, + [FromServices] IRepository _instanceRepository + ) + { + + var seriesList = await _seriesRepository.Where(s => s.StudyId == scpStudyId).OrderBy(s => s.SeriesNumber). + ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) + .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + var instanceList = await _instanceRepository.Where(s => s.StudyId == scpStudyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) + .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) + .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber }).ToListAsync();//.GroupBy(u => u.SeriesId); + + foreach (var series in seriesList) + { + + series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => + new InstanceBasicInfo() + { + Id = k.Id, + NumberOfFrames = k.NumberOfFrames, + //HtmlPath = string.Empty, + Path = k.Path, + InstanceNumber = k.InstanceNumber, + + }).ToList(); + } + + var study = await _scpStudyRepository.FindAsync(scpStudyId); + + return ResponseOutput.Ok(seriesList, study); + } + + + /// /// scp 影像推送记录表 /// From 95728c668cacd5a23b2e261fcd823903c02ba2af Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Aug 2024 17:30:41 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/TaskConsistentRuleService.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index 77e0a2737..c18405e5c 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -34,6 +34,7 @@ namespace IRaCIS.Core.Application.Service private readonly IRepository _taskConsistentRuleRepository; private readonly IRepository _visitTaskRepository; private readonly IRepository _readingConsistentClinicalDataRepository; + private readonly IRepository _trialReadingCriterionRepository; private readonly IReadingClinicalDataService _readingClinicalDataService; private readonly IRepository _subjectUserRepository; private readonly IRepository _subjectRepository; @@ -49,6 +50,7 @@ namespace IRaCIS.Core.Application.Service public TaskConsistentRuleService(IRepository visitTaskRepository, IRepository readingConsistentClinicalDataRepository, + IRepository trialReadingCriterionRepository, IReadingClinicalDataService readingClinicalDataService, IRepository enrollRepository, IRepository taskConsistentRuleRepository, IRepository subjectUserRepository, IRepository subjectRepository, IDistributedLockProvider distributedLockProvider, IRepository trialRepository, IRepository trialSiteRepository, IRepository trialVirtualSiteCodeUpdateRepository, IVisitTaskHelpeService visitTaskCommonService) @@ -56,6 +58,7 @@ namespace IRaCIS.Core.Application.Service _taskConsistentRuleRepository = taskConsistentRuleRepository; _visitTaskRepository = visitTaskRepository; this._readingConsistentClinicalDataRepository = readingConsistentClinicalDataRepository; + this._trialReadingCriterionRepository = trialReadingCriterionRepository; this._readingClinicalDataService = readingClinicalDataService; _subjectUserRepository = subjectUserRepository; _subjectRepository = subjectRepository; @@ -782,9 +785,11 @@ namespace IRaCIS.Core.Application.Service [HttpPost] - public async Task GetConsistentRule(TaskConsistentRuleQuery inQuery) + public async Task<(TaskConsistentRuleBasic?,object)> GetConsistentRule(TaskConsistentRuleQuery inQuery) { - return await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == inQuery.IsSelfAnalysis && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(); + return (await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == inQuery.IsSelfAnalysis && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(), + await _trialReadingCriterionRepository.Where(x=>x.Id==inQuery.TrialReadingCriterionId).Select(x=>x.IsReadingTaskViewInOrder).FirstNotNullAsync() + ); } /// From 4dfe5a1dce561726646cb6be2825e34e2e64a005 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Aug 2024 17:35:15 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/TaskConsistentRuleService.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index c18405e5c..345a65d9b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -787,8 +787,13 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task<(TaskConsistentRuleBasic?,object)> GetConsistentRule(TaskConsistentRuleQuery inQuery) { - return (await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == inQuery.IsSelfAnalysis && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(), - await _trialReadingCriterionRepository.Where(x=>x.Id==inQuery.TrialReadingCriterionId).Select(x=>x.IsReadingTaskViewInOrder).FirstNotNullAsync() + + var IsReadingTaskViewInOrder = await _trialReadingCriterionRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstNotNullAsync(); + var result = await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == inQuery.IsSelfAnalysis && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(); + return (result, + new { + IsReadingTaskViewInOrder= IsReadingTaskViewInOrder, + } ); } From a78c4de654e45bb2c108a3d94b7f6a07e9cd04c3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Aug 2024 17:39:19 +0800 Subject: [PATCH 6/7] =?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/DTO/TaskConsistentRuleViewModel.cs | 4 ---- IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs index d9470af0a..6dd8a45a8 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs @@ -33,10 +33,6 @@ namespace IRaCIS.Core.Application.ViewModel public class TaskConsistentRuleBasic : TaskConsistentRuleAddOrEdit { - /// - /// 任务展示访视 读片任务显示是否顺序 - /// - public ReadingOrder IsReadingTaskViewInOrder { get; set; } = ReadingOrder.InOrder; } public class SubjectGeneratedTask diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index f56b27d40..00dc9b3ef 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -293,8 +293,7 @@ namespace IRaCIS.Core.Application.Service //CreateMap() // .ForMember(o => o.GeneratedSubjectCount, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(t => t.IsAnalysisCreate && t.TaskConsistentRuleId == u.Id).Select(t => t.SubjectId).Distinct().Count())) ; - CreateMap() - .ForMember(o => o.IsReadingTaskViewInOrder, t => t.MapFrom(u => u.TrialReadingCriterion.IsReadingTaskViewInOrder)); + CreateMap(); CreateMap(); From 0f45729c9401c633b1902f325738405f17286912 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 21 Aug 2024 17:48:22 +0800 Subject: [PATCH 7/7] =?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/DTO/TaskConsistentRuleViewModel.cs | 9 ++++++++- .../Service/Allocation/TaskConsistentRuleService.cs | 12 ++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs index 6dd8a45a8..9f73b9a4a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs @@ -287,7 +287,14 @@ namespace IRaCIS.Core.Application.ViewModel } - + public class GetConsistentRuleOut + { + public TaskConsistentRuleBasic? ConsistentRuleBasic { get; set; } + /// + /// 任务展示访视 读片任务显示是否顺序 + /// + public ReadingOrder IsReadingTaskViewInOrder { get; set; } = ReadingOrder.InOrder; + } ///TaskConsistentRuleQuery 列表查询参数模型 public class TaskConsistentRuleQuery diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index 345a65d9b..c914ee5be 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -785,16 +785,16 @@ namespace IRaCIS.Core.Application.Service [HttpPost] - public async Task<(TaskConsistentRuleBasic?,object)> GetConsistentRule(TaskConsistentRuleQuery inQuery) + public async Task GetConsistentRule(TaskConsistentRuleQuery inQuery) { var IsReadingTaskViewInOrder = await _trialReadingCriterionRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstNotNullAsync(); var result = await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == inQuery.IsSelfAnalysis && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(); - return (result, - new { - IsReadingTaskViewInOrder= IsReadingTaskViewInOrder, - } - ); + return new GetConsistentRuleOut() + { + ConsistentRuleBasic = result, + IsReadingTaskViewInOrder = IsReadingTaskViewInOrder + }; } ///