|
|
|
@@ -1,14 +1,22 @@
|
|
|
|
|
using DocumentFormat.OpenXml.Office2010.ExcelAc;
|
|
|
|
|
using DocumentFormat.OpenXml.Spreadsheet;
|
|
|
|
|
using IRaCIS.Application.Contracts;
|
|
|
|
|
using IRaCIS.Application.Interfaces;
|
|
|
|
|
using IRaCIS.Core.Application.Contracts;
|
|
|
|
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
|
|
|
|
using IRaCIS.Core.Application.ViewModel;
|
|
|
|
|
using IRaCIS.Core.Domain.Share;
|
|
|
|
|
using IRaCIS.Core.Infra.EFCore.Common;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using MiniExcelLibs;
|
|
|
|
|
using MiniExcelLibs.OpenXml;
|
|
|
|
|
using NPOI.HPSF;
|
|
|
|
|
using NPOI.HSSF.UserModel;
|
|
|
|
|
using NPOI.XSSF.UserModel;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
@@ -67,7 +75,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -112,7 +120,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCImageChanllengeList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(QCChanllengeExportDto));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCImageChanllengeList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(QCChanllengeExportDto));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -145,7 +153,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository , _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -181,10 +189,153 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Subject 进展表 --new
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dto"></param>
|
|
|
|
|
/// <param name="_commonDocumentRepository"></param>
|
|
|
|
|
/// <param name="_dictionaryService"></param>
|
|
|
|
|
/// <param name="_trialRepository"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<IActionResult> GetSubjectProgress_Export(SubjectProgressQuery dto,
|
|
|
|
|
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
|
|
|
|
[FromServices] IDictionaryService _dictionaryService,
|
|
|
|
|
[FromServices] IRepository<Trial> _trialRepository)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var query = from subject in _repository.Where<Subject>(u => u.TrialId == dto.TrialId)
|
|
|
|
|
join trialReadingCriterion in _repository.Where<ReadingQuestionCriterionTrial>(u => u.TrialId == dto.TrialId && u.IsConfirm && u.Id == dto.TrialReadingCriterionId) on subject.TrialId equals trialReadingCriterion.TrialId
|
|
|
|
|
|
|
|
|
|
select new SubjectProgressDto()
|
|
|
|
|
{
|
|
|
|
|
TrialSiteCode = subject.TrialSite.TrialSiteCode,
|
|
|
|
|
SubjectCode = subject.Code,
|
|
|
|
|
SubjectStatus = subject.Status,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VisitList = subject.SubjectVisitList.Where(t => t.VisitExecuted != VisitExecutedEnum.Unavailable).Select(t => new SubjectProgressDto.MouduleProgress()
|
|
|
|
|
{
|
|
|
|
|
TaskName = t.VisitName,
|
|
|
|
|
VisitTaskNum = t.VisitNum,
|
|
|
|
|
Inplan = t.InPlan,
|
|
|
|
|
IsFinalVisit = t.IsFinalVisit,
|
|
|
|
|
IsLostVisit = t.IsLostVisit,
|
|
|
|
|
ReadingStatus =
|
|
|
|
|
t.VisitTaskList.Where(t => t.TaskState == TaskState.Effect && t.TrialReadingCriterionId==dto.TrialReadingCriterionId && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() == (int)trialReadingCriterion.ReadingType ?
|
|
|
|
|
ReadingStatusEnum.ReadCompleted : t.VisitTaskList.Where(t => t.TaskState == TaskState.Effect && t.TrialReadingCriterionId == dto.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Visit && t.TaskAllocationState == TaskAllocationState.Allocated).Count() == (int)trialReadingCriterion.ReadingType ? ReadingStatusEnum.ImageReading :
|
|
|
|
|
t.ReadingStatus
|
|
|
|
|
}).ToList(),
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
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 ?
|
|
|
|
|
ReadingStatusEnum.ImageReading : t.ReadingStatus
|
|
|
|
|
}).ToList()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var list = query.ToList();
|
|
|
|
|
//.ProjectTo<SubjectProgressDto>(_mapper.ConfigurationProvider).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var exportInfo = (await _trialRepository.Where(t => t.Id == dto.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
exportInfo.CriterionName = await _repository.Where<ReadingQuestionCriterionTrial>(u => u.TrialId == dto.TrialId && u.IsConfirm && u.Id == dto.TrialReadingCriterionId).Select(t=>t.CriterionName).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(StaticData.Export.TrialSubjectProgressList_Export, exportInfo, /*"", */_commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectProgressDto));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用NPOI 进行二次处理
|
|
|
|
|
|
|
|
|
|
var wb = new XSSFWorkbook(memoryStream);
|
|
|
|
|
|
|
|
|
|
var sheet = wb.GetSheetAt(0);
|
|
|
|
|
|
|
|
|
|
foreach (var subject in list)
|
|
|
|
|
{
|
|
|
|
|
var index = list.IndexOf(subject);
|
|
|
|
|
var row = sheet.GetRow(index + 4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in subject.TotalList)
|
|
|
|
|
{
|
|
|
|
|
//从第五列开始动态写
|
|
|
|
|
var visitIndex = subject.TotalList.IndexOf(item) + 4;
|
|
|
|
|
|
|
|
|
|
var cell = row.CreateCell(visitIndex);
|
|
|
|
|
|
|
|
|
|
if (item.IsLostVisit == true)
|
|
|
|
|
{
|
|
|
|
|
cell.CellStyle = sheet.GetRow(1).GetCell(7).CellStyle;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
switch (item.ReadingStatus)
|
|
|
|
|
{
|
|
|
|
|
case ReadingStatusEnum.ImageNotSubmit:
|
|
|
|
|
|
|
|
|
|
cell.CellStyle = sheet.GetRow(1).GetCell(1).CellStyle;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case ReadingStatusEnum.ImageQuality:
|
|
|
|
|
cell.CellStyle = sheet.GetRow(1).GetCell(2).CellStyle;
|
|
|
|
|
break;
|
|
|
|
|
case ReadingStatusEnum.ConsistencyCheck:
|
|
|
|
|
cell.CellStyle = sheet.GetRow(1).GetCell(3).CellStyle;
|
|
|
|
|
break;
|
|
|
|
|
case ReadingStatusEnum.TaskAllocate:
|
|
|
|
|
cell.CellStyle = sheet.GetRow(1).GetCell(4).CellStyle;
|
|
|
|
|
break;
|
|
|
|
|
case ReadingStatusEnum.ImageReading:
|
|
|
|
|
cell.CellStyle = sheet.GetRow(1).GetCell(5).CellStyle;
|
|
|
|
|
break;
|
|
|
|
|
case ReadingStatusEnum.ReadCompleted:
|
|
|
|
|
cell.CellStyle = sheet.GetRow(1).GetCell(6).CellStyle;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cell.SetCellValue(item.TaskName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var memoryStream2 = new MemoryStream();
|
|
|
|
|
wb.Write(memoryStream2);
|
|
|
|
|
memoryStream2.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 阅片期信息表
|
|
|
|
|
/// </summary>
|
|
|
|
@@ -207,7 +358,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectReadingPeriodList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadPeriodExportDto));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectReadingPeriodList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadPeriodExportDto));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -291,7 +442,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyExportDTO));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyExportDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -325,7 +476,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectVisitCheckList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PMKCheckEXportDTO));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectVisitCheckList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PMKCheckEXportDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -372,7 +523,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -419,7 +570,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReReadingTaskList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReReadingTaskExportDto));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReReadingTaskList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReReadingTaskExportDto));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -457,7 +608,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TaskMedicalReviewExportDto));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TaskMedicalReviewExportDto));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -474,9 +625,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
[FromServices] IRepository<Trial> _trialRepository)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var criterionType = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
|
|
|
|
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
if (criterionType != CriterionType.RECIST1Pointt1)
|
|
|
|
|
if (criterion.CriterionType != CriterionType.RECIST1Pointt1)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("当前标准导出还未支持");
|
|
|
|
|
}
|
|
|
|
@@ -533,9 +684,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
exportInfo.CriterionName = await _repository.Where<ReadingQuestionCriterionTrial>(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, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SelftAnalysisExport));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSelfAnalysisList_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SelftAnalysisExport));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -550,9 +702,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
[FromServices] IDictionaryService _dictionaryService,
|
|
|
|
|
[FromServices] IRepository<Trial> _trialRepository)
|
|
|
|
|
{
|
|
|
|
|
var criterionType = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
|
|
|
|
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
if (criterionType != CriterionType.RECIST1Pointt1)
|
|
|
|
|
if (criterion.CriterionType != CriterionType.RECIST1Pointt1)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("当前标准导出还未支持");
|
|
|
|
|
}
|
|
|
|
@@ -630,10 +782,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
exportInfo.CriterionName = await _repository.Where<ReadingQuestionCriterionTrial>(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, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(GroupAnalysisExport));
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialGroupAnalysisList_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(GroupAnalysisExport));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -643,14 +795,14 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
public string FileName { get; set; }
|
|
|
|
|
|
|
|
|
|
public ExportCatogory ExportCatogory { get;set; }
|
|
|
|
|
public ExportCatogory ExportCatogory { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public enum ExportCatogory
|
|
|
|
|
{
|
|
|
|
|
// 整体肿瘤评估
|
|
|
|
|
OverallTumorEvaluation =1,
|
|
|
|
|
// 整体肿瘤评估
|
|
|
|
|
OverallTumorEvaluation = 1,
|
|
|
|
|
|
|
|
|
|
//肿瘤疗效评估
|
|
|
|
|
EvaluationOfTumorEfficacy = 2,
|
|
|
|
@@ -670,16 +822,16 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = new List<ExportDocumentDes>();
|
|
|
|
|
var criterionType = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == trialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
|
|
|
|
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
if (criterionType == CriterionType.RECIST1Pointt1)
|
|
|
|
|
if (criterion.CriterionType == CriterionType.RECIST1Pointt1)
|
|
|
|
|
{
|
|
|
|
|
list.Add( new ExportDocumentDes() { Code= StaticData.Export.OverallTumorEvaluation_Export ,ExportCatogory=ExportCatogory.OverallTumorEvaluation} );
|
|
|
|
|
list.Add(new ExportDocumentDes() { Code = StaticData.Export.OverallTumorEvaluation_Export, ExportCatogory = ExportCatogory.OverallTumorEvaluation });
|
|
|
|
|
list.Add(new ExportDocumentDes() { Code = StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, ExportCatogory = ExportCatogory.EvaluationOfTumorEfficacy });
|
|
|
|
|
list.Add(new ExportDocumentDes() { Code = StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, ExportCatogory = ExportCatogory.DetailedOfEvaluatedLesion });
|
|
|
|
|
list.Add(new ExportDocumentDes() { Code = StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, ExportCatogory = ExportCatogory.DetailedOfEvaluatedLesion });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var result = _repository.Where<CommonDocument>(t => list.Select(c=>c.Code).Contains(t.Code)).Select(c => new ExportDocumentDes() { Code = c.Code, FileName = c.Name }).ToList();
|
|
|
|
|
var result = _repository.Where<CommonDocument>(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)
|
|
|
|
|
{
|
|
|
|
@@ -708,9 +860,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//每次查询必须是单标准的
|
|
|
|
|
var criterionType = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
|
|
|
|
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
if (criterionType != CriterionType.RECIST1Pointt1)
|
|
|
|
|
if (criterion.CriterionType != CriterionType.RECIST1Pointt1)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("当前标准导出还未支持");
|
|
|
|
|
}
|
|
|
|
@@ -735,16 +887,17 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
|
|
|
|
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
|
|
|
|
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
|
|
|
|
.ProjectTo<OverallTumorEvaluationExport>(_mapper.ConfigurationProvider, new { criterionType = criterionType }).ToListAsync();
|
|
|
|
|
.ProjectTo<OverallTumorEvaluationExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType }).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
exportInfo.CriterionName = await _repository.Where<ReadingQuestionCriterionTrial>(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.OverallTumorEvaluation_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterionType);
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.OverallTumorEvaluation_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterion.CriterionType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@@ -764,7 +917,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//每次查询必须是单标准的
|
|
|
|
|
var criterionType = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
|
|
|
|
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName} ).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
var query = _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
|
|
|
|
|
|
|
|
@@ -788,15 +941,15 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1));
|
|
|
|
|
|
|
|
|
|
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
exportInfo.CriterionName = criterion.CriterionName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (criterionType == CriterionType.RECIST1Pointt1)
|
|
|
|
|
if (criterion.CriterionType == CriterionType.RECIST1Pointt1)
|
|
|
|
|
{
|
|
|
|
|
var list = await query.ProjectTo<RECIST1Point1EvaluationOfTumorEfficacyExport>(_mapper.ConfigurationProvider, new { criterionType = criterionType }).ToListAsync();
|
|
|
|
|
var list = await query.ProjectTo<RECIST1Point1EvaluationOfTumorEfficacyExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType }).ToListAsync();
|
|
|
|
|
|
|
|
|
|
exportInfo.List = list;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterionType);
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.TrialCode}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterion.CriterionType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
@@ -821,7 +974,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//每次查询必须是单标准的
|
|
|
|
|
var criterionType = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
|
|
|
|
var criterion = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName }).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
var query = _repository.Where<VisitTask>(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
|
|
|
|
|
|
|
|
@@ -845,11 +998,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1));
|
|
|
|
|
|
|
|
|
|
var exportInfo = (await _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
exportInfo.CriterionName = criterion.CriterionName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (criterionType == CriterionType.RECIST1Pointt1)
|
|
|
|
|
if (criterion.CriterionType == CriterionType.RECIST1Pointt1)
|
|
|
|
|
{
|
|
|
|
|
var list = await query.ProjectTo<RECIST1Point1DetailedOfEvaluatedLesionExport>(_mapper.ConfigurationProvider, new { criterionType = criterionType, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
|
|
|
|
var list = await query.ProjectTo<RECIST1Point1DetailedOfEvaluatedLesionExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var exportList = list.SelectMany(c =>
|
|
|
|
@@ -877,7 +1030,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|
|
|
|
}).ToList();
|
|
|
|
|
exportInfo.List = exportList;
|
|
|
|
|
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterionType);
|
|
|
|
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.TrialCode}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterion.CriterionType);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|