Uat_Study
			
			
		
		
							parent
							
								
									70be5ae184
								
							
						
					
					
						commit
						1679b6b406
					
				| 
						 | 
				
			
			@ -104,7 +104,10 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> 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 项目问题
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,10 +44,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public List<ClinicalQuestionPreviewDto> Childrens { get; set; } = new List<ClinicalQuestionPreviewDto>();
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 表格问题
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public List<ClinicalTablePreviewDto> TableQuestions { get; set; } = new List<ClinicalTablePreviewDto>();
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 关联问题
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public List<ClinicalQuestionPreviewDto> RelationQuestions { get; set; } = new List<ClinicalQuestionPreviewDto>();
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 表格问题
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public List<ClinicalTablePreviewDto> TableQuestions { get; set; } = new List<ClinicalTablePreviewDto>();
 | 
			
		||||
 | 
			
		||||
        public List<Dictionary<Guid,string>> TableAnswer { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue