Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
558258fd89
|
@ -422,6 +422,7 @@ public static class ExcelExportHelper
|
|||
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
||||
{
|
||||
titelRow.CreateCell(i + 1);
|
||||
templateRow.CreateCell(i + 1);
|
||||
}
|
||||
//移动Title 和下面的模板标识
|
||||
|
||||
|
@ -501,8 +502,8 @@ public static class ExcelExportHelper
|
|||
|
||||
var iteObjDic = itemObj.ToDictionary();
|
||||
|
||||
var itemDicName = iteObjDic[dynamicColumnConfig.DynamicItemDicName].ToString();
|
||||
var itemValue = iteObjDic[dynamicColumnConfig.DynamicItemValueName].ToString();
|
||||
var itemDicName = iteObjDic[dynamicColumnConfig.DynamicItemDicName]?.ToString();
|
||||
var itemValue = iteObjDic[dynamicColumnConfig.DynamicItemValueName]?.ToString();
|
||||
|
||||
if (itemDicName.IsNotNullOrEmpty())
|
||||
{
|
||||
|
|
|
@ -798,27 +798,6 @@
|
|||
<param name="_trialRepository"></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 列是一样的 )
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetEvaluationOfTumorEfficacy_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)
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetDetailedOfEvaluatedLesion_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 RECIST1.1 PGW3 表都是不同的)
|
||||
|
@ -829,16 +808,6 @@
|
|||
<param name="_trialRepository"></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>
|
||||
裁判阅片明细表
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialReadingCriterionCanExportDocumentList(System.Guid)">
|
||||
<summary>
|
||||
获取阅片标准可以导出的列表
|
||||
|
@ -848,7 +817,7 @@
|
|||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonEvaluationList_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>
|
||||
通用阅片结果、阅片结果明细,裁判明细表导出,条件通过 ReadingExportType ( 0,1,2)区分
|
||||
阅片结果表、阅片结果明细,评估病灶明细表, 裁判明细表导出,条件通过 ReadingExportType ( 1,2,3,4)区分
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
|
@ -14873,6 +14842,11 @@
|
|||
组件一致性和原Arm2是否有差异
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.CommonLessionExport.LessionAnswerList">
|
||||
<summary>
|
||||
最终导出的病灶信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.GetNextCRCChallengeInDto.QCChallengeId">
|
||||
<summary>
|
||||
QCChallengeId
|
||||
|
|
|
@ -464,7 +464,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public string? RequestReReadingReason { get; set; }
|
||||
|
||||
public ReadingExportType ReadingExportType { get; set; }
|
||||
public ExportResult? ReadingExportType { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -476,7 +476,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
ReadingDetailResult=1,
|
||||
|
||||
JudgeReadingDetailResult=2
|
||||
JudgeReadingDetailResult=2,
|
||||
|
||||
LessionDetail=3
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.POIFS.Properties;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System.Globalization;
|
||||
using static IRaCIS.Core.Application.Service.ExcelExportHelper;
|
||||
|
@ -1576,41 +1577,44 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
public string FileName { get; set; }
|
||||
|
||||
public ExportCatogory ExportCatogory { get; set; }
|
||||
public ExportResult ExportCatogory { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public enum ExportCatogory
|
||||
{
|
||||
// 整体肿瘤评估
|
||||
OverallTumorEvaluation = 1,
|
||||
//// 整体肿瘤评估
|
||||
//OverallTumorEvaluation = 1,
|
||||
|
||||
//肿瘤疗效评估
|
||||
EvaluationOfTumorEfficacy = 2,
|
||||
////肿瘤疗效评估
|
||||
//EvaluationOfTumorEfficacy = 2,
|
||||
|
||||
////评估病灶明细
|
||||
//DetailedOfEvaluatedLesion = 3,
|
||||
|
||||
//阅片结果
|
||||
CommonReading_Export = 1,
|
||||
|
||||
//阅片结果明细
|
||||
CommonReadingDetail_Export = 2,
|
||||
|
||||
//评估病灶明细
|
||||
DetailedOfEvaluatedLesion = 3,
|
||||
|
||||
//阅片结果
|
||||
CommonReading_Export = 4,
|
||||
|
||||
//阅片结果明细
|
||||
CommonReadingDetail_Export = 5,
|
||||
|
||||
//裁判阅片明细
|
||||
CommonJudgeReadingDetail_Export = 6,
|
||||
CommonJudgeReadingDetail_Export = 4,
|
||||
|
||||
//访视一致率
|
||||
VisitJudgeRatio_Export = 7,
|
||||
VisitJudgeRatio_Export = 5,
|
||||
|
||||
//阅片期一致率
|
||||
ReadingPeriodJudgeRatio_Export = 8,
|
||||
ReadingPeriodJudgeRatio_Export = 6,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<T> DealJudgeMark<T>(ArbitrationRule arbitrationRule, IEnumerable<T> list) where T : OverallTumorEvaluationExport
|
||||
public List<T> DealJudgeMark<T>(ArbitrationRule arbitrationRule, IEnumerable<T> list) where T : CommonEvaluationExport
|
||||
{
|
||||
//处理访视任务的裁判标记
|
||||
var resultExceptJudgeList = list.Where(t => t.ReadingCategory != ReadingCategory.Judge).ToList();
|
||||
|
@ -1705,175 +1709,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 整体肿瘤评估 (目前仅仅 RECIST1.1 多个标准一个接口 Excel 列是一样的 )
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> GetOverallTumorEvaluationList_Export(VisitTaskQuery inQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
if (criterion.CriterionType != CriterionType.RECIST1Point1
|
||||
&& criterion.CriterionType != CriterionType.PCWG3
|
||||
&& criterion.CriterionType != CriterionType.RECIST1Pointt1_MB
|
||||
&& criterion.CriterionType != CriterionType.Lugano2014 /*&& criterion.CriterionType != CriterionType.Lugano2014WithoutPET*/
|
||||
&& criterion.CriterionType != CriterionType.IRECIST1Point1)
|
||||
{
|
||||
//---当前标准导出还未支持
|
||||
throw new Exception(_localizer["ExcelExport_UnsupportedExport"]);
|
||||
}
|
||||
|
||||
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect)
|
||||
|
||||
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
|
||||
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge))
|
||||
//.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
//.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
//.WhereIf(inQuery.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.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<OverallTumorEvaluationExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId }).ToListAsync();
|
||||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
exportInfo.CriterionName = criterion.CriterionName;
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.OverallTumorEvaluation_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterion.CriterionType);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 肿瘤疗效评估表 ( 目前仅仅 RECIST1.1)
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> GetEvaluationOfTumorEfficacy_Export(VisitTaskQuery inQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstOrDefaultAsync();
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
|
||||
//.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
//.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
//.WhereIf(inQuery.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.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));
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
exportInfo.CriterionName = criterion.CriterionName;
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB)
|
||||
{
|
||||
var list = await query.ProjectTo<RECIST1Point1EvaluationOfTumorEfficacyExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId }).ToListAsync();
|
||||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterion.CriterionType);
|
||||
}
|
||||
|
||||
else if (criterion.CriterionType == CriterionType.Lugano2014 /*|| criterion.CriterionType == CriterionType.Lugano2014WithoutPET*/)
|
||||
{
|
||||
var list = await query.ProjectTo<Lugano2014EvaluationOfTumorEfficacyExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId }).ToListAsync();
|
||||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.Lugano2014EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(Lugano2014EvaluationOfTumorEfficacyExport), criterion.CriterionType);
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.IRECIST1Point1)
|
||||
{
|
||||
var list = await query.ProjectTo<IRECIST1Point1EvaluationOfTumorEfficacyExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId }).ToListAsync();
|
||||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.IRECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(IRECIST1Point1EvaluationOfTumorEfficacyExport), criterion.CriterionType);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//---当前标准导出还未支持
|
||||
throw new Exception(_localizer["ExcelExport_UnsupportedExport"]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region 历史单独导出废弃
|
||||
/// <summary>
|
||||
/// 评估病灶明细表 (目前仅仅 RECIST1.1 RECIST1.1 PGW3 表都是不同的)
|
||||
/// </summary>
|
||||
|
@ -1944,7 +1780,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}).ToList();
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
//list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(exportList, _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
@ -1978,7 +1814,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}).ToList();
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
//list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(exportList, _userInfo.TimeZoneId); ;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
@ -1996,6 +1832,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -2004,72 +1845,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
#region 通用阅片结果导出
|
||||
|
||||
/// <summary>
|
||||
/// 裁判阅片明细表
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Obsolete]
|
||||
public async Task<IActionResult> GetCommonJudgeEvaluationList_Export(VisitTaskQuery inQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
//每次查询必须是单标准的
|
||||
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)
|
||||
|
||||
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
|
||||
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge))
|
||||
//.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
//.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||
//.WhereIf(inQuery.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.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 { 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 exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
exportInfo.CriterionName = criterion.CriterionName;
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
|
||||
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, ColumnNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.QuestionName).ToList() };
|
||||
|
||||
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(StaticData.Export.CommonJudgeReadingDetail_Export, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
|
||||
|
||||
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
{
|
||||
FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取阅片标准可以导出的列表
|
||||
/// </summary>
|
||||
|
@ -2082,11 +1858,19 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
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.CommonReading_Export, ExportCatogory = ExportCatogory.CommonReading_Export });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReading_Export, ExportCatogory = ExportResult.TableOfAssessmentResults });
|
||||
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReadingDetail_Export, ExportCatogory = ExportCatogory.CommonReadingDetail_Export });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonReadingDetail_Export, ExportCatogory = ExportResult.DetailedTableOfAssessmentResults });
|
||||
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonJudgeReadingDetail_Export, ExportCatogory = ExportResult.DetailedTableOfAdjudicationResults });
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|
||||
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014
|
||||
|| criterion.CriterionType == CriterionType.Lugano2014WithoutPET || criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.ReadingLession_Export, ExportCatogory = ExportResult.DetailedTableOfLesions });
|
||||
}
|
||||
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CommonJudgeReadingDetail_Export, ExportCatogory = ExportCatogory.CommonJudgeReadingDetail_Export });
|
||||
|
||||
switch (criterion.ArbitrationRule)
|
||||
{
|
||||
|
@ -2094,11 +1878,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
break;
|
||||
|
||||
case ArbitrationRule.Visit:
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.VisitJudgeRatio_Export, ExportCatogory = ExportCatogory.VisitJudgeRatio_Export });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.VisitJudgeRatio_Export, ExportCatogory = ExportResult.VisitJudgeRatio_Export });
|
||||
|
||||
break;
|
||||
case ArbitrationRule.Reading:
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.ReadingPeriodJudgeRatio_Export, ExportCatogory = ExportCatogory.ReadingPeriodJudgeRatio_Export });
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.ReadingPeriodJudgeRatio_Export, ExportCatogory = ExportResult.ReadingPeriodJudgeRatio_Export });
|
||||
|
||||
break;
|
||||
case ArbitrationRule.NA:
|
||||
|
@ -2141,7 +1925,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通用阅片结果、阅片结果明细,裁判明细表导出,条件通过 ReadingExportType ( 0,1,2)区分
|
||||
/// 阅片结果表、阅片结果明细,评估病灶明细表, 裁判明细表导出,条件通过 ReadingExportType ( 1,2,3,4)区分
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
|
@ -2158,7 +1942,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 query = _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)
|
||||
|
@ -2175,14 +1959,16 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.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)
|
||||
.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider, new { readingExportType = inQuery.ReadingExportType, criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate);
|
||||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
var list = new List<CommonEvaluationExport>();
|
||||
|
||||
#region 区分导表类型
|
||||
|
||||
var export_Template = StaticData.Export.CommonReading_Export;
|
||||
|
||||
if (inQuery.ReadingExportType == ReadingExportType.JudgeReadingDetailResult)
|
||||
if (inQuery.ReadingExportType == ExportResult.DetailedTableOfAdjudicationResults)
|
||||
{
|
||||
//R1 R2 两个人的访视都阅片完成了才可以,去除只有一个人阅片完成的访视
|
||||
|
||||
|
@ -2190,12 +1976,120 @@ 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)
|
||||
else if (inQuery.ReadingExportType == ExportResult.DetailedTableOfAssessmentResults)
|
||||
{
|
||||
//阅片明细表
|
||||
export_Template = StaticData.Export.CommonReadingDetail_Export;
|
||||
}
|
||||
else if (inQuery.ReadingExportType == ExportResult.DetailedTableOfLesions)
|
||||
{
|
||||
//病灶明细表
|
||||
export_Template = StaticData.Export.ReadingLession_Export;
|
||||
}
|
||||
|
||||
if (inQuery.ReadingExportType != ExportResult.DetailedTableOfLesions)
|
||||
{
|
||||
list = await query.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider,
|
||||
new
|
||||
{
|
||||
readingExportType = inQuery.ReadingExportType,
|
||||
criterionType = criterion.CriterionType,
|
||||
arbitrationRule = criterion.ArbitrationRule,
|
||||
trialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||
isEn_Us = _userInfo.IsEn_Us
|
||||
}).ToListAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
var taskList = await query.ProjectTo<CommonLessionExport>(_mapper.ConfigurationProvider,
|
||||
new
|
||||
{
|
||||
readingExportType = inQuery.ReadingExportType,
|
||||
criterionType = criterion.CriterionType,
|
||||
arbitrationRule = criterion.ArbitrationRule,
|
||||
trialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||
isEn_Us = _userInfo.IsEn_Us
|
||||
}).ToListAsync();
|
||||
|
||||
//动态列,以不同的病灶配置的问题取并集
|
||||
var lessionAnserList = taskList.Where(t => t.LesionList.Count() > 0).FirstOrDefault()?.LesionList.FirstOrDefault()?.LessionAnswerList ?? new List<CommonLessionQuestionAnswerInfo>();
|
||||
|
||||
var dynamicExtraAddTitleList = new List<DymamicQuestionInfo>();
|
||||
|
||||
if (lessionAnserList.Count() > 0)
|
||||
{
|
||||
var lessionInfo = lessionAnserList.First();
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|
||||
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
dynamicExtraAddTitleList.Add(new DymamicQuestionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion ID" : "病灶编号" });
|
||||
dynamicExtraAddTitleList.Add(new DymamicQuestionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型" });
|
||||
}
|
||||
else if(criterion.CriterionType== CriterionType.PCWG3)
|
||||
{
|
||||
dynamicExtraAddTitleList.Add(new DymamicQuestionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型" });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//通过问题标识取并集
|
||||
|
||||
var dynamicLessionTitleList = lessionAnserList.Select(t => new DymamicQuestionInfo { QuestionMark = t.QuestionMark, QuestionName = t.QuestionName, TranslateDicName = t.TranslateDicName }).Distinct();
|
||||
var dynamicTitleList = dynamicExtraAddTitleList.Union(dynamicLessionTitleList).ToList();
|
||||
|
||||
//最终的病灶列表
|
||||
list = new List<CommonEvaluationExport>();
|
||||
|
||||
|
||||
foreach (var item in taskList)
|
||||
{
|
||||
|
||||
foreach (var lession in item.LesionList)
|
||||
{
|
||||
var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault() ?? new CommonLessionQuestionAnswerInfo();
|
||||
|
||||
var addLessionInfoList = new List<CommonQuesionInfo>();
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|
||||
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
//病灶编号 和病灶类型没有配置,但是需要有的
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion ID" : "病灶编号", QuestionValue = firstLessionAnser.LessionCode });
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = firstLessionAnser.LessionType, TranslateDicName = "LesionType" });
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = firstLessionAnser.LessionType, TranslateDicName = "LesionType" });
|
||||
}
|
||||
|
||||
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName });
|
||||
|
||||
|
||||
//有三部分组成 外层问题+ 没有配置的编号和类型+ 动态的表格问题
|
||||
var dynamicLessionInfoList = addLessionInfoList.Union(dynamicPartialLessionInfoList).Union(item.QuestionAnswerList).ToList();
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
exportInfo.CriterionName = criterion.CriterionName;
|
||||
|
@ -2206,7 +2100,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
#region 系统标准处理整体肿瘤评估合并
|
||||
|
||||
var translateDicNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.TranslateDicName).ToList();
|
||||
var translateDicNameList = list.SelectMany(t => t.QuestionAnswerList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
||||
|
||||
//针对1.1 整体肿瘤评估 有的两列要合并一列
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB || criterion.CriterionType == CriterionType.IRECIST1Point1)
|
||||
|
@ -2274,7 +2168,6 @@ 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);
|
||||
|
||||
|
@ -2292,13 +2185,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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")
|
||||
{
|
||||
FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
|
|
|
@ -1057,6 +1057,12 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class DymamicQuestionInfo
|
||||
{
|
||||
public QuestionMark? QuestionMark { get; set; }
|
||||
public string QuestionName { get; set; }
|
||||
public string TranslateDicName { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class CommonQuesionInfo
|
||||
|
@ -1069,9 +1075,90 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public string TranslateDicName { get; set; }
|
||||
}
|
||||
public class CommonEvaluationExport : OverallTumorEvaluationExport
|
||||
public class CommonEvaluationExport
|
||||
{
|
||||
public List<CommonQuesionInfo> QuestionAnswerList { get; set; }
|
||||
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid? DoctorUserId { get; set; }
|
||||
|
||||
public string TaskName { get; set; }
|
||||
public string TaskBlindName { get; set; }
|
||||
|
||||
public decimal VisitTaskNum { get; set; }
|
||||
|
||||
public bool? IsBaseline { get; set; }
|
||||
|
||||
|
||||
[DictionaryTranslateAttribute("ArmEnum")]
|
||||
public Arm ArmEnum { get; set; }
|
||||
public string UserName { get; set; }
|
||||
|
||||
public ReadingTaskState ReadingTaskState { get; set; }
|
||||
|
||||
public ReadingCategory ReadingCategory { get; set; }
|
||||
|
||||
//裁判结果选择的访视或者全局任务Id
|
||||
public Arm? JudgeArmEnum { get; set; }
|
||||
|
||||
//裁判选择标记
|
||||
//根据裁判的任务结果 设置访视任务的这个字段 该字段表示 裁判认同该任务的结果
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool? IsJudgeSelect { get; set; }
|
||||
|
||||
|
||||
//在当前访视触发裁判,或者在截止日期小于等于当前访视的阅片期触发裁判
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsTrigerJudge { get; set; }
|
||||
|
||||
//(如果是访视点裁判,则仅在所选阅片人对应访视 显示;如果是阅片期裁判,则在所选阅片人 阅片期内的所有访视 显示此原因)
|
||||
public string JudgeNote { get; set; } = string.Empty;
|
||||
|
||||
public string VisitNote { get; set; }
|
||||
}
|
||||
|
||||
public class CommonLessionExport : CommonEvaluationExport
|
||||
{
|
||||
/// <summary>
|
||||
/// 最终导出的病灶信息
|
||||
/// </summary>
|
||||
public List<CommonLessionQuestionAnswerInfo> LessionAnswerList { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public List<CommonLessionInfo> LesionList { get; set; } = new List<CommonLessionInfo>();
|
||||
}
|
||||
|
||||
public class CommonLessionInfo
|
||||
{
|
||||
//病灶编号
|
||||
public string LessionCode { get; set; }
|
||||
|
||||
public string LessionType { get; set; }
|
||||
|
||||
//病灶答案
|
||||
public List<CommonLessionQuestionAnswerInfo> LessionAnswerList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class CommonLessionQuestionAnswerInfo
|
||||
{
|
||||
public string LessionCode { get; set; }
|
||||
|
||||
public string LessionType { get; set; }
|
||||
|
||||
|
||||
public QuestionMark? QuestionMark { get; set; }
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
|
||||
public string QuestionValue { get; set; }
|
||||
|
||||
public string TranslateDicName { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -1146,7 +1233,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
|
||||
//在当前访视触发裁判,或者在截止日期小于等于当前访视的阅片期触发裁判
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsTrigerJudge { get; set; }
|
||||
|
||||
//(如果是访视点裁判,则仅在所选阅片人对应访视 显示;如果是阅片期裁判,则在所选阅片人 阅片期内的所有访视 显示此原因)
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
Guid trialReadingCriterionId = Guid.Empty;
|
||||
ArbitrationRule? arbitrationRule = null;
|
||||
CriterionType? criterionType = null;
|
||||
ReadingExportType? readingExportType = null;
|
||||
ExportResult readingExportType = ExportResult.None;
|
||||
|
||||
CreateMap<VisitTask, OverallTumorEvaluationExport>()
|
||||
// .ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
|
||||
|
@ -242,10 +242,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
.ForMember(o => o.QuestionAnswerList, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList
|
||||
.Where(c => readingExportType == ReadingExportType.ReadingResult ?
|
||||
c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.TableOfAssessmentResults).ToString()) :
|
||||
(readingExportType == ReadingExportType.ReadingDetailResult ? c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.DetailedTableOfAssessmentResults).ToString()) :
|
||||
c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.DetailedTableOfAdjudicationResults).ToString())))
|
||||
.Where(c => c.ReadingQuestionTrial.ExportResultStr.Contains(((int)readingExportType).ToString()))
|
||||
.OrderBy(k => k.ReadingQuestionTrial.ShowOrder)
|
||||
.Select(c => new CommonQuesionInfo()
|
||||
{
|
||||
|
@ -256,6 +253,23 @@ namespace IRaCIS.Core.Application.Service
|
|||
})))
|
||||
;
|
||||
|
||||
CreateMap<VisitTask, CommonLessionExport>().IncludeBase<VisitTask, CommonEvaluationExport>()
|
||||
.ForMember(o => o.LesionList, t => t.MapFrom(u => u.LesionList));
|
||||
|
||||
CreateMap<ReadingTableAnswerRowInfo, CommonLessionInfo>()
|
||||
.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.LessionAnswerList, t => t.MapFrom(u => u.LesionAnswerList));
|
||||
|
||||
CreateMap<ReadingTableQuestionAnswer, CommonLessionQuestionAnswerInfo>()
|
||||
.ForMember(o => o.LessionCode, t => t.MapFrom(u => u.Lesion.RowMark))
|
||||
.ForMember(o => o.LessionType, t => t.MapFrom(u => (int?)u.ReadingQuestionTrial.LesionType))
|
||||
.ForMember(o => o.QuestionMark, t => t.MapFrom(u => u.ReadingTableQuestionTrial.QuestionMark))
|
||||
.ForMember(o => o.QuestionName, t => t.MapFrom(u => isEn_Us ? u.ReadingTableQuestionTrial.QuestionEnName : u.ReadingTableQuestionTrial.QuestionName))
|
||||
.ForMember(o => o.QuestionValue, t => t.MapFrom(u => u.Answer))
|
||||
.ForMember(o => o.TranslateDicName, t => t.MapFrom(u => u.ReadingTableQuestionTrial.DictionaryCode))
|
||||
;
|
||||
|
||||
|
||||
CreateMap<VisitTask, RECIST1Point1EvaluationOfTumorEfficacyExport>().IncludeBase<VisitTask, OverallTumorEvaluationExport>()
|
||||
.ForMember(o => o.TargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion).FirstOrDefault()!.Answer))
|
||||
|
|
|
@ -420,20 +420,37 @@ namespace IRaCIS.Core.Domain.Share
|
|||
/// </summary>
|
||||
DetailedTableOfAssessmentResults = 2,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 评估病灶明细表
|
||||
/// </summary>
|
||||
DetailedTableOfLesions = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 裁判阅片明细表
|
||||
/// </summary>
|
||||
DetailedTableOfAdjudicationResults = 3,
|
||||
DetailedTableOfAdjudicationResults = 4,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自身一致性分析结果表
|
||||
/// </summary>
|
||||
DetailedTableOfIntraReaderAnalysisResults = 4,
|
||||
DetailedTableOfIntraReaderAnalysisResults = 5,
|
||||
|
||||
/// <summary>
|
||||
/// 组间一致性分析结果表
|
||||
/// </summary>
|
||||
DetailedTableOfInterReaderAnalysisResults = 5,
|
||||
DetailedTableOfInterReaderAnalysisResults = 6,
|
||||
|
||||
|
||||
//访视一致率
|
||||
VisitJudgeRatio_Export = 7,
|
||||
|
||||
//阅片期一致率
|
||||
ReadingPeriodJudgeRatio_Export = 8,
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -42,9 +42,6 @@ public class VisitTask : BaseFullAuditEntity
|
|||
[JsonIgnore]
|
||||
public List<ReadingTableAnswerRowInfo> LesionList { get; set; } = new List<ReadingTableAnswerRowInfo>();
|
||||
|
||||
[Comment("病灶答案表")]
|
||||
[JsonIgnore]
|
||||
public List<ReadingTableQuestionAnswer> LesionAnswerList { get; set; } = new List<ReadingTableQuestionAnswer>();
|
||||
[Comment("重阅或者退回影像的记录中间表")]
|
||||
[JsonIgnore]
|
||||
public List<TaskInfluence> TaskInfluenceList { get; set; } = new List<TaskInfluence>();
|
||||
|
|
|
@ -272,6 +272,8 @@ public static class StaticData
|
|||
|
||||
public const string ReadingPeriodJudgeRatio_Export = "ReadingPeriodJudgeRatio_Export";
|
||||
|
||||
public const string ReadingLession_Export = "ReadingLession_Export";
|
||||
|
||||
|
||||
public const string IVUSTheMeasuredValueOfEachMatchedFragment = "IVUS_TheMeasuredValueOfEachMatchedFragment";
|
||||
|
||||
|
|
Loading…
Reference in New Issue