Excel 导表初步测试提交
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
7c246dcecd
commit
78c90734b2
|
@ -798,13 +798,6 @@
|
|||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialReadingCriterionCanExportDocumentList(System.Guid)">
|
||||
<summary>
|
||||
获取阅片标准可以导出的列表
|
||||
</summary>
|
||||
<param name="trialReadingCriterionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetOverallTumorEvaluationList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
整体肿瘤评估 (目前仅仅 RECIST1.1 多个标准一个接口 Excel 列是一样的 )
|
||||
|
@ -836,6 +829,13 @@
|
|||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialReadingCriterionCanExportDocumentList(System.Guid)">
|
||||
<summary>
|
||||
获取阅片标准可以导出的列表
|
||||
</summary>
|
||||
<param name="trialReadingCriterionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeEvaluationList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
裁判阅片明细表
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService
|
||||
{
|
||||
|
||||
|
@ -1590,6 +1590,14 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//评估病灶明细
|
||||
DetailedOfEvaluatedLesion = 3,
|
||||
|
||||
CommonReading_Export = 4,
|
||||
CommonReadingDetail_Export = 5,
|
||||
|
||||
CommonJudgeReadingDetail_Export = 6,
|
||||
|
||||
VisitJudgeRatio_Export = 7,
|
||||
|
||||
ReadingPeriodJudgeRatio_Export = 8,
|
||||
|
||||
}
|
||||
|
||||
|
@ -1756,7 +1764,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.OverallTumorEvaluation_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterion.CriterionType);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1997,16 +2005,33 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
{
|
||||
|
||||
var list = new List<ExportDocumentDes>();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstNotNullAsync();
|
||||
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReading_Export, ExportCatogory = ExportCatogory.OverallTumorEvaluation });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReadingDetail_Export, ExportCatogory = ExportCatogory.OverallTumorEvaluation });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonJudgeReadingDetail_Export, ExportCatogory = ExportCatogory.OverallTumorEvaluation });
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.VisitJudgeRatio_Export, ExportCatogory = ExportCatogory.OverallTumorEvaluation });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.ReadingPeriodJudgeRatio_Export, ExportCatogory = ExportCatogory.OverallTumorEvaluation });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReading_Export, ExportCatogory = ExportCatogory.CommonReading_Export });
|
||||
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReadingDetail_Export, ExportCatogory = ExportCatogory.CommonReadingDetail_Export });
|
||||
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonJudgeReadingDetail_Export, ExportCatogory = ExportCatogory.CommonJudgeReadingDetail_Export });
|
||||
|
||||
switch (criterion.ArbitrationRule)
|
||||
{
|
||||
case ArbitrationRule.None:
|
||||
break;
|
||||
|
||||
case ArbitrationRule.Visit:
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.VisitJudgeRatio_Export, ExportCatogory = ExportCatogory.VisitJudgeRatio_Export });
|
||||
|
||||
break;
|
||||
case ArbitrationRule.Reading:
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.ReadingPeriodJudgeRatio_Export, ExportCatogory = ExportCatogory.ReadingPeriodJudgeRatio_Export });
|
||||
|
||||
break;
|
||||
case ArbitrationRule.NA:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB)
|
||||
|
@ -2050,7 +2075,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
|
||||
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect && t.TaskState==TaskState.Freeze))
|
||||
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect && t.TaskState == TaskState.Freeze))
|
||||
|
||||
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
|
||||
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge))
|
||||
|
@ -2072,10 +2097,12 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
||||
.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider, new { readingExportType=inQuery.ReadingExportType, criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||
.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider, new { readingExportType = inQuery.ReadingExportType, criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
var export_Template = StaticData.Export.CommonReading_Export;
|
||||
|
||||
if (inQuery.ReadingExportType == ReadingExportType.JudgeReadingDetailResult)
|
||||
{
|
||||
//R1 R2 两个人的访视都阅片完成了才可以,去除只有一个人阅片完成的访视
|
||||
|
@ -2083,6 +2110,12 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//找到只有一个人阅片的受试者 和访视
|
||||
var exceptVisit = list.GroupBy(t => new { t.SubjectCode, t.TaskName }).Where(g => g.Count() == 1).Select(g => new { g.Key.SubjectCode, g.Key.TaskName }).ToList();
|
||||
list = list.Where(t => !exceptVisit.Any(ev => ev.SubjectCode == t.SubjectCode && ev.TaskName == t.TaskName)).ToList();
|
||||
|
||||
export_Template = StaticData.Export.CommonJudgeReadingDetail_Export;
|
||||
}
|
||||
if (inQuery.ReadingExportType == ReadingExportType.ReadingDetailResult)
|
||||
{
|
||||
export_Template = StaticData.Export.CommonReadingDetail_Export;
|
||||
}
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
@ -2094,17 +2127,20 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
var dynamicColumnConfig = new DynamicColumnConfig() { AutoColumnTitleRowIndex = 2, AutoColumnStartIndex = 6,
|
||||
var dynamicColumnConfig = new DynamicColumnConfig()
|
||||
{
|
||||
AutoColumnTitleRowIndex = 2,
|
||||
AutoColumnStartIndex = 6,
|
||||
TempalteLastColumnIndex = 8,
|
||||
DynamicItemDicName = "TranslateDicName",
|
||||
DynamicItemValueName = "QuestionValue",
|
||||
DynamicListName = "QuestionAnswerList",
|
||||
RemoveColunmIndexList = new List<int>() { 1, 7 },
|
||||
RemoveColunmIndexList = new List<int>() { },
|
||||
ColumnNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.QuestionName).ToList() ?? new List<string>(),
|
||||
TranslateDicNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.TranslateDicName).ToList() ?? new List<string>()
|
||||
};
|
||||
|
||||
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(StaticData.Export.CommonReading_Export, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
|
||||
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(export_Template, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
|
||||
|
||||
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
|
@ -2190,7 +2226,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//每次查询必须是单标准的
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
||||
Expression<Func<VisitTask, bool>> comonTaskFilter = u => u.TrialId == inQuery.TrialId && u.IsAnalysisCreate == false && u.TaskState == TaskState.Effect && u.TrialReadingCriterionId == trialReadingCriterionId;
|
||||
|
@ -2225,13 +2261,13 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
FullName = g.Key.FullName,
|
||||
|
||||
//访视产生裁判的访视数量
|
||||
TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.JudgeResultTaskId == t.Id).Count(),
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(doctorList, _userInfo.TimeZoneId);
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.VisitJudgeRatio_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment);
|
||||
|
|
Loading…
Reference in New Issue