Uat_Study
he 2023-01-18 10:02:13 +08:00
parent 39f3bc738d
commit d30b12b425
3 changed files with 43 additions and 22 deletions

View File

@ -1063,6 +1063,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string Answer { get; set; }
public bool IsGlobalAnswer { get; set; } = false;
/// <summary>
/// 问题类型
/// </summary>

View File

@ -213,19 +213,40 @@ namespace IRaCIS.Application.Services
var globalReadingQuestion = await _readingGlobalTaskInfoRepository.Where(x => x.GlobalTaskId == inDto.VisitTaskId).ToListAsync();
var criterionType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).Select(x => x.CriterionType).FirstOrDefaultAsync();
//if (criterionType == CriterionType.PCWG3)
//{
// result.TaskList.ForEach(x =>
// {
// x.BeforeQuestionList.ForEach(y =>
// {
// var globalAnswer = globalReadingQuestion.Where(z => z.QuestionId == y.QuestionId).Select(z => z.Answer).FirstOrDefault();
// y.Answer = globalAnswer.IsNullOrEmpty() ? y.Answer : globalAnswer;
// });
// });
//}
// 如果不是PCWG3 Before的Answer取自于 上一次全局阅片的结果, 如果没有上一次全局阅片的结果 取访视的答案
var lastGlobalTask = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Global &&
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
x.SubjectId == taskInfo.SubjectId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.TaskState == TaskState.Effect && x.VisitTaskNum < taskInfo.VisitTaskNum)
.Where(x => x.DoctorUserId == taskInfo.DoctorUserId)
.FirstOrDefaultAsync();
List<ReadingGlobalTaskInfo>? globalAnswers = new List<ReadingGlobalTaskInfo>();
if (lastGlobalTask != null)
{
globalAnswers = await _readingGlobalTaskInfoRepository.Where(x => x.GlobalTaskId == lastGlobalTask.Id).ToListAsync();
}
if (criterionType != CriterionType.PCWG3)
{
result.TaskList.ForEach(x =>
{
x.BeforeQuestionList.ForEach(y =>
{
var globalAnswer = globalAnswers.Where(z => z.QuestionId == y.QuestionId).Select(z => z.Answer).FirstOrDefault();
if (!globalAnswer.IsNullOrEmpty())
{
y.Answer = globalAnswer;
y.IsGlobalAnswer = true;
}
});
});
}
result.TaskList.ForEach(x =>
{
x.AfterQuestionList = x.BeforeQuestionList.Where(x=>x.IsJudgeQuestion).GroupJoin(
@ -317,16 +338,8 @@ namespace IRaCIS.Application.Services
// 找到上一个全局阅片
var lastGlobalTask = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Global &&
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
x.SubjectId == taskInfo.SubjectId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.TaskState == TaskState.Effect && x.VisitTaskNum < taskInfo.VisitTaskNum)
.Where(x => x.DoctorUserId == taskInfo.DoctorUserId)
.FirstOrDefaultAsync();
List<ReadingGlobalTaskInfo>? globalAnswers = new List<ReadingGlobalTaskInfo> ();
if (lastGlobalTask != null)
{
globalAnswers= await _readingGlobalTaskInfoRepository.Where(x => x.GlobalTaskId == lastGlobalTask.Id).ToListAsync();
}
result.TaskList.ForEach(x =>
{
foreach (var item in x.AfterQuestionList.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation))

View File

@ -960,6 +960,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
return nameof(YesOrNoOrNa.NA);
}
var targetCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TargetLesion).SelectMany(x => x.TableRowInfoList).Count();
if (targetCount == 0)
{
return nameof(YesOrNoOrNa.NA);
}
var decimalAnswerList = await GetLowSODVisit(inDto);
return decimalAnswerList.OrderBy(x => x.SOD).Select(x => x.BlindName).FirstOrDefault() ?? string.Empty;
}