Uat_Study
			
			
		
		
							parent
							
								
									4998f6034d
								
							
						
					
					
						commit
						e31e6177fb
					
				| 
						 | 
				
			
			@ -592,6 +592,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
 | 
			
		||||
        public List<TableAnsweRowInfo> TableAnsweRowInfos { get; set; } = new List<TableAnsweRowInfo>();
 | 
			
		||||
 | 
			
		||||
        public List<OrganInfo> OrganInfos { get; set; } = new List<OrganInfo>();
 | 
			
		||||
 | 
			
		||||
        public bool IsGetallQuestion { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			@ -602,6 +604,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
    public class ReadingTableQuestionAnswerInfo : ReadingTableQuestionAnswer
 | 
			
		||||
    {
 | 
			
		||||
        public int ShowOrder { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 问题标识
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public QuestionMark? QuestionMark { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class TrialReadTableQuestion
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,6 +39,7 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
        private readonly IRepository<ReadingJudgeInfo> _readingJudgeInfoRepository;
 | 
			
		||||
        private readonly IRepository<ReadModule> _readModuleRepository;
 | 
			
		||||
        private readonly IRepository<DicomInstance> _dicomInstanceRepository;
 | 
			
		||||
        private readonly IRepository<OrganInfo> _organInfoRepository;
 | 
			
		||||
        private readonly IRepository<ReadingCriterionDictionary> _readingCriterionDictionaryRepository;
 | 
			
		||||
        private readonly IRepository<TumorAssessment> _tumorAssessmentRepository;
 | 
			
		||||
        private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
 | 
			
		||||
| 
						 | 
				
			
			@ -73,6 +74,7 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
                  IRepository<ReadingJudgeInfo> readingJudgeInfoRepository,
 | 
			
		||||
                  IRepository<ReadModule> readModuleRepository,
 | 
			
		||||
                  IRepository<DicomInstance> dicomInstanceRepository,
 | 
			
		||||
                   IRepository<OrganInfo> organInfoRepository,
 | 
			
		||||
                  IMemoryCache cache,
 | 
			
		||||
                  IRepository<ReadingCriterionDictionary> readingCriterionDictionaryRepository,
 | 
			
		||||
                  IRepository<TumorAssessment> tumorAssessmentRepository,
 | 
			
		||||
| 
						 | 
				
			
			@ -105,6 +107,7 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
            this._readingJudgeInfoRepository = readingJudgeInfoRepository;
 | 
			
		||||
            this._readModuleRepository = readModuleRepository;
 | 
			
		||||
            this._dicomInstanceRepository = dicomInstanceRepository;
 | 
			
		||||
            this._organInfoRepository = organInfoRepository;
 | 
			
		||||
            this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
 | 
			
		||||
            this._tumorAssessmentRepository = tumorAssessmentRepository;
 | 
			
		||||
            this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
 | 
			
		||||
| 
						 | 
				
			
			@ -527,6 +530,8 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
 | 
			
		||||
            var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
 | 
			
		||||
            var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
 | 
			
		||||
            var questionPage = await GetReadingTableQuestion(
 | 
			
		||||
 | 
			
		||||
                new GetReadingTableQuestionOrAnswerInDto() {
 | 
			
		||||
| 
						 | 
				
			
			@ -534,7 +539,8 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
                    TrialReadingCriterionId = taskinfo.TrialReadingCriterionId,
 | 
			
		||||
                    TaskId = inDto.VisitTaskId,
 | 
			
		||||
                    TableAnswers = tableAnswers,
 | 
			
		||||
                    TableAnsweRowInfos = tableAnsweRowInfos
 | 
			
		||||
                    TableAnsweRowInfos = tableAnsweRowInfos,
 | 
			
		||||
                    OrganInfos= organList,
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -572,6 +578,8 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
 | 
			
		||||
            var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
 | 
			
		||||
            var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
 | 
			
		||||
            return (await this.GetReadingTableQuestion(
 | 
			
		||||
 | 
			
		||||
                new GetReadingTableQuestionOrAnswerInDto()
 | 
			
		||||
| 
						 | 
				
			
			@ -580,7 +588,8 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
                    TaskId = taskInfo.Id,
 | 
			
		||||
                    TableAnswers = tableAnswers,
 | 
			
		||||
                    TableAnsweRowInfos = tableAnsweRowInfos,
 | 
			
		||||
                    IsGetallQuestion = true
 | 
			
		||||
                    IsGetallQuestion = true,
 | 
			
		||||
                    OrganInfos= organList
 | 
			
		||||
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -668,7 +677,7 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
                    var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
 | 
			
		||||
                    pageGroupList.ForEach(x =>
 | 
			
		||||
                    {
 | 
			
		||||
                        this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos);
 | 
			
		||||
                        this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos,inDto.OrganInfos);
 | 
			
		||||
                    });
 | 
			
		||||
 | 
			
		||||
                    page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
 | 
			
		||||
| 
						 | 
				
			
			@ -685,7 +694,7 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
                groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
 | 
			
		||||
                groupList.ForEach(x =>
 | 
			
		||||
                {
 | 
			
		||||
                    this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos);
 | 
			
		||||
                    this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
 | 
			
		||||
| 
						 | 
				
			
			@ -705,7 +714,7 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
        /// <param name="item"></param>
 | 
			
		||||
        /// <param name="questionlists"></param>
 | 
			
		||||
        /// <param name="tableQuestionLists"></param>
 | 
			
		||||
        private void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos)
 | 
			
		||||
        private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos,List<OrganInfo> organInfos)
 | 
			
		||||
        {
 | 
			
		||||
            item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
 | 
			
		||||
            item.TableQuestions = new TrialReadTableQuestion();
 | 
			
		||||
| 
						 | 
				
			
			@ -744,14 +753,84 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
            var thisAnswer = tableAnswers.Where(x => x.QuestionId == item.Id).ToList();
 | 
			
		||||
            var orders = thisAnswer.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList();
 | 
			
		||||
            item.TableQuestions.Answers = new List<Dictionary<string, string>>();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            var needChangeType = new List<QuestionMark?>() {
 | 
			
		||||
                QuestionMark.Organ,
 | 
			
		||||
                QuestionMark.Location,
 | 
			
		||||
                QuestionMark.Part,
 | 
			
		||||
            };
 | 
			
		||||
           
 | 
			
		||||
            orders.ForEach(x =>
 | 
			
		||||
            {
 | 
			
		||||
                Dictionary<string, string> answers = new Dictionary<string, string>();
 | 
			
		||||
                var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
 | 
			
		||||
                var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList();
 | 
			
		||||
 | 
			
		||||
                var organInfo = organInfos.Where(x=>x.Id== rowInfo.OrganInfoId).FirstOrDefault();
 | 
			
		||||
 | 
			
		||||
                rowAnswer.ForEach(z =>
 | 
			
		||||
                {
 | 
			
		||||
                    answers.Add(z.TableQuestionId.ToString(), z.Answer);
 | 
			
		||||
 | 
			
		||||
                    if (organInfo != null && needChangeType.Contains(z.QuestionMark))
 | 
			
		||||
                    {
 | 
			
		||||
                        if (_userInfo.IsEn_Us)
 | 
			
		||||
                        {
 | 
			
		||||
                            switch (z.QuestionMark)
 | 
			
		||||
                            {
 | 
			
		||||
                                case QuestionMark.Organ:
 | 
			
		||||
                                    answers.Add(z.TableQuestionId.ToString(), organInfo.TULOCEN);
 | 
			
		||||
 | 
			
		||||
                                    break;
 | 
			
		||||
                                case QuestionMark.Location:
 | 
			
		||||
                                    if (organInfo.IsCanEditPosition)
 | 
			
		||||
                                    {
 | 
			
		||||
                                        answers.Add(z.TableQuestionId.ToString(), z.Answer);
 | 
			
		||||
                                    }
 | 
			
		||||
                                    else
 | 
			
		||||
                                    {
 | 
			
		||||
                                        answers.Add(z.TableQuestionId.ToString(), organInfo.TULATEN);
 | 
			
		||||
 | 
			
		||||
                                    }
 | 
			
		||||
                                    break;
 | 
			
		||||
                                case QuestionMark.Part:
 | 
			
		||||
                                    answers.Add(z.TableQuestionId.ToString(), organInfo.PartEN);
 | 
			
		||||
                                    break;
 | 
			
		||||
 | 
			
		||||
                            }
 | 
			
		||||
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            switch (z.QuestionMark)
 | 
			
		||||
                            {
 | 
			
		||||
                                case QuestionMark.Organ:
 | 
			
		||||
                                    answers.Add(z.TableQuestionId.ToString(), organInfo.TULOC);
 | 
			
		||||
                                    break;
 | 
			
		||||
                                case QuestionMark.Location:
 | 
			
		||||
                                    if (organInfo.IsCanEditPosition)
 | 
			
		||||
                                    {
 | 
			
		||||
                                        answers.Add(z.TableQuestionId.ToString(), z.Answer);
 | 
			
		||||
                                    }
 | 
			
		||||
                                    else
 | 
			
		||||
                                    {
 | 
			
		||||
                                        answers.Add(z.TableQuestionId.ToString(), organInfo.TULAT);
 | 
			
		||||
 | 
			
		||||
                                    }
 | 
			
		||||
                                    break;
 | 
			
		||||
                                case QuestionMark.Part:
 | 
			
		||||
                                    answers.Add(z.TableQuestionId.ToString(), organInfo.Part);
 | 
			
		||||
                                    break;
 | 
			
		||||
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        answers.Add(z.TableQuestionId.ToString(), z.Answer);
 | 
			
		||||
                    }
 | 
			
		||||
                  
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -778,7 +857,7 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
            {
 | 
			
		||||
                item.Childrens.ForEach(x =>
 | 
			
		||||
                {
 | 
			
		||||
                    this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos);
 | 
			
		||||
                    this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos);
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -105,7 +105,8 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
            CreateMap<ReadingTableQuestionTrial, TableQuestionTrial>()
 | 
			
		||||
                .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName));
 | 
			
		||||
            CreateMap<ReadingTableQuestionAnswer, ReadingTableQuestionAnswerInfo>()
 | 
			
		||||
                 .ForMember(d => d.ShowOrder, u => u.MapFrom(s => s.ReadingQuestionTrial.ShowOrder));
 | 
			
		||||
                 .ForMember(d => d.ShowOrder, u => u.MapFrom(s => s.ReadingQuestionTrial.ShowOrder))
 | 
			
		||||
                   .ForMember(d => d.QuestionMark, u => u.MapFrom(s => s.ReadingTableQuestionTrial.QuestionMark));
 | 
			
		||||
 | 
			
		||||
            CreateMap<ReadingQuestionTrial, TrialReadQuestionData>()
 | 
			
		||||
                  .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,12 +38,12 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
		public string PartEN { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// TULOC
 | 
			
		||||
		/// TULOC 器官
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public string TULOC { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// TULOC 英文
 | 
			
		||||
		/// TULOC 器官 英文
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public string TULOCEN { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue