修改可导出列表接口

Test.EIImageViewer
hang 2023-02-15 11:40:30 +08:00
parent cf0bf46f7e
commit a4396c07d9
1 changed files with 28 additions and 6 deletions

View File

@ -640,6 +640,23 @@ namespace IRaCIS.Core.Application.Service.Common
public string Code { get; set; }
public string FileName { get; set; }
public ExportCatogory ExportCatogory { get;set; }
}
public enum ExportCatogory
{
// 整体肿瘤评估
OverallTumorEvaluation =1,
//肿瘤疗效评估
EvaluationOfTumorEfficacy = 2,
//评估病灶明细
DetailedOfEvaluatedLesion = 3,
}
/// <summary>
@ -650,19 +667,24 @@ namespace IRaCIS.Core.Application.Service.Common
public async Task<List<ExportDocumentDes>> GetTrialReadingCriterionCanExportDocumentList(Guid trialReadingCriterionId)
{
var list = new List<string>();
var list = new List<ExportDocumentDes>();
var criterionType = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.Id == trialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
if (criterionType == CriterionType.RECIST1Pointt1)
{
list.Add(StaticData.Export.OverallTumorEvaluation_Export);
list.Add(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export);
list.Add(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export);
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 });
}
var result = _repository.Where<CommonDocument>(t => list.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();
return result;
foreach (var item in list)
{
item.FileName = result.Where(t => t.Code == item.Code).FirstOrDefault()?.FileName;
}
return list;
}