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"; +