diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs index 33903bba9..c287df5c3 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs @@ -485,7 +485,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Value=x }).ToList()); - var r1baseLine= alldata.TaskQuestions + var r1baseLine= r1.TaskQuestions .SelectMany(x => x.Childrens) .Where(x => x.QuestionType == QuestionType.ExistDisease) .SelectMany(x => x.Answer.Select(a => new EvaluationValue @@ -496,7 +496,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate .ToList(); - var r1data = alldata.TaskQuestions + var r1data = r1.TaskQuestions .SelectMany(x => x.Childrens) .Where(x => x.QuestionType == QuestionType.Tumor) .SelectMany(x => x.Answer.Select(a => new EvaluationValue @@ -516,7 +516,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (criterion.ReadingType == ReadingMethod.Double) { - var r2baseLine = alldata.TaskQuestions + var r2baseLine = r2.TaskQuestions .SelectMany(x => x.Childrens) .Where(x => x.QuestionType == QuestionType.ExistDisease) .SelectMany(x => x.Answer.Select(a => new EvaluationValue @@ -527,7 +527,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate .ToList(); - var r2data = alldata.TaskQuestions + var r2data = r2.TaskQuestions .SelectMany(x => x.Childrens) .Where(x => x.QuestionType == QuestionType.Tumor) .SelectMany(x => x.Answer.Select(a => new EvaluationValue @@ -552,18 +552,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate List BuildShowChartGroups(GetReadingReportEvaluationOutDto data, Arm arm) { var groups = new List(); - if (data.TaskQuestions == null || data.VisitTaskList == null) return groups; - foreach (var g in data.TaskQuestions) + if (alldata.TaskQuestions == null || alldata.VisitTaskList == null) return groups; + foreach (var g in alldata.TaskQuestions) { var items = g.Childrens?.Where(c => c.ShowChartTypeEnum != ShowChartType.NotShow).ToList() ?? new List(); if (items.Count == 0) continue; var chartList = new List(); foreach (var item in items) { + var itemdata= data.TaskQuestions.SelectMany(x => x.Childrens) + .Where(x => x.QuestionId == item.QuestionId) + .FirstOrDefault(); var cd = new ReportChartData { - Name = item.QuestionName, - Value = item.Answer?.Select(a => a.Answer).ToList() ?? new List() + Name = item?.QuestionName??string.Empty, + Value = itemdata?.Answer?.Select(a => a.Answer).ToList() ?? new List() }; chartList.Add(cd); }