Test.EIImageViewer
parent
38509ba814
commit
1a637881f7
|
@ -152,12 +152,12 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
var criterionId = await _readingQuestionCriterionTrialRepository.Where(x => x.IsConfirm && x.TrialId == inDto.TrialId).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
|
||||
var questions = await _readingQuestionTrialRepository.Where(x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == criterionId&&x.Type!="table")
|
||||
var questions = await _readingQuestionTrialRepository.Where(x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == criterionId&&x.Type!=ReadingQestionType.Table)
|
||||
.ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
|
||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
||||
|
||||
var result = questions.Where(x => x.Type == "group").ToList();
|
||||
var result = questions.Where(x => x.Type == ReadingQestionType.Group).ToList();
|
||||
|
||||
foreach (var item in result)
|
||||
{
|
||||
|
@ -170,7 +170,7 @@ namespace IRaCIS.Application.Services
|
|||
private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item,List<DicomReadingQuestionAnswer> questions,List<ReadingTaskQuestionAnswer> answers)
|
||||
{
|
||||
item.Answer = answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
||||
item.Childrens = questions.Where(x => x.ParentId == item.Id||((item.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == item.GroupName)) ).ToList();
|
||||
item.Childrens = questions.Where(x => x.ParentId == item.Id||((item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName)) ).ToList();
|
||||
if (item.Childrens != null && item.Childrens.Count > 0)
|
||||
{
|
||||
foreach (var question in item.Childrens)
|
||||
|
@ -221,7 +221,7 @@ namespace IRaCIS.Application.Services
|
|||
// 第一级
|
||||
|
||||
#region 构造问题
|
||||
List<ReadingReportDto> questions = questionList.Where(x => x.Type == "group").OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
|
||||
List<ReadingReportDto> questions = questionList.Where(x => x.Type == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
|
||||
{
|
||||
QuestionId = x.Id,
|
||||
GroupName = x.GroupName,
|
||||
|
@ -234,7 +234,7 @@ namespace IRaCIS.Application.Services
|
|||
// 分组
|
||||
foreach (var item in questions)
|
||||
{
|
||||
item.Childrens = questionList.Where(x => x.GroupName == item.GroupName&&x.Type!= "group").OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
|
||||
item.Childrens = questionList.Where(x => x.GroupName == item.GroupName&&x.Type!= ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
|
||||
{
|
||||
GroupName = x.GroupName,
|
||||
QuestionId = x.Id,
|
||||
|
@ -352,9 +352,9 @@ namespace IRaCIS.Application.Services
|
|||
#region 获取问题及答案
|
||||
|
||||
var qusetionList = await _readingQuestionTrialRepository.Where(x=>x.ReadingQuestionCriterionTrialId== criterion.Id)
|
||||
.ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider).Where(x=>x.IsShowInDicom && (x.Type == "table"||x.Type== "group")).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
.ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider).Where(x=>x.IsShowInDicom && (x.Type == ReadingQestionType.Table||x.Type== ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
|
||||
var usedGurops = qusetionList.Where(x => x.Type == "table").Select(x => x.GroupName).ToList();
|
||||
var usedGurops = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupName).ToList();
|
||||
qusetionList = qusetionList.Where(x =>usedGurops.Contains(x.GroupName)).ToList();
|
||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
||||
|
||||
|
@ -395,13 +395,13 @@ namespace IRaCIS.Application.Services
|
|||
IsPublicPage = firstData.IsPublicPage,
|
||||
};
|
||||
|
||||
var pageGroupList = newPageQusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
pageGroupList.ForEach(x =>
|
||||
{
|
||||
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, tableAnswers, tableAnsweRowInfos);
|
||||
});
|
||||
|
||||
page.Childrens = pageGroupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
|
||||
page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||
groupList.Add(page);
|
||||
}
|
||||
|
||||
|
@ -412,13 +412,13 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
|
||||
|
||||
groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
groupList.ForEach(x =>
|
||||
{
|
||||
this.FindChildQuestion(x, qusetionList, tableQuestionList, tableAnswers, tableAnsweRowInfos);
|
||||
});
|
||||
|
||||
groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
|
||||
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||
|
||||
result.SinglePage = groupList;
|
||||
|
||||
|
@ -443,7 +443,7 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="tableQuestionLists"></param>
|
||||
private void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists,List<ReadingTableQuestionAnswerInfo> tableAnswers,List<ReadingTableAnswerRowInfo> tableAnsweRowInfos)
|
||||
{
|
||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
|
||||
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();
|
||||
|
||||
item.TableQuestions.Questions = tableQuestionLists.Where(x => x.ReadingQuestionId == item.Id).OrderBy(x=>x.ShowOrder).ToList();
|
||||
|
@ -1157,13 +1157,13 @@ namespace IRaCIS.Application.Services
|
|||
IsPublicPage = firstData.IsPublicPage,
|
||||
};
|
||||
|
||||
var pageGroupList = newPageQusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
pageGroupList.ForEach(x =>
|
||||
{
|
||||
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList);
|
||||
});
|
||||
|
||||
page.Childrens = pageGroupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
|
||||
page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||
groupList.Add(page);
|
||||
}
|
||||
|
||||
|
@ -1174,13 +1174,13 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
|
||||
|
||||
groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
groupList.ForEach(x =>
|
||||
{
|
||||
this.FindChildQuestion(x, qusetionList, tableQuestionList);
|
||||
});
|
||||
|
||||
groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
|
||||
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||
|
||||
result.SinglePage = groupList;
|
||||
|
||||
|
@ -1269,13 +1269,13 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
//qusetionList = qusetionList.Where(x => x.ParentId == null).ToList();
|
||||
|
||||
groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
groupList.ForEach(x =>
|
||||
{
|
||||
this.FindSystemChildQuestion(x, qusetionList, tableQuestionList);
|
||||
});
|
||||
|
||||
groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
|
||||
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||
|
||||
result.SinglePage = groupList;
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="tableQuestions"></param>
|
||||
public void FindSystemChildQuestion(GetSystemReadingQuestionOutDto item, List<GetSystemReadingQuestionOutDto> questionlists,List<TableQuestionDataInfo> tableQuestions)
|
||||
{
|
||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
|
||||
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.Childrens.AddRange(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).Select(x => new GetSystemReadingQuestionOutDto
|
||||
{
|
||||
|
@ -1614,7 +1614,7 @@ namespace IRaCIS.Application.Services
|
|||
[NonDynamicMethod]
|
||||
public void FindChildQuestion(GetTrialReadingQuestionOutDto item, List<GetTrialReadingQuestionOutDto> questionlists,List<TableQuestionDataInfo> tableQuestions)
|
||||
{
|
||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
|
||||
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.Childrens.AddRange(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).Select(x => new GetTrialReadingQuestionOutDto
|
||||
|
|
|
@ -1308,7 +1308,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<List<string>> GetTrialGroupNameList(GetTrialGroupNameListInDto inDto)
|
||||
{
|
||||
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.Type == "group")
|
||||
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.Type == ReadingQestionType.Group)
|
||||
.Where(x=>x.ReadingCriterionPageId==inDto.ReadingCriterionPageId)
|
||||
.Select(x => x.GroupName).ToListAsync();
|
||||
|
||||
|
@ -1325,7 +1325,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<List<string>> GetSystemGroupNameList(GetTrialGroupNameListInDto inDto)
|
||||
{
|
||||
var result = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.CriterionId && x.Type == "group")
|
||||
var result = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.CriterionId && x.Type == ReadingQestionType.Group)
|
||||
.Select(x => x.GroupName).ToListAsync();
|
||||
return result;
|
||||
|
||||
|
|
|
@ -7,9 +7,18 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace IRaCIS.Core.Domain.Share
|
||||
{
|
||||
/// <summary>
|
||||
/// 模块枚举
|
||||
/// </summary>
|
||||
|
||||
public static class ReadingQestionType
|
||||
{
|
||||
|
||||
public static readonly string Table = "table";
|
||||
|
||||
public static readonly string Group = "group";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 模块枚举
|
||||
/// </summary>
|
||||
public enum ModuleTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue