S-88
							parent
							
								
									01501b36b5
								
							
						
					
					
						commit
						c5d94eff03
					
				| 
						 | 
				
			
			@ -118,10 +118,10 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetSystemClinicalQuestionPreview(GetSystemClinicalQuestionPreviewDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            var questions = await _systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var tableQuestions= await _systemClinicalTableQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
 | 
			
		||||
| 
						 | 
				
			
			@ -144,13 +144,13 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetTrialClinicalQuestionPreview(GetTrialClinicalQuestionPreviewDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            var questions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var tableQuestions = await _trialClinicalTableQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
 | 
			
		||||
            var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).ToList();
 | 
			
		||||
 | 
			
		||||
            result.ForEach(x =>
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        /// <param name="tableQuestions"></param>
 | 
			
		||||
        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.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).OrderBy(x => x.ShowOrder).ToList();
 | 
			
		||||
 | 
			
		||||
			item.RelationQuestions = questions.Where(x => x.RelevanceId == item.Id).ToList();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -188,7 +188,7 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
            });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).ToList();
 | 
			
		||||
            item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).OrderBy(x => x.ShowOrder).ToList();
 | 
			
		||||
 | 
			
		||||
            item.RelationQuestions.ForEach(x => {
 | 
			
		||||
                this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue