+60
-2
@@ -1,4 +1,5 @@
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
@@ -252,7 +253,64 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
});
|
||||
return new GetReportsChartDataOutDto();
|
||||
|
||||
GetReportsChartDataOutDto result = new GetReportsChartDataOutDto()
|
||||
{
|
||||
VisitTaskNameList = data.VisitTaskList.Select(x => x.BlindName).ToList(),
|
||||
ChartDataList=new List<ChartData>() { },
|
||||
};
|
||||
|
||||
|
||||
result.VisitTaskNameList = data.VisitTaskList.Select(x => x.BlindName).ToList();
|
||||
if (inDto.QuestionId != null)
|
||||
{
|
||||
var question = data.TaskQuestions.SelectMany(x => x.Childrens)
|
||||
.Where(x => x.QuestionId == inDto.QuestionId.Value).FirstOrDefault();
|
||||
if (question != null)
|
||||
{
|
||||
ChartData chartData = new ChartData()
|
||||
{
|
||||
Name = question.QuestionName,
|
||||
Value = new List<string>(),
|
||||
};
|
||||
foreach (var answer in question.Answer)
|
||||
{
|
||||
chartData.Value.Add(answer.Answer);
|
||||
}
|
||||
result.ChartDataList.Add(chartData);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var lesion = data.TaskQuestions
|
||||
// 问题 靶病灶
|
||||
.SelectMany(x => x.Childrens)
|
||||
// 病灶
|
||||
.SelectMany(x => x.Childrens).Where(x=> x.RowIndex == inDto.RowIndex)
|
||||
// 表格问题
|
||||
.SelectMany(x => x.Childrens).Where(x => x.TableQuestionId == inDto.TableQuestionId)
|
||||
|
||||
.FirstOrDefault();
|
||||
|
||||
if (lesion != null)
|
||||
{
|
||||
ChartData chartData = new ChartData()
|
||||
{
|
||||
Name = lesion.QuestionName,
|
||||
Value = new List<string>(),
|
||||
};
|
||||
foreach (var answer in lesion.Answer)
|
||||
{
|
||||
chartData.Value.Add(answer.Answer);
|
||||
}
|
||||
result.ChartDataList.Add(chartData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user