diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 4d9b4fd77..d6b881d70 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -1877,6 +1877,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetTrialQuestionExportResultOutDto { + public CriterionType CriterionType { get; set; } + public CriterionGroup CriterionGroup { get; set; } + public List QuestionList = new List(); public List DicList = new List(); @@ -1900,6 +1903,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public int ShowOrder { get; set; } + public bool IsTableQuestion { get; set; } + public bool HasChildren => Children.Count() > 0; public List Children { get; set; } = new List(); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index 822dc59ba..0947548a3 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -117,6 +117,8 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task GetTrialQuestionExportResult(GetTrialQuestionExportResultInDto inDto) { + + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); var questionList = await _readingQuestionTrialRepository.Where(x => x.Type != ReadingQestionType.Group && x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId) .OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport() { @@ -124,6 +126,7 @@ namespace IRaCIS.Core.Application.Service QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName, ExportResult = x.ExportResult, ShowOrder = x.ShowOrder, + IsTableQuestion=false, CDISCCode = x.CDISCCode, }).ToListAsync(); @@ -137,6 +140,7 @@ namespace IRaCIS.Core.Application.Service QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName, ExportResult = x.ExportResult, ShowOrder = x.ShowOrder, + IsTableQuestion=true, CDISCCode = x.CDISCCode, }).ToListAsync(); @@ -159,6 +163,8 @@ namespace IRaCIS.Core.Application.Service return new GetTrialQuestionExportResultOutDto() { + CriterionType = criterionInfo.CriterionType, + CriterionGroup = criterionInfo.CriterionGroup, DicList = dicList, QuestionList = questionList };