diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingMedicalReviewService.cs index 1d6b20a16..2edb9c537 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingMedicalReviewService.cs @@ -149,30 +149,30 @@ namespace IRaCIS.Core.Application.Service } - - private async Task> GetMedicalQuestionAnswer(GetMedicalReviewReadingTaskInDto inDto) + #region 问题 + private async Task> GetMedicalQuestionAnswer(GetMedicalReviewReadingTaskInDto inDto) { - var questionQuery = from data in _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsConfirm&&x.IsEnable) - join questionAnswer in _readingMedicineQuestionAnswerRepository.Where(x => x.TaskMedicalReviewId == inDto.TaskMedicalReviewId) on data.Id equals questionAnswer.ReadingMedicineQuestionId into questionAnswerTemp - from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty() - select new ReadingMedicineQuestion() - { - MedicineQuestionId = data.Id, - Type = data.Type, - ParentTriggerValue = data.ParentTriggerValue, - IsEnable=data.IsEnable, - IsConfirm=data.IsConfirm, - QuestionName = data.QuestionName, - IsRequired = data.IsRequired, - ShowOrder = data.ShowOrder, - ParentId = data.ParentId, - TypeValue = data.TypeValue, - Answer = leftquestionAnswer.Answer - }; + var questionQuery = from data in _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm && x.IsEnable) + join questionAnswer in _readingMedicineQuestionAnswerRepository.Where(x => x.TaskMedicalReviewId == inDto.TaskMedicalReviewId) on data.Id equals questionAnswer.ReadingMedicineQuestionId into questionAnswerTemp + from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty() + select new ReadingMedicineQuestion() + { + MedicineQuestionId = data.Id, + Type = data.Type, + ParentTriggerValue = data.ParentTriggerValue, + IsEnable = data.IsEnable, + IsConfirm = data.IsConfirm, + QuestionName = data.QuestionName, + IsRequired = data.IsRequired, + ShowOrder = data.ShowOrder, + ParentId = data.ParentId, + TypeValue = data.TypeValue, + Answer = leftquestionAnswer.Answer + }; - var questionList = await questionQuery.ToListAsync(); + var questionList = await questionQuery.OrderBy(x=>x.ShowOrder).ToListAsync(); - List < ReadingMedicineQuestion > medicineQuestionList = questionList.Where(x => x.ParentId == null).ToList(); + List medicineQuestionList = questionList.Where(x => x.ParentId == null).ToList(); medicineQuestionList.ForEach(x => { FindChildQuestion(x, questionList); @@ -193,6 +193,9 @@ namespace IRaCIS.Core.Application.Service }); } } + #endregion + + /// /// 保存医学审核问题