Uat_Study
he 2022-09-01 16:05:14 +08:00
parent 4d0e15f755
commit 5efabe1875
1 changed files with 8 additions and 4 deletions

View File

@ -152,7 +152,7 @@ namespace IRaCIS.Application.Services
{
var criterionId = await _readingQuestionCriterionTrialRepository.Where(x => x.IsConfirm && x.TrialId == inDto.TrialId).Select(x => x.Id).FirstOrDefaultAsync();
var questions = await _readingQuestionTrialRepository.Where(x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == criterionId)
var questions = await _readingQuestionTrialRepository.Where(x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == criterionId&&(x.Type=="table"||x.Type== "group"))
.ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
@ -170,13 +170,17 @@ namespace IRaCIS.Application.Services
private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item,List<DicomReadingQuestionAnswer> questions,List<ReadingTaskQuestionAnswer> answers)
{
item.Answer = answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
item.Childrens = questions.Where(x => x.ParentId == item.Id || (x.GroupName == item.GroupName && x.ParentId == null)).ToList();
item.Childrens = questions.Where(x => x.ParentId == item.Id||((item.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == item.GroupName)) ).ToList();
if (item.Childrens != null && item.Childrens.Count > 0)
{
foreach (var question in item.Childrens)
{
GetDicomReadingAnswer(question, questions, answers);
}
}
}
/// <summary>
/// 获取阅片报告
/// </summary>