diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 9711b293c..09c81abf4 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -362,7 +362,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetTrialReadingQuestionInDto { [NotDefault] - public Guid ReadingQuestionCriterionTrialId { get; set; } + public Guid ReadingQuestionCriterionSystemId { get; set; } public Guid? VisitTaskId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 6cc73294f..210182760 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -41,6 +41,8 @@ namespace IRaCIS.Application.Services private readonly IRepository _readModuleRepository; private readonly IRepository _readingTaskQuestionAnswerRepository; private readonly IRepository _readingQuestionCriterionTrialRepository; + private readonly IRepository _readingQuestionCriterionSystemRepository; + private readonly IRepository _readingQuestionSystem; private readonly IRepository _readingQuestionTrialRepository; @@ -60,6 +62,8 @@ namespace IRaCIS.Application.Services IRepository readModuleRepository, IRepository readingTaskQuestionAnswerRepository, IRepository readingQuestionCriterionTrialRepository, + IRepository readingQuestionCriterionSystemRepository, + IRepository ReadingQuestionSystem, IRepository readingQuestionTrialRepository ) { @@ -78,6 +82,8 @@ namespace IRaCIS.Application.Services this._readModuleRepository = readModuleRepository; this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository; this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository; + this._readingQuestionCriterionSystemRepository = readingQuestionCriterionSystemRepository; + this._readingQuestionSystem = ReadingQuestionSystem; this._readingQuestionTrialRepository = readingQuestionTrialRepository; } @@ -613,6 +619,55 @@ namespace IRaCIS.Application.Services } #endregion + #region 获取系统的阅片问题 + + /// + /// 获取系统的阅片问题 + /// + /// + /// + [HttpPost] + public async Task GetSystemReadingQuestion(GetTrialReadingQuestionInDto inDto) + { + var result = new GetTrialReadingQuestionPageDto(); + + var query = from data in _readingQuestionSystem.Where(x => x.ReadingQuestionCriterionSystemId == inDto.ReadingQuestionCriterionSystemId) + select new GetTrialReadingQuestionOutDto() + { + ReadingQuestionTrialId = data.Id, + ParentTriggerValue = data.ParentTriggerValue, + GroupName = data.GroupName, + QuestionName = data.QuestionName, + IsRequired = data.IsRequired, + ShowOrder = data.ShowOrder, + ParentId = data.ParentId, + TypeValue = data.TypeValue, + Answer = string.Empty, + PageShowOrder = data.ShowOrder, + }; + + var qusetionList = await query.OrderBy(x => x.ShowOrder).ToListAsync(); + + var groupList = new List(); + + qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList(); + + groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); + groupList.ForEach(x => + { + this.FindChildQuestion(x, qusetionList); + }); + + groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList(); + + result.SinglePage = groupList; + + + return (result); + } + #endregion + + #region 获取阅片任务和答案 /// /// 获取阅片任务和答案