diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index f2e3f24c..b55de1ed 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -118,6 +118,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public decimal FristAddTaskNum { get; set; } public ReportLayType ReportLayType { get; set; } = ReportLayType.Group; + + + /// + /// 问题英文分组 + /// + public string GroupEnName { get; set; } = string.Empty; public List Answer { get; set; } = new List(); diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index 1e17e115..ae8935de 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -271,7 +271,7 @@ namespace IRaCIS.Core.Application.Service DictionaryCode = x.ReadingQuestionTrial.DictionaryCode, ShowOrder = x.ReadingQuestionTrial.ShowOrder, QuestionGenre = x.ReadingQuestionTrial.QuestionGenre, - QuestionName = x.ReadingQuestionTrial.QuestionName + QuestionName = x.ReadingQuestionTrial.QuestionName.LanguageName(x.ReadingQuestionTrial.QuestionEnName,_userInfo.IsEn_Us) }).ToListAsync(); var globalChangeAnswer = await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId) && x.Answer != string.Empty && x.GlobalAnswerType == GlobalAnswerType.Question && x.GlobalVisitTask.TaskState == TaskState.Effect).ToListAsync(); medicalReviewInfo.TaskList.ForEach(x => diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index 7b0d78bb..202ad6fa 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -136,7 +136,7 @@ namespace IRaCIS.Application.Services .Select(x => new GetCalculateQuestionsOutDto (){ QuestionId = x.Id, - QuestionName = x.QuestionName + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) }).ToListAsync(); @@ -145,7 +145,7 @@ namespace IRaCIS.Application.Services { QuestionId= x.Id, x.ReadingQuestionId, - x.QuestionName + QuestionName=x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) }).ToListAsync(); @@ -182,7 +182,7 @@ namespace IRaCIS.Application.Services () { QuestionId = x.Id, - QuestionName = x.QuestionName + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) }).ToListAsync(); @@ -451,7 +451,7 @@ namespace IRaCIS.Application.Services { var query = _readingQuestionTrialRepository.AsQueryable() .Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId) - .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) + .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)||x.QuestionEnName.Contains(x.QuestionEnName)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) .Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder); @@ -551,7 +551,7 @@ namespace IRaCIS.Application.Services .Select(x => new CriterionOtherQuestionOutDto() { QuestionId = x.Id, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), TypeValue = x.TypeValue, GroupName = x.GroupName, }).ToListAsync(); @@ -586,7 +586,7 @@ namespace IRaCIS.Application.Services { var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.Type == ReadingQestionType.Group) .Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId).OrderBy(t => t.ShowOrder) - .Select(x => x.GroupName).ToListAsync(); + .Select(x =>x.GroupName).ToListAsync(); return result; @@ -634,7 +634,7 @@ namespace IRaCIS.Application.Services .Select(x => new CriterionOtherQuestionOutDto() { QuestionId = x.Id, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), TypeValue = x.TypeValue, }).ToListAsync(); @@ -962,147 +962,147 @@ namespace IRaCIS.Application.Services } - /// - /// 更改项目标准(老) - /// - /// - /// - private async Task UpdateTrialCriterion(Guid systemCriterionId) - { - await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == systemCriterionId, x => new ReadingQuestionCriterionTrial() - { - IsCompleteConfig = true, - }); - var systemCriterionQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync(); - var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new - { - x.Id, - x.TrialId, - }).ToListAsync(); - var trialCriterionIdList = trialCriterionList.Select(x => x.Id).ToList(); - List needAddQuestionList = new List(); - foreach (var item in trialCriterionList) - { - await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIdList.Contains(x.ReadingQuestionCriterionTrialId)); - List trialQuestionList = new List(); - SetChildParentQuestion(item.Id, item.TrialId, systemCriterionQuestionList, trialQuestionList); - needAddQuestionList.AddRange(trialQuestionList); - } - await _readingQuestionTrialRepository.AddRangeAsync(needAddQuestionList); - } + ///// + ///// 更改项目标准(老) + ///// + ///// + ///// + //private async Task UpdateTrialCriterion(Guid systemCriterionId) + //{ + // await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == systemCriterionId, x => new ReadingQuestionCriterionTrial() + // { + // IsCompleteConfig = true, + // }); + // var systemCriterionQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync(); + // var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new + // { + // x.Id, + // x.TrialId, + // }).ToListAsync(); + // var trialCriterionIdList = trialCriterionList.Select(x => x.Id).ToList(); + // List needAddQuestionList = new List(); + // foreach (var item in trialCriterionList) + // { + // await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIdList.Contains(x.ReadingQuestionCriterionTrialId)); + // List trialQuestionList = new List(); + // SetChildParentQuestion(item.Id, item.TrialId, systemCriterionQuestionList, trialQuestionList); + // needAddQuestionList.AddRange(trialQuestionList); + // } + // await _readingQuestionTrialRepository.AddRangeAsync(needAddQuestionList); + //} - /// - /// 更改项目标准(新) - /// - /// - /// - private async Task SynchronizeSystemCriterion(Guid systemCriterionId) - { - var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.Id == systemCriterionId); + ///// + ///// 更改项目标准(新) + ///// + ///// + ///// + //private async Task SynchronizeSystemCriterion(Guid systemCriterionId) + //{ + // var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.Id == systemCriterionId); - var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new - { - x.Id, - x.TrialId, - }).ToListAsync(); + // var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new + // { + // x.Id, + // x.TrialId, + // }).ToListAsync(); - var trialCriterionIds = trialCriterionList.Select(x => x.Id).ToList(); - var systemQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync(); - var trialQuestions = await _readingQuestionTrialRepository.Where(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)).Select(x => new TrialQuestion - { - AnswerCombination = x.AnswerCombination, - AnswerGroup = x.AnswerGroup, - Id = x.Id, - JudgeType = x.JudgeType, - ReadingCriterionPageId = x.ReadingCriterionPageId, - RelevanceId = x.RelevanceId, - RelevanceValue = x.RelevanceValue, - ImageCount = x.ImageCount, - ParentId = x.ParentId, - ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId, - ReadingQuestionSystemId = x.ReadingQuestionSystemId, - SystemParentId = x.SystemParentId - }).ToListAsync(); + // var trialCriterionIds = trialCriterionList.Select(x => x.Id).ToList(); + // var systemQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync(); + // var trialQuestions = await _readingQuestionTrialRepository.Where(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)).Select(x => new TrialQuestion + // { + // AnswerCombination = x.AnswerCombination, + // AnswerGroup = x.AnswerGroup, + // Id = x.Id, + // JudgeType = x.JudgeType, + // ReadingCriterionPageId = x.ReadingCriterionPageId, + // RelevanceId = x.RelevanceId, + // RelevanceValue = x.RelevanceValue, + // ImageCount = x.ImageCount, + // ParentId = x.ParentId, + // ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId, + // ReadingQuestionSystemId = x.ReadingQuestionSystemId, + // SystemParentId = x.SystemParentId + // }).ToListAsync(); - List trialQuestionList = new List(); - foreach (var item in trialCriterionList) - { + // List trialQuestionList = new List(); + // foreach (var item in trialCriterionList) + // { - var thisTrialQuestions = trialQuestions.Where(x => x.ReadingQuestionCriterionTrialId == item.Id).ToList(); + // var thisTrialQuestions = trialQuestions.Where(x => x.ReadingQuestionCriterionTrialId == item.Id).ToList(); - var query = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (a, b) => new - { - a, - trialQuestion = b - }).SelectMany(a => a.trialQuestion, (m, n) => new ReadingQuestionTrial - { - Id = n.Id, + // var query = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (a, b) => new + // { + // a, + // trialQuestion = b + // }).SelectMany(a => a.trialQuestion, (m, n) => new ReadingQuestionTrial + // { + // Id = n.Id, - }); - var needAddQuestionList = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (x, y) => new { system = x, trial = y }) - .SelectMany( - a => a.trial.DefaultIfEmpty(), - (c, d) => new ReadingQuestionTrial - { - Id = (c.trial.FirstOrDefault()?.Id) ?? NewId.NextGuid(), - ShowOrder = c.system.ShowOrder, - SystemParentId = c.system.ParentId, - ReadingQuestionSystemId = c.system.Id, - AnswerCombination = (c.trial.FirstOrDefault()?.AnswerCombination) ?? string.Empty, - AnswerGroup = (c.trial.FirstOrDefault()?.AnswerGroup) ?? string.Empty, - GroupName = c.system.GroupName, - IsEnable = c.system.IsEnable, + // }); + // var needAddQuestionList = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (x, y) => new { system = x, trial = y }) + // .SelectMany( + // a => a.trial.DefaultIfEmpty(), + // (c, d) => new ReadingQuestionTrial + // { + // Id = (c.trial.FirstOrDefault()?.Id) ?? NewId.NextGuid(), + // ShowOrder = c.system.ShowOrder, + // SystemParentId = c.system.ParentId, + // ReadingQuestionSystemId = c.system.Id, + // AnswerCombination = (c.trial.FirstOrDefault()?.AnswerCombination) ?? string.Empty, + // AnswerGroup = (c.trial.FirstOrDefault()?.AnswerGroup) ?? string.Empty, + // GroupName = c.system.GroupName, + // IsEnable = c.system.IsEnable, - ShowQuestion = c.system.ShowQuestion, - IsJudgeQuestion = c.system.IsJudgeQuestion, - IsRequired = c.system.IsRequired, - JudgeType = (c.trial.FirstOrDefault()?.JudgeType) ?? JudgeTypeEnum.None, - ParentId = c.trial.FirstOrDefault()?.ParentId, - ParentTriggerValue = c.system.ParentTriggerValue, - QuestionName = c.system.QuestionName, - ReadingCriterionPageId = c.trial.FirstOrDefault()?.ReadingCriterionPageId, - RelevanceId = c.trial.FirstOrDefault()?.RelevanceId, - ImageCount = c.trial.FirstOrDefault()?.ImageCount ?? 0, - RelevanceValue = c.trial.FirstOrDefault()?.RelevanceValue, - ReadingQuestionCriterionTrialId = item.Id, - Remark = c.system.Remark, - TrialId = item.TrialId, - Type = c.system.Type, + // ShowQuestion = c.system.ShowQuestion, + // IsJudgeQuestion = c.system.IsJudgeQuestion, + // IsRequired = c.system.IsRequired, + // JudgeType = (c.trial.FirstOrDefault()?.JudgeType) ?? JudgeTypeEnum.None, + // ParentId = c.trial.FirstOrDefault()?.ParentId, + // ParentTriggerValue = c.system.ParentTriggerValue, + // QuestionName = c.system.QuestionName, + // ReadingCriterionPageId = c.trial.FirstOrDefault()?.ReadingCriterionPageId, + // RelevanceId = c.trial.FirstOrDefault()?.RelevanceId, + // ImageCount = c.trial.FirstOrDefault()?.ImageCount ?? 0, + // RelevanceValue = c.trial.FirstOrDefault()?.RelevanceValue, + // ReadingQuestionCriterionTrialId = item.Id, + // Remark = c.system.Remark, + // TrialId = item.TrialId, + // Type = c.system.Type, - TypeValue = c.system.TypeValue, - }).ToList(); - var copydata = needAddQuestionList.Clone(); - needAddQuestionList.ForEach(x => - { - if (x.SystemParentId == null) - { - x.ParentId = null; - } - else - { - x.ParentId = copydata.FirstOrDefault(y => y.ReadingQuestionSystemId == x.SystemParentId).Id; - } - }); + // TypeValue = c.system.TypeValue, + // }).ToList(); + // var copydata = needAddQuestionList.Clone(); + // needAddQuestionList.ForEach(x => + // { + // if (x.SystemParentId == null) + // { + // x.ParentId = null; + // } + // else + // { + // x.ParentId = copydata.FirstOrDefault(y => y.ReadingQuestionSystemId == x.SystemParentId).Id; + // } + // }); - trialQuestionList.AddRange(needAddQuestionList); - } - await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)); - await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => trialCriterionIds.Contains(x.Id), x => new ReadingQuestionCriterionTrial() - { - IsEnable = systemCriterion.IsEnable, - CriterionName = systemCriterion.CriterionName, - ShowOrder = systemCriterion.ShowOrder, - IsCompleteConfig = systemCriterion.IsCompleteConfig, + // trialQuestionList.AddRange(needAddQuestionList); + // } + // await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)); + // await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => trialCriterionIds.Contains(x.Id), x => new ReadingQuestionCriterionTrial() + // { + // IsEnable = systemCriterion.IsEnable, + // CriterionName = systemCriterion.CriterionName, + // ShowOrder = systemCriterion.ShowOrder, + // IsCompleteConfig = systemCriterion.IsCompleteConfig, - }); + // }); - await _readingQuestionTrialRepository.AddRangeAsync(trialQuestionList); + // await _readingQuestionTrialRepository.AddRangeAsync(trialQuestionList); - // - await _readingQuestionTrialRepository.SaveChangesAsync(); - } + // // + // await _readingQuestionTrialRepository.SaveChangesAsync(); + //} /// @@ -1194,87 +1194,87 @@ namespace IRaCIS.Application.Services await _readingQuestionTrialRepository.SaveChangesAsync(); } - /// - /// 设置父子关系 - /// - /// 项目标准ID - /// 项目Id - /// 系统问题 - /// 需要添加list - private void SetChildParentQuestion(Guid ReadingQuestionCriterionTrialId, Guid trialId, List systemQuesitonList, List needQuestionList) - { - var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList(); - parentIdIsNullList.ForEach(x => - { - var quesiton = x.Clone(); - var oldId = quesiton.Id; - var newId = NewId.NextGuid(); - needQuestionList.Add(new ReadingQuestionTrial() - { - Id = newId, - ShowOrder = quesiton.ShowOrder, - IsEnable = quesiton.IsEnable, - IsRequired = quesiton.IsRequired, - ParentTriggerValue = quesiton.ParentTriggerValue, - QuestionName = quesiton.QuestionName, - ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId, - ReadingQuestionSystemId = quesiton.Id, - SystemParentId = quesiton.ParentId, - TrialId = trialId, - AnswerGroup = string.Empty, - Type = quesiton.Type, - GroupName = quesiton.GroupName, - IsJudgeQuestion = quesiton.IsJudgeQuestion, - Remark = quesiton.Remark, - TypeValue = quesiton.TypeValue, - }); + ///// + ///// 设置父子关系 + ///// + ///// 项目标准ID + ///// 项目Id + ///// 系统问题 + ///// 需要添加list + //private void SetChildParentQuestion(Guid ReadingQuestionCriterionTrialId, Guid trialId, List systemQuesitonList, List needQuestionList) + //{ + // var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList(); + // parentIdIsNullList.ForEach(x => + // { + // var quesiton = x.Clone(); + // var oldId = quesiton.Id; + // var newId = NewId.NextGuid(); + // needQuestionList.Add(new ReadingQuestionTrial() + // { + // Id = newId, + // ShowOrder = quesiton.ShowOrder, + // IsEnable = quesiton.IsEnable, + // IsRequired = quesiton.IsRequired, + // ParentTriggerValue = quesiton.ParentTriggerValue, + // QuestionName = quesiton.QuestionName, + // ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId, + // ReadingQuestionSystemId = quesiton.Id, + // SystemParentId = quesiton.ParentId, + // TrialId = trialId, + // AnswerGroup = string.Empty, + // Type = quesiton.Type, + // GroupName = quesiton.GroupName, + // IsJudgeQuestion = quesiton.IsJudgeQuestion, + // Remark = quesiton.Remark, + // TypeValue = quesiton.TypeValue, + // }); - CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList); - }); - } + // CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList); + // }); + //} - /// - /// 递归处理父子关系 - /// - /// - /// - /// - /// - /// - /// - private void CreateQuestionRelation(Guid ReadingQuestionCriterionTrialId, Guid trialId, Guid oldParentId, Guid newParentId, List systemQuesitonList, List needQuestionList) - { - var childList = systemQuesitonList.Where(x => x.ParentId == oldParentId).ToList(); - childList.ForEach(x => - { - var quesiton = x.Clone(); - var oldId = quesiton.Id; - var newId = NewId.NextGuid(); - needQuestionList.Add(new ReadingQuestionTrial() - { - Id = newId, - ShowOrder = quesiton.ShowOrder, - IsEnable = quesiton.IsEnable, - IsRequired = quesiton.IsRequired, - ParentId = newParentId, - SystemParentId = quesiton.ParentId, - ReadingQuestionSystemId = x.Id, - AnswerGroup = string.Empty, - ParentTriggerValue = quesiton.ParentTriggerValue, - QuestionName = quesiton.QuestionName, - ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId, - TrialId = trialId, - GroupName = quesiton.GroupName, - Type = quesiton.Type, - IsJudgeQuestion = quesiton.IsJudgeQuestion, - Remark = quesiton.Remark, - TypeValue = quesiton.TypeValue, - }); + ///// + ///// 递归处理父子关系 + ///// + ///// + ///// + ///// + ///// + ///// + ///// + //private void CreateQuestionRelation(Guid ReadingQuestionCriterionTrialId, Guid trialId, Guid oldParentId, Guid newParentId, List systemQuesitonList, List needQuestionList) + //{ + // var childList = systemQuesitonList.Where(x => x.ParentId == oldParentId).ToList(); + // childList.ForEach(x => + // { + // var quesiton = x.Clone(); + // var oldId = quesiton.Id; + // var newId = NewId.NextGuid(); + // needQuestionList.Add(new ReadingQuestionTrial() + // { + // Id = newId, + // ShowOrder = quesiton.ShowOrder, + // IsEnable = quesiton.IsEnable, + // IsRequired = quesiton.IsRequired, + // ParentId = newParentId, + // SystemParentId = quesiton.ParentId, + // ReadingQuestionSystemId = x.Id, + // AnswerGroup = string.Empty, + // ParentTriggerValue = quesiton.ParentTriggerValue, + // QuestionName = quesiton.QuestionName, + // ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId, + // TrialId = trialId, + // GroupName = quesiton.GroupName, + // Type = quesiton.Type, + // IsJudgeQuestion = quesiton.IsJudgeQuestion, + // Remark = quesiton.Remark, + // TypeValue = quesiton.TypeValue, + // }); - CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList); - }); + // CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList); + // }); - } + //} #region 废弃 diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs index f454c98e..cdc49682 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs @@ -118,7 +118,7 @@ namespace IRaCIS.Application.Services .Select(y => new GlobalQuestionInfo() { QuestionId = y.ReadingQuestionTrialId, - QuestionName = y.ReadingQuestionTrial.QuestionName, + QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us), AnswerGroup = y.ReadingQuestionTrial.AnswerGroup, QuestionType = y.ReadingQuestionTrial.QuestionType, QuestionGenre = y.ReadingQuestionTrial.QuestionGenre, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 67112c84..17e5eea2 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -388,7 +388,10 @@ namespace IRaCIS.Application.Services .WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table) .WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table) - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync(); + .ProjectTo(_mapper.ConfigurationProvider,new{ + isEn_Us=_userInfo.IsEn_Us + + }).OrderBy(x => x.ShowOrder).ToListAsync(); var answers = new List(); @@ -569,7 +572,11 @@ namespace IRaCIS.Application.Services { var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); - var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync(); + var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo(_mapper.ConfigurationProvider,new { + + isEn_Us=_userInfo.IsEn_Us + + }).OrderBy(x => x.ShowOrder).ToListAsync(); //是否是预览 @@ -697,7 +704,7 @@ namespace IRaCIS.Application.Services ParentId = item.Id, DataTableColumn = x.DataTableColumn, LesionType = item.LesionType, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), RelationQuestions = new List(), Remark = x.Remark, ValueType = x.ValueType, @@ -1133,7 +1140,7 @@ namespace IRaCIS.Application.Services catch (Exception) { - msg = _localizer["ReadingImage_Maximum", item.QuestionName, item.MaxRowCount.Value, rowCount] ; + msg = _localizer["ReadingImage_Maximum", item.QuestionName.LanguageName(item.QuestionEnName, _userInfo.IsEn_Us), item.MaxRowCount.Value, rowCount] ; } throw new BusinessValidationFailedException(msg); @@ -1354,7 +1361,7 @@ namespace IRaCIS.Application.Services if (readingQuestionList.Count() > 0) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_RequiredQuestion", string.Join(',', readingQuestionList.Select(x => x.QuestionName))]); + throw new BusinessValidationFailedException(_localizer["ReadingImage_RequiredQuestion", string.Join(',', readingQuestionList.Select(x => x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)))]); } return ResponseOutput.Ok(true); } @@ -1381,7 +1388,7 @@ namespace IRaCIS.Application.Services if (readingQuestionList.Count() > 0) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_RequiredQuestion", string.Join(',', readingQuestionList.Select(x => x.QuestionName))]); + throw new BusinessValidationFailedException(_localizer["ReadingImage_RequiredQuestion", string.Join(',', readingQuestionList.Select(x => x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)))]); } await _readingCalculateService.VerifyVisitTaskQuestions(inDto); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs index 8756c5cc..589c1e9a 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs @@ -38,7 +38,7 @@ namespace IRaCIS.Application.Services { AnswerGroup = JsonConvert.DeserializeObject>(x.AnswerGroup.IsNullOrEmpty() ? "[]" : x.AnswerGroup), AnswerCombination = JsonConvert.DeserializeObject>(x.AnswerCombination.IsNullOrEmpty() ? "[]" : x.AnswerCombination), - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), PageName = x.ReadingCriterionPage.PageName, TypeValue = x.TypeValue, QuestionGenre=x.QuestionGenre, @@ -147,7 +147,7 @@ namespace IRaCIS.Application.Services ShowOrder = x.ReadingQuestionTrial.ShowOrder, VisitTaskId = x.VisitTaskId, QuestionId = x.ReadingQuestionTrial.Id, - QuestionName = x.ReadingQuestionTrial.QuestionName, + QuestionName = x.ReadingQuestionTrial.QuestionName.LanguageName(x.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us), QuestionGenre = x.ReadingQuestionTrial.QuestionGenre, DictionaryCode = x.ReadingQuestionTrial.DictionaryCode, @@ -206,7 +206,7 @@ namespace IRaCIS.Application.Services { Answer = x.Answer, QuestionId = x.ReadingQuestionTrial.Id, - QuestionName = x.ReadingQuestionTrial.QuestionName, + QuestionName = x.ReadingQuestionTrial.QuestionName.LanguageName(x.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us), QuestionGenre = x.ReadingQuestionTrial.QuestionGenre, DictionaryCode = x.ReadingQuestionTrial.DictionaryCode, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index ac26a7ba..198ab10c 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -65,7 +65,11 @@ namespace IRaCIS.Application.Services var qusetionIds = qusetionList.Select(x => x.Id).ToList(); var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId)) - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync(); + .ProjectTo(_mapper.ConfigurationProvider,x=>new { + + isEn_Us=_userInfo.IsEn_Us + + }).OrderBy(x => x.ShowOrder).ToListAsync(); if (inDto.FormType != null) { formType = inDto.FormType.Value; @@ -149,7 +153,7 @@ namespace IRaCIS.Application.Services Type = data.Type, ParentTriggerValue = data.ParentTriggerValue, GroupName = data.GroupName, - QuestionName = data.QuestionName, + QuestionName = data.QuestionName.LanguageName(data.QuestionEnName, _userInfo.IsEn_Us), IsRequired = data.IsRequired, ShowQuestion = data.ShowQuestion, LesionType = data.LesionType, @@ -273,7 +277,9 @@ namespace IRaCIS.Application.Services var questionIds = qusetionList.Select(x => x.Id).ToList(); var tableQuestionList = await _readingTableQuestionSystemRepository.Where(x => questionIds.Contains(x.ReadingQuestionId)) - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync(); + .ProjectTo(_mapper.ConfigurationProvider,new { + isEn_Us=_userInfo.IsEn_Us, + }).OrderBy(x => x.ShowOrder).ToListAsync(); var groupList = new List(); diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 6d615aa2..b04928dd 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -11,6 +11,11 @@ namespace IRaCIS.Core.Application.Service { public ReadingConfig() { + + + //是否英文环境 + var isEn_Us=false; + CreateMap(); CreateMap(); @@ -78,8 +83,10 @@ namespace IRaCIS.Core.Application.Service #region 阅片问题 + // 忽略列 CreateMap() + .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us?s.QuestionEnName:s.QuestionName)) .ForMember(dest => dest.ReadingCriterionPage, opt => opt.Ignore()) .ForMember(dest => dest.ParentReadingQuestionTrial, opt => opt.Ignore()) .ForMember(dest => dest.RelevanceReadingQuestionTrial, opt => opt.Ignore()) @@ -100,13 +107,15 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.ShowOrder, u => u.MapFrom(s => s.ReadingQuestionTrial.ShowOrder)); CreateMap() + .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)) .ForMember(d => d.PageShowOrder, u => u.MapFrom(s => s.ReadingCriterionPage.ShowOrder)) .ForMember(d => d.PageName, u => u.MapFrom(s => s.ReadingCriterionPage.PageName)) .ForMember(d => d.IsPublicPage, u => u.MapFrom(s => s.ReadingCriterionPage.IsPublicPage)); CreateMap(); CreateMap(); - CreateMap(); + CreateMap() + .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)); CreateMap() .ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder)); @@ -179,6 +188,7 @@ namespace IRaCIS.Core.Application.Service #region IR阅片 CreateMap() + .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)) .ForMember(x=>x.Id, y=>y.MapFrom(z=>z.Id)); CreateMap() diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/GeneralCalculateService.cs index 3296f7e1..cee011d6 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/GeneralCalculateService.cs @@ -1,5 +1,6 @@ using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; using System; using System.Collections.Generic; using System.Linq; @@ -69,7 +70,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { LesionType = x.LesionType, QuestionId = x.Id, - QuesionName = x.QuestionName, + QuesionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), QuestionType = x.QuestionType, ValueType = x.ValueType, }).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index acc6fe9a..8820497e 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -140,6 +140,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, + GroupEnName=x.GroupEnName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, QuestionType = x.QuestionType, @@ -148,7 +149,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, TypeValue = x.TypeValue, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), ShowOrder = x.ShowOrder, ValueType = x.ValueType, CustomUnit=x.CustomUnit, @@ -163,9 +164,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate item.Childrens = questionList.Where(x => x.GroupName == item.GroupName && x.Type != ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName, + GroupEnName=x.GroupEnName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, DataSource = x.DataSource, @@ -222,7 +224,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // tableQuestion row.Childrens = tableQuestionList.Where(x => x.ReadingQuestionId == question.QuestionId).Select(x => new ReadingReportDto() { - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), QuestionId = x.ReadingQuestionId, TableQuestionId = x.Id, Type = x.Type, diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index 601f88ca..c465a860 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -120,6 +120,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, + GroupEnName=x.GroupName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, QuestionType = x.QuestionType, @@ -128,7 +129,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, TypeValue = x.TypeValue, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, @@ -144,7 +145,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate GroupName = x.GroupName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - QuestionName = x.QuestionName, + GroupEnName=x.GroupEnName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, DataSource = x.DataSource, @@ -199,12 +201,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // tableQuestion row.Childrens = tableQuestionList.Where(x => x.ReadingQuestionId == question.QuestionId).Select(x => new ReadingReportDto() { - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), QuestionId = x.ReadingQuestionId, TableQuestionId = x.Id, Type = x.Type, LesionType = question.LesionType, TableQuestionType = x.TableQuestionType, + DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, QuestionMark = x.QuestionMark, diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs index 5295f6c0..a7ab89b5 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs @@ -119,14 +119,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate GroupName = x.GroupName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, - + GroupEnName=x.GroupEnName, QuestionType = x.QuestionType, DataSource= x.DataSource, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, DictionaryCode = x.DictionaryCode, TypeValue = x.TypeValue, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, @@ -142,10 +142,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate GroupName = x.GroupName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, DataSource = x.DataSource, QuestionGenre = x.QuestionGenre, + GroupEnName=x.GroupEnName, DictionaryCode = x.DictionaryCode, Type = x.Type, QuestionType = x.QuestionType, @@ -197,7 +198,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // tableQuestion row.Childrens = tableQuestionList.Where(x => x.ReadingQuestionId == question.QuestionId).Select(x => new ReadingReportDto() { - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), QuestionId = x.ReadingQuestionId, TableQuestionId = x.Id, Type = x.Type, diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index da15cbe2..2f05b1cd 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -353,7 +353,7 @@ namespace IRaCIS.Core.Application JudgeType = x.JudgeType, QuestionId = x.Id, PageName=x.ReadingCriterionPage.PageName, - QuestionName = x.QuestionName, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId }).ToListAsync();