From 7d708e03c772d6c5ce5dbe1e2016c229de1a3c8d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 22 Feb 2023 14:52:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= =?UTF-8?q?=E7=A0=94=E7=A9=B6=E6=96=B9=E6=A1=88=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 34 +++++++++---------- .../Service/QC/DTO/QCListViewModel.cs | 4 ++- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 112dd99cb..7ad680d53 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -75,7 +75,7 @@ namespace IRaCIS.Core.Application.Service.Common - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO)); } @@ -120,7 +120,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCImageChanllengeList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(QCChanllengeExportDto)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCImageChanllengeList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(QCChanllengeExportDto)); } @@ -153,7 +153,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository , _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository , _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO)); } @@ -189,7 +189,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO)); } @@ -237,7 +237,7 @@ namespace IRaCIS.Core.Application.Service.Common ModuleList = subject.ReadModuleList.Where(t=>t.TrialReadingCriterionId==dto.TrialReadingCriterionId).Select(t => new SubjectProgressDto.MouduleProgress() { TaskName = t.ModuleName, - VisitTaskNum = t.ReadingSetType == ReadingSetType.ImageReading ? ReadingCommon.TaskNumDic[ReadingCategory.Global] : ReadingCommon.TaskNumDic[ReadingCategory.Oncology] + t.SubjectVisit.VisitNum, + VisitTaskNum = (t.ReadingSetType == ReadingSetType.ImageReading ? ReadingCommon.TaskNumDic[ReadingCategory.Global] : ReadingCommon.TaskNumDic[ReadingCategory.Oncology]) + t.SubjectVisit.VisitNum, ReadingSetType = t.ReadingSetType, ReadingStatus = t.ModuleTaskList.Where(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && (t.ReadingCategory == ReadingCategory.Oncology || t.ReadingCategory == ReadingCategory.Global) && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() == (int)trialReadingCriterion.ReadingType ? ReadingStatusEnum.ReadCompleted : t.ModuleTaskList.Where(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && (t.ReadingCategory == ReadingCategory.Oncology || t.ReadingCategory == ReadingCategory.Global) && t.TaskAllocationState == TaskAllocationState.Allocated).Count() == (int)trialReadingCriterion.ReadingType ? @@ -328,7 +328,7 @@ namespace IRaCIS.Core.Application.Service.Common return new FileStreamResult(memoryStream2, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { - FileDownloadName = $"{exportInfo.TrialCode}_{exportInfo.CriterionName}_{fileName.Substring(startIndex: 0, fileName.LastIndexOf('.'))}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx" + FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName.Substring(startIndex: 0, fileName.LastIndexOf('.'))}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx" }; } @@ -358,7 +358,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectReadingPeriodList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadPeriodExportDto)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectReadingPeriodList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadPeriodExportDto)); } @@ -442,7 +442,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyExportDTO)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyExportDTO)); } @@ -476,7 +476,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectVisitCheckList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PMKCheckEXportDTO)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectVisitCheckList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PMKCheckEXportDTO)); } @@ -523,7 +523,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto)); } @@ -570,7 +570,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReReadingTaskList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReReadingTaskExportDto)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReReadingTaskExportDto)); } @@ -608,7 +608,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TaskMedicalReviewExportDto)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TaskMedicalReviewExportDto)); } @@ -687,7 +687,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.CriterionName = await _repository.Where(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync(); exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSelfAnalysisList_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SelftAnalysisExport)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSelfAnalysisList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SelftAnalysisExport)); } @@ -785,7 +785,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.CriterionName = await _repository.Where(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync(); exportInfo.List = newList; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialGroupAnalysisList_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(GroupAnalysisExport)); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialGroupAnalysisList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(GroupAnalysisExport)); } @@ -897,7 +897,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.OverallTumorEvaluation_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterion.CriterionType); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.OverallTumorEvaluation_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterion.CriterionType); } /// @@ -949,7 +949,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterion.CriterionType); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterion.CriterionType); } else @@ -1030,7 +1030,7 @@ namespace IRaCIS.Core.Application.Service.Common }).ToList(); exportInfo.List = exportList; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterion.CriterionType); + return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterion.CriterionType); } diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 737fd84dc..57dc78b8b 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -6,6 +6,7 @@ using MiniExcelLibs.Attributes; using Newtonsoft.Json; using System.ComponentModel; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; namespace IRaCIS.Core.Application.Contracts { @@ -392,9 +393,10 @@ namespace IRaCIS.Core.Application.Contracts public ReadingStatusEnum ReadingStatus { get; set; } - + //最终任务 + [Column(TypeName = "decimal(18,2)")] public decimal VisitTaskNum { get; set; } //访视会有 From e3519d47a6f3421d469562f4e53755ac8bdeec92 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 22 Feb 2023 16:22:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 40 ++++++++++++- .../Service/QC/DTO/QCListViewModel.cs | 56 +++++++++++++++++-- .../Service/QC/_MapConfig.cs | 21 +++++++ IRaCIS.Core.Domain/_Config/_StaticData.cs | 2 + 4 files changed, 113 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 7ad680d53..e146f52c8 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -831,6 +831,12 @@ namespace IRaCIS.Core.Application.Service.Common list.Add(new ExportDocumentDes() { Code = StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, ExportCatogory = ExportCatogory.DetailedOfEvaluatedLesion }); } + if(criterion.CriterionType == CriterionType.PCWG3) + { + list.Add(new ExportDocumentDes() { Code = StaticData.Export.OverallTumorEvaluation_Export, ExportCatogory = ExportCatogory.OverallTumorEvaluation }); + list.Add(new ExportDocumentDes() { Code = StaticData.Export.PCWG3Point1DetailedOfEvaluatedLesion_Export, ExportCatogory = ExportCatogory.DetailedOfEvaluatedLesion }); + } + var result = _repository.Where(t => list.Select(c => c.Code).Contains(t.Code)).Select(c => new ExportDocumentDes() { Code = c.Code, FileName = c.Name }).ToList(); foreach (var item in list) @@ -862,7 +868,7 @@ namespace IRaCIS.Core.Application.Service.Common //每次查询必须是单标准的 var criterion = await _repository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstOrDefaultAsync(); - if (criterion.CriterionType != CriterionType.RECIST1Pointt1) + if (criterion.CriterionType != CriterionType.RECIST1Pointt1 || criterion.CriterionType != CriterionType.PCWG3) { throw new Exception("当前标准导出还未支持"); } @@ -892,7 +898,7 @@ namespace IRaCIS.Core.Application.Service.Common var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException(); - exportInfo.CriterionName = await _repository.Where(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync(); + exportInfo.CriterionName = criterion.CriterionName; exportInfo.List = list; @@ -1028,11 +1034,41 @@ namespace IRaCIS.Core.Application.Service.Common return clone; }); }).ToList(); + exportInfo.List = exportList; return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterion.CriterionType); + } + else if (criterion.CriterionType == CriterionType.PCWG3) + { + var list = await query.ProjectTo(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, isEn_Us = _userInfo.IsEn_Us }).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.BodyPartDescription = u.BodyPartDescription; + + clone.LessionState = u.LessionState; + + return clone; + }); + }).ToList(); + + exportInfo.List = exportList; + + return await ExcelExportHelper.DataExportAsync(StaticData.Export.PCWG3Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PCWG3DetailedOfEvaluatedLesionExport), criterion.CriterionType); + } else diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 57dc78b8b..6a45b247f 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -383,7 +383,7 @@ namespace IRaCIS.Core.Application.Contracts public List ModuleList { get; set; } - public List TotalList => VisitList .OrderByDescending(t=>t.Inplan).Union(ModuleList.OrderBy(t=>t.ReadingSetType).ThenBy(t=>t.VisitTaskNum)).ToList(); + public List TotalList => VisitList.OrderByDescending(t => t.Inplan).Union(ModuleList.OrderBy(t => t.ReadingSetType).ThenBy(t => t.VisitTaskNum)).ToList(); public class MouduleProgress @@ -408,7 +408,7 @@ namespace IRaCIS.Core.Application.Contracts //阅片期会有 public ReadingSetType? ReadingSetType { get; set; } - } + } } @@ -686,7 +686,7 @@ namespace IRaCIS.Core.Application.Contracts public string AgainEvaluateResult { get; set; } = String.Empty; } - public class GroupAnalysisExport: AnalysisExortCommon + public class GroupAnalysisExport : AnalysisExortCommon { [DictionaryTranslateAttribute("ArmEnum")] @@ -708,7 +708,7 @@ namespace IRaCIS.Core.Application.Contracts } - public class SelftAnalysisExport: AnalysisExortCommon + public class SelftAnalysisExport : AnalysisExortCommon { //自身一致性分析任务特有 @@ -771,8 +771,56 @@ namespace IRaCIS.Core.Application.Contracts } + public class PCWG3LessionInfo + { + //病灶编号 + public string LessionCode { get; set; } + [DictionaryTranslateAttribute("LesionType")] + //病灶类型 + public string LessionType { get; set; } + + //所在部位 + public string LessionLocation { get; set; } + + + //部位描述 + public string BodyPartDescription { get; set; } + + + [DictionaryTranslateAttribute("TargetState")] + //病灶状态 + public string LessionState { get; set; } + } + + public class PCWG3DetailedOfEvaluatedLesionExport : OverallTumorEvaluationExport + { + + [JsonIgnore] + public List LesionList = new List(); + + //病灶编号 + public string LessionCode { get; set; } + + + [DictionaryTranslateAttribute("LesionType")] + //病灶类型 + public string LessionType { get; set; } + + //所在部位 + public string LessionLocation { get; set; } + + + //部位描述 + public string BodyPartDescription { get; set; } + + + [DictionaryTranslateAttribute("EvaluationOfState")] + //病灶状态 + public string LessionState { get; set; } + } + //RECIST1.1评估病灶明细表 diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 590db9481..7aad40019 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -219,6 +219,27 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.LessionState, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State).FirstOrDefault().Answer)); + CreateMap().IncludeBase() + .ForMember(o => o.LesionList, t => t.MapFrom(u => u.LesionList)); + + + CreateMap() + .ForMember(o => o.LessionCode, t => t.MapFrom(u => u.RowMark)) + .ForMember(o => o.LessionType, t => t.MapFrom(u => (int?)u.ReadingQuestionTrial.LesionType)) + + //位置可能是自己填写的 + .ForMember(o => o.LessionLocation, t => + //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Location).FirstOrDefault().Answer) + t.MapFrom(u => u.OrganInfo.IsCanEditPosition ? + u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Location).FirstOrDefault().Answer : isEn_Us ? u.OrganInfo.TULATEN : u.OrganInfo.TULAT) + ) + + .ForMember(o => o.BodyPartDescription, t => + //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Part).FirstOrDefault().Answer) + t.MapFrom(u => isEn_Us ? u.OrganInfo.PartEN : u.OrganInfo.Part) + ) + .ForMember(o => o.LessionState, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State).FirstOrDefault().Answer)); + #endregion diff --git a/IRaCIS.Core.Domain/_Config/_StaticData.cs b/IRaCIS.Core.Domain/_Config/_StaticData.cs index 99e2e894d..41cf031da 100644 --- a/IRaCIS.Core.Domain/_Config/_StaticData.cs +++ b/IRaCIS.Core.Domain/_Config/_StaticData.cs @@ -175,6 +175,8 @@ public static class StaticData public const string RECIST1Point1DetailedOfEvaluatedLesion_Export = "RECIST1Point1DetailedOfEvaluatedLesion_Export"; + public const string PCWG3Point1DetailedOfEvaluatedLesion_Export = "PCWG3Point1DetailedOfEvaluatedLesion_Export"; + From 4e4336c461ab75a83bd9defcdaeda6125b27da21 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 23 Feb 2023 08:55:09 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 4 ++-- .../Service/QC/DTO/QCListViewModel.cs | 10 +++++++++- IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 8 ++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index e146f52c8..f11c1996e 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -868,7 +868,7 @@ namespace IRaCIS.Core.Application.Service.Common //每次查询必须是单标准的 var criterion = await _repository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstOrDefaultAsync(); - if (criterion.CriterionType != CriterionType.RECIST1Pointt1 || criterion.CriterionType != CriterionType.PCWG3) + if (criterion.CriterionType != CriterionType.RECIST1Pointt1 && criterion.CriterionType != CriterionType.PCWG3) { throw new Exception("当前标准导出还未支持"); } @@ -1055,7 +1055,7 @@ namespace IRaCIS.Core.Application.Service.Common clone.LessionCode = u.LessionCode; clone.LessionType = u.LessionType; - + clone.LessionOrgan = u.LessionOrgan; clone.LessionLocation = u.LessionLocation; clone.BodyPartDescription = u.BodyPartDescription; diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 6a45b247f..3635d4e38 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -784,6 +784,10 @@ namespace IRaCIS.Core.Application.Contracts //所在部位 public string LessionLocation { get; set; } + //所在器官 + [DictionaryTranslate("OrganType")] + public string LessionOrgan { get; set; } + //部位描述 public string BodyPartDescription { get; set; } @@ -811,6 +815,10 @@ namespace IRaCIS.Core.Application.Contracts //所在部位 public string LessionLocation { get; set; } + //所在器官 + + public string LessionOrgan { get; set; } + //部位描述 public string BodyPartDescription { get; set; } @@ -849,7 +857,7 @@ namespace IRaCIS.Core.Application.Contracts //所在器官 - [DictionaryTranslate("OrganType")] + public string LessionOrgan { get; set; } //部位描述 public string BodyPartDescription { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 7aad40019..01c259078 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -205,7 +205,7 @@ namespace IRaCIS.Core.Application.Service ) .ForMember(o => o.LessionOrgan, t => //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Organ).FirstOrDefault().Answer) - t.MapFrom(u => isEn_Us ? (int?)u.OrganInfo.OrganType : (int?) u.OrganInfo.OrganType) + t.MapFrom(u => isEn_Us ? u.OrganInfo.TULOCEN : u.OrganInfo.TULOC) ) .ForMember(o => o.BodyPartDescription, t => //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Part).FirstOrDefault().Answer) @@ -233,7 +233,11 @@ namespace IRaCIS.Core.Application.Service t.MapFrom(u => u.OrganInfo.IsCanEditPosition ? u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Location).FirstOrDefault().Answer : isEn_Us ? u.OrganInfo.TULATEN : u.OrganInfo.TULAT) ) - + + .ForMember(o => o.LessionOrgan, t => + t.MapFrom(u => isEn_Us ? u.OrganInfo.TULOCEN : u.OrganInfo.TULOC) + ) + .ForMember(o => o.BodyPartDescription, t => //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Part).FirstOrDefault().Answer) t.MapFrom(u => isEn_Us ? u.OrganInfo.PartEN : u.OrganInfo.Part) From e836cd2daad4ffa726435d100b5d994d893e8fa5 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 23 Feb 2023 09:42:15 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 10 +++ .../Service/Common/ExcelExportService.cs | 69 +++++++++++++++++++ .../Service/QC/DTO/QCListViewModel.cs | 66 ++++++++++++++++++ IRaCIS.Core.Domain/_Config/_StaticData.cs | 2 + 4 files changed, 147 insertions(+) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index f54a1f2c1..b2b6cb602 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -479,6 +479,16 @@ + + + 影像上传监控表 + + + + + + + 阅片期信息表 diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index f11c1996e..cb47c580d 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -334,6 +334,75 @@ namespace IRaCIS.Core.Application.Service.Common } + /// + /// 影像上传监控表 + /// + /// + /// + /// + /// + /// + [HttpPost] + public async Task GetStudyUploadMonitor_Export(StudyQuery studyQuery, + [FromServices] IRepository _commonDocumentRepository, + [FromServices] IDictionaryService _dictionaryService, + [FromServices] IRepository _trialRepository) + { + + var svExpression = QCCommon.GetStudyMonitorSubjectVisitFilter(studyQuery.VisitPlanArray); + var StudyMonitorQuery = _repository.Where(t => t.TrialId == studyQuery.TrialId) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id)) + .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression) + .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo)) + .WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId) + .WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId) + .WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId) + .Select(t => new UnionStudyMonitorExportDto() + { + TrialSiteCode = t.TrialSite.TrialSiteCode, + TrialSiteAliasName = t.TrialSite.TrialSiteAliasName, + + SubjectCode = t.Subject.Code, + + + VisitName = t.SubjectVisit.VisitName, + + StudyCode = t.StudyCode, + + IsDicom = t.IsDicom, + + Uploader = t.Uploader.UserName, + + IP = t.IP, + + UploadStartTime = t.UploadStartTime, + + UploadFinishedTime = t.UploadFinishedTime, + + TotalMillisecondsInterval = t.TotalMillisecondsInterval, + + UploadTime = t.CreateTime, + + FileCount = t.FileCount, + FileSize = t.FileSize, + + IsDicomReUpload = t.IsDicomReUpload, + + IsSuccess = t.IsSuccess, + Note = t.Note, + }); + + var list = await StudyMonitorQuery.ToListAsync(); + + var exportInfo = (await _trialRepository.Where(t => t.Id == studyQuery.TrialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException(); + + exportInfo.List = list; + + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyUploadMonitor_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyMonitorExportDto)); + + + } + /// diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 3635d4e38..8b62a57f4 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -440,6 +440,72 @@ namespace IRaCIS.Core.Application.Contracts + } + + + public class UnionStudyMonitorExportDto + { + public string SubjectCode { get; set; } = String.Empty; + + public string VisitName { get; set; } = string.Empty; + + + public string TrialSiteCode { get; set; } = string.Empty; + + public string TrialSiteAliasName { get; set; } = string.Empty; + + public string Uploader { get; set; } = string.Empty; + + public DateTime UploadTime { get; set; } + + public string StudyCode { get; set; } + + + public bool IsDicom { get; set; } + + public string IsDicomStr => IsDicom ? "DICOM" : "Non-DICOM"; + + public string UploadStartTimeStr => UploadStartTime.ToString("yyyy-MM-dd HH:mm:ss.fff"); + public string UploadFinishedTimeStr => UploadFinishedTime.ToString("yyyy-MM-dd HH:mm:ss.fff"); + + + public double TotalMillisecondsInterval { get; set; } + + + public string TimeInterval + { + get + { + + var uploadTimeSpan = UploadFinishedTime - UploadStartTime; + + return $" {uploadTimeSpan.Hours}:{uploadTimeSpan.Minutes}:{uploadTimeSpan.Seconds}.{uploadTimeSpan.Milliseconds}"; + } + } + + public DateTime UploadStartTime { get; set; } + + + public DateTime UploadFinishedTime { get; set; } + + + public decimal FileSize { get; set; } + + public string FileSizeStr => $"{(FileSize / (decimal)Math.Pow(1024, 2)).ToString("F")}M"; + + public string IP { get; set; } = String.Empty; + + + public bool IsDicomReUpload { get; set; } + + + public int FileCount { get; set; } + + [DictionaryTranslateAttribute("YesOrNo")] + public bool IsSuccess { get; set; } = true; + + public string Note = string.Empty; + } public class UnionStudyExportDTO diff --git a/IRaCIS.Core.Domain/_Config/_StaticData.cs b/IRaCIS.Core.Domain/_Config/_StaticData.cs index 41cf031da..ac9372d2d 100644 --- a/IRaCIS.Core.Domain/_Config/_StaticData.cs +++ b/IRaCIS.Core.Domain/_Config/_StaticData.cs @@ -149,6 +149,8 @@ public static class StaticData public const string TrialStudyList_Export = "TrialStudyList_Export"; + public const string TrialStudyUploadMonitor_Export = "TrialStudyUploadMonitor_Export"; + public const string TrialSubjectVisitCheckList_Export = "TrialSubjectVisitCheckList_Export"; public const string TrialReadingTaskList_Export = "TrialReadingTaskList_Export"; From 18c81854d0625cf7449a84389de901674207d019 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 23 Feb 2023 11:37:22 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AF=BC=E8=A1=A8=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 | 9 ---- .../Service/Common/ExcelExportService.cs | 50 +++++++++---------- 2 files changed, 25 insertions(+), 34 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index b2b6cb602..744bf86e9 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -460,15 +460,6 @@ - - - 受试者 阅片期 进度表 导出 - - - - - - Subject 进展表 --new diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index cb47c580d..1749c0356 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -159,38 +159,38 @@ namespace IRaCIS.Core.Application.Service.Common - /// - /// 受试者 阅片期 进度表 导出 - /// - /// - /// - /// - /// - [HttpPost] - public async Task GetSubjectReadingPeriod_Export(GetReadModuleDto dto, - [FromServices] IRepository _commonDocumentRepository, - [FromServices] IDictionaryService _dictionaryService, - [FromServices] IRepository _trialRepository) - { + ///// + ///// 受试者 阅片期 进度表 导出 + ///// + ///// + ///// + ///// + ///// + //[HttpPost] + //public async Task GetSubjectReadingPeriod_Export(GetReadModuleDto dto, + // [FromServices] IRepository _commonDocumentRepository, + // [FromServices] IDictionaryService _dictionaryService, + // [FromServices] IRepository _trialRepository) + //{ - var list = await _repository.Where(u => u.TrialId == dto.TrialId) - .WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId) - .WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode != string.Empty, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode) - .WhereIf(dto.SubjectCode != null && dto.SubjectCode != string.Empty, x => x.Code == dto.SubjectCode) - //.WhereIf(dto.ReadingStatus != null, x => x.ReadingStatus == dto.ReadingStatus) + // var list = await _repository.Where(u => u.TrialId == dto.TrialId) + // .WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId) + // .WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode != string.Empty, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode) + // .WhereIf(dto.SubjectCode != null && dto.SubjectCode != string.Empty, x => x.Code == dto.SubjectCode) + // //.WhereIf(dto.ReadingStatus != null, x => x.ReadingStatus == dto.ReadingStatus) - .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + // .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.Code).ToList(); + // list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.Code).ToList(); - var exportInfo = (await _trialRepository.Where(t => t.Id == dto.TrialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException(); + // var exportInfo = (await _trialRepository.Where(t => t.Id == dto.TrialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException(); - exportInfo.List = list; + // exportInfo.List = list; - return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO)); - } + // return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO)); + //} @@ -964,7 +964,7 @@ namespace IRaCIS.Core.Application.Service.Common .WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1)) .ProjectTo(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType }).ToListAsync(); - + list= list.OrderBy(t=>t.SubjectCode).ThenBy(t=>t.VisitTaskNum).ToList(); var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException(); exportInfo.CriterionName = criterion.CriterionName;