From 65d3a0ecd9a83288732f465c429b9f86635b983e Mon Sep 17 00:00:00 2001 From: "{872297557@qq.com}" <872297557@qq.com> Date: Mon, 26 Dec 2022 16:01:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E8=87=B4=E6=80=A7?= =?UTF-8?q?=E5=88=86=E6=9E=90=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Allocation/TaskConsistentRuleService.cs | 9 ++-- .../Service/QC/DTO/QCListViewModel.cs | 49 ++++++++++++++++++- .../Service/QC/QCListService.cs | 26 +++++++++- .../Service/QC/QCOperationService.cs | 22 --------- .../Service/QC/_MapConfig.cs | 6 +++ IRaCIS.Core.Domain/Allocation/VisitTask.cs | 13 +++++ 6 files changed, 96 insertions(+), 29 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index f0a73953..a5cee136 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -149,8 +149,9 @@ namespace IRaCIS.Core.Application.Service var blindSubjectCode = string.Empty; - var subjectTask = _visitTaskRepository.Where(t => t.SubjectId == subject.SubjectId && t.TrialReadingCriterionId==trialReadingCriterionId && t.IsSelfAnalysis == true).OrderByDescending(t => t.BlindSubjectCode).FirstOrDefault().IfNullThrowException(); - if (subjectTask.BlindSubjectCode != String.Empty) + var subjectTask = _visitTaskRepository.Where(t => t.SubjectId == subject.SubjectId && t.TrialReadingCriterionId==trialReadingCriterionId && t.IsSelfAnalysis == true).OrderByDescending(t => t.BlindSubjectCode).FirstOrDefault(); + + if (subjectTask!=null && subjectTask.BlindSubjectCode != String.Empty) { blindSubjectCode = subjectTask.BlindSubjectCode; } @@ -299,8 +300,8 @@ namespace IRaCIS.Core.Application.Service var blindSubjectCode = string.Empty; - var subjectTask = _visitTaskRepository.Where(t => t.SubjectId == subject.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsSelfAnalysis==false).OrderByDescending(t => t.BlindSubjectCode).FirstOrDefault().IfNullThrowException(); - if (subjectTask.BlindSubjectCode != String.Empty) + var subjectTask = _visitTaskRepository.Where(t => t.SubjectId == subject.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsSelfAnalysis==false).OrderByDescending(t => t.BlindSubjectCode).FirstOrDefault(); + if (subjectTask != null && subjectTask.BlindSubjectCode != String.Empty) { blindSubjectCode = subjectTask.BlindSubjectCode; } diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 367fa425..fe17d7d6 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -2,6 +2,7 @@ using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; +using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts @@ -355,7 +356,7 @@ namespace IRaCIS.Core.Application.Contracts [DictionaryTranslateAttribute("Subject_Visit_Status")] public SubjectStatus SubjectStatus { get; set; } - public string TrialReadingCriterionName { get; set; } + public string TrialReadingCriterionName { get; set; } public DateTime? FirstGiveMedicineTime { get; set; } @@ -667,9 +668,16 @@ namespace IRaCIS.Core.Application.Contracts } + + + //RECIST1.1评估病灶明细表 + public class RECIST1Point1DetailedOfEvaluatedLesionExport : RECIST1Point1EvaluationOfTumorEfficacyExport { + //EF 查询 需要 最后转成导表需要的展开形式 + [JsonIgnore] + public List LesionList = new List(); //病灶编号 public string LessionCode { get; set; } @@ -694,6 +702,45 @@ namespace IRaCIS.Core.Application.Contracts public string MeasurementResult { get; set; } + //长径 + public string LongDiameter { get; set; } + + //短径 + public string ShortDiameter { get; set; } + + //病灶状态 + public string LessionState { get; set; } + + } + + + + + public class RECIST1Point1LessionInfo + { + //病灶编号 + public string LessionCode { get; set; } + + + //病灶类型 + public string LessionType { get; set; } + + //所在部位 + public string LessionLocation { get; set; } + + //所在器官 + public string LessionOrgan { get; set; } + + //是否淋巴结 + public string IsLymph { get; set; } + + //部位描述 + public string BodyPartDescription { get; set; } + + //测量值 + public string MeasurementResult { get; set; } + + //长径 public string LongDiameter { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index 83bf387d..f75551c6 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -744,11 +744,33 @@ namespace IRaCIS.Core.Application.Image.QA if (criterionType == CriterionType.RECIST1Pointt1) { - var list = await query.ProjectTo(_mapper.ConfigurationProvider, new { criterionType = criterionType }).ToListAsync(); + var list = await query.ProjectTo(_mapper.ConfigurationProvider, new { criterionType = criterionType }).ToListAsync(); + + var exportList = list.SelectMany(c => + { + + return c.LesionList.Select(u => + { + var clone = c.Clone(); + clone.LessionCode = u.LessionCode; + clone.LessionType = u.LessionType; + clone.LessionLocation = u.LessionLocation; + clone.LessionOrgan = u.LessionOrgan; + clone.IsLymph = u.IsLymph; + + clone.BodyPartDescription = u.BodyPartDescription; + clone.MeasurementResult = u.MeasurementResult; + clone.LongDiameter = u.LongDiameter; + clone.ShortDiameter = u.ShortDiameter; + clone.LessionState = u.LessionState; + + return clone; + }); + }); exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterionType); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterionType); } diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 631aceba..7d1404ab 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -1280,32 +1280,10 @@ namespace IRaCIS.Core.Application.Image.QA } - #region CRC 上传的基线数据签名 已移动 - //var subjectVisit =await _subjectVisitRepository.Where(x => cRCRequestToQCCommand.SubjectVisitIds.Contains(x.Id) && x.IsBaseLine).Select(x => new - //{ - // x.Id, - // x.IsBaseLine - //}).FirstOrDefaultAsync(); - //if (subjectVisit != null) - //{ - // await _readingClinicalDataRepository.BatchUpdateNoTrackingAsync(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == subjectVisit.Id, x => new ReadingClinicalData() - // { - // IsSign = true - // }); - //} - - - - #endregion - var success = await _repository.SaveChangesAsync(); - - - - return ResponseOutput.Ok(success); diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index a71e2353..790fb86a 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -159,6 +159,12 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)); + CreateMap().IncludeBase() + .ForMember(o => o.LesionList, t => t.MapFrom(u => u.LesionList)) ; + + CreateMap(); + //.ForMember(o => o.LessionCode, t => t.MapFrom(u => u.Subject.Code)) + #endregion diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index 74f2b48a..20bebc85 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -226,10 +226,23 @@ namespace IRaCIS.Core.Domain.Models public Trial Trial { get; set; } + + + //影像质量 等等第一层级问题答案 [JsonIgnore] public List ReadingTaskQuestionAnswerList { get; set; } = new List(); + //病灶表 + [JsonIgnore] + public List LesionList { get; set; } = new List(); + + //病灶答案表 + [JsonIgnore] + public List LesionAnswerList { get; set; } = new List(); + + + //重阅或者退回影像的记录中间表 [JsonIgnore] public List TaskInfluenceList { get; set; } = new List();