From 1679b6b406af9973fca1b9e3034205050955bf7b Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 30 Jun 2023 09:27:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClinicalData/ClinicalQuestionService.cs | 13 ++++++++++--- .../Service/Reading/Dto/ClinicalQuestionDto.cs | 14 ++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs index 79dde8334..ff56af219 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs @@ -104,7 +104,10 @@ namespace IRaCIS.Core.Application.Service public void FindChildQuestion(ClinicalQuestionPreviewDto item, List questions, List tableQuestions,List answers, List tableAnswers) { item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).ToList(); - item.Answer = answers.Where(x => x.QuestionId == item.Id).Select(x => x.Answer).FirstOrDefault()??string.Empty; + + item.RelationQuestions = questions.Where(x => x.RelevanceId == item.Id).ToList(); + + item.Answer = answers.Where(x => x.QuestionId == item.Id).Select(x => x.Answer).FirstOrDefault()??string.Empty; var tableIndexs = tableAnswers.Where(x => x.QuestionId == item.Id).Select(x => x.RowIndex).Distinct().OrderBy(x=>x).ToList(); @@ -120,10 +123,14 @@ namespace IRaCIS.Core.Application.Service item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).ToList(); - item.Childrens.ForEach(x => { + item.RelationQuestions.ForEach(x => { this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers); }); - } + + item.Childrens.ForEach(x => { + this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers); + }); + } #region 项目问题 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs index 56894a7f5..af441a447 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs @@ -44,10 +44,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public List Childrens { get; set; } = new List(); - /// - /// 表格问题 - /// - public List TableQuestions { get; set; } = new List(); + + /// + /// 关联问题 + /// + public List RelationQuestions { get; set; } = new List(); + + /// + /// 表格问题 + /// + public List TableQuestions { get; set; } = new List(); public List> TableAnswer { get; set; } }