Uat_Study
he 2023-03-22 16:08:58 +08:00
parent a59f71a01e
commit 424174636e
1 changed files with 159 additions and 130 deletions

View File

@ -286,7 +286,8 @@ namespace IRaCIS.Application.Services
} }
else else
{ {
await _readingTaskQuestionAnswerRepository.AddAsync(new ReadingTaskQuestionAnswer() { await _readingTaskQuestionAnswerRepository.AddAsync(new ReadingTaskQuestionAnswer()
{
Answer = item.Answer, Answer = item.Answer,
ReadingQuestionCriterionTrialId = visitTask.TrialReadingCriterionId, ReadingQuestionCriterionTrialId = visitTask.TrialReadingCriterionId,
ReadingQuestionTrialId = item.QuestionId, ReadingQuestionTrialId = item.QuestionId,
@ -489,7 +490,8 @@ namespace IRaCIS.Application.Services
taskQuery = _visitTaskRepository.Where(x => taskInfo.PastResultTaskIdList.Contains(x.Id)); taskQuery = _visitTaskRepository.Where(x => taskInfo.PastResultTaskIdList.Contains(x.Id));
} }
var readingPastResultList = await taskQuery.Select(x => new GetReadingPastResultListOutDto() { var readingPastResultList = await taskQuery.Select(x => new GetReadingPastResultListOutDto()
{
VisitTaskId = x.Id, VisitTaskId = x.Id,
TaskBlindName = x.TaskBlindName, TaskBlindName = x.TaskBlindName,
TaskName = x.TaskName, TaskName = x.TaskName,
@ -623,7 +625,8 @@ namespace IRaCIS.Application.Services
.WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table) .WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
.WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table) .WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
.ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider,new{ .ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us isEn_Us = _userInfo.IsEn_Us
}).OrderBy(x => x.ShowOrder).ToListAsync(); }).OrderBy(x => x.ShowOrder).ToListAsync();
@ -776,7 +779,8 @@ namespace IRaCIS.Application.Services
var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
var questionPage = await GetReadingTableQuestion( var questionPage = await GetReadingTableQuestion(
new GetReadingTableQuestionOrAnswerInDto() { new GetReadingTableQuestionOrAnswerInDto()
{
TrialReadingCriterionId = taskinfo.TrialReadingCriterionId, TrialReadingCriterionId = taskinfo.TrialReadingCriterionId,
TaskId = inDto.VisitTaskId, TaskId = inDto.VisitTaskId,
@ -837,7 +841,8 @@ namespace IRaCIS.Application.Services
OrganInfos = organList OrganInfos = organList
} }
),new { ), new
{
IsBaseline = taskInfo.SourceSubjectVisit != null && taskInfo.SourceSubjectVisit.IsBaseLine, IsBaseline = taskInfo.SourceSubjectVisit != null && taskInfo.SourceSubjectVisit.IsBaseLine,
ReadingTaskState = taskInfo.ReadingTaskState ReadingTaskState = taskInfo.ReadingTaskState
}); });
@ -854,7 +859,8 @@ namespace IRaCIS.Application.Services
{ {
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider,new { var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us isEn_Us = _userInfo.IsEn_Us
@ -923,7 +929,8 @@ namespace IRaCIS.Application.Services
var qusetionIds = qusetionList.Select(x => x.Id).ToList(); var qusetionIds = qusetionList.Select(x => x.Id).ToList();
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId)) var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId))
.ProjectTo<TableQuestionTrial>(_mapper.ConfigurationProvider,new { .ProjectTo<TableQuestionTrial>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us isEn_Us = _userInfo.IsEn_Us
}) })
@ -934,6 +941,8 @@ namespace IRaCIS.Application.Services
List<ReadingTableQuestionAnswer> baseLineTableAnswer = new List<ReadingTableQuestionAnswer>(); List<ReadingTableQuestionAnswer> baseLineTableAnswer = new List<ReadingTableQuestionAnswer>();
bool isFirstChangeTask = false;
if (inDto.TaskId != null) if (inDto.TaskId != null)
{ {
taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync(); taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync();
@ -950,6 +959,23 @@ namespace IRaCIS.Application.Services
baseLineTableAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == baselineTaskId).Include(x => x.ReadingTableQuestionTrial).ToListAsync(); baseLineTableAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == baselineTaskId).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
if (taskInfo.IsConvertedTask &&
!(await _visitTaskRepository.AnyAsync(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
&& x.IsSelfAnalysis == taskInfo.IsSelfAnalysis
&& x.VisitTaskNum < taskInfo.VisitTaskNum
&& x.DoctorUserId == taskInfo.DoctorUserId
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
&& !x.IsConvertedTask
&& x.SubjectId == taskInfo.SubjectId
&& x.ArmEnum == taskInfo.ArmEnum &&
x.TaskState == TaskState.Effect))
)
{
isFirstChangeTask = true;
}
} }
if (criterionInfo.FormType == FormType.MultiplePage) if (criterionInfo.FormType == FormType.MultiplePage)
{ {
@ -969,7 +995,7 @@ namespace IRaCIS.Application.Services
var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList(); var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
pageGroupList.ForEach(x => pageGroupList.ForEach(x =>
{ {
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos,inDto.OrganInfos, baseLineTableAnswer); this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask);
}); });
page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
@ -986,7 +1012,7 @@ namespace IRaCIS.Application.Services
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList(); groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
groupList.ForEach(x => groupList.ForEach(x =>
{ {
this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer); this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask);
}); });
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
@ -1006,7 +1032,7 @@ namespace IRaCIS.Application.Services
/// <param name="item"></param> /// <param name="item"></param>
/// <param name="questionlists"></param> /// <param name="questionlists"></param>
/// <param name="tableQuestionLists"></param> /// <param name="tableQuestionLists"></param>
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos,List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer) private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer,bool isFirstChangeTask)
{ {
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || x.GroupId == item.Id).ToList(); item.Childrens = questionlists.Where(x => x.ParentId == item.Id || x.GroupId == item.Id).ToList();
item.TableQuestions = new TrialReadTableQuestion(); item.TableQuestions = new TrialReadTableQuestion();
@ -1129,6 +1155,7 @@ namespace IRaCIS.Application.Services
answers.Add("BlindName", rowInfo.BlindName); answers.Add("BlindName", rowInfo.BlindName);
answers.Add("IsFirstChangeTask", isFirstChangeTask.ToString());
answers.Add("FromMark", rowInfo.FromMark); answers.Add("FromMark", rowInfo.FromMark);
answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString()); answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString());
answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData); answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData);
@ -1155,7 +1182,7 @@ namespace IRaCIS.Application.Services
{ {
item.Childrens.ForEach(x => item.Childrens.ForEach(x =>
{ {
this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer); this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask);
}); });
} }
} }
@ -1369,7 +1396,8 @@ namespace IRaCIS.Application.Services
IsDeleted = true IsDeleted = true
}); });
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId,x=>new ReadingTableAnswerRowInfo() { await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId, x => new ReadingTableAnswerRowInfo()
{
IsDeleted = true IsDeleted = true
}); });
@ -2120,7 +2148,8 @@ namespace IRaCIS.Application.Services
{ {
TrialId = inDto.TrialId, TrialId = inDto.TrialId,
TrialReadingCriterionId = trialReadingCriterionId.Value, TrialReadingCriterionId = trialReadingCriterionId.Value,
Page=new PageInput() { Page = new PageInput()
{
PageIndex = 1, PageIndex = 1,
PageSize = 99999, PageSize = 99999,
} }