Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
commit
3efc173056
|
@ -1649,10 +1649,14 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
|
||||||
case CriterionType.Lugano2014:
|
case CriterionType.Lugano2014:
|
||||||
query = query.Where(x => x.MeasureData == string.Empty ||
|
// (无法评估 或者 状态为消失的非靶病灶) 并且不能是无法评估的病灶
|
||||||
|
query = query.Where(x =>
|
||||||
|
(x.MeasureData == string.Empty ||
|
||||||
(x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && y.Answer == TargetState.Loss.GetEnumInt()) &&
|
(x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && y.Answer == TargetState.Loss.GetEnumInt()) &&
|
||||||
x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.IsLymph && y.Answer == ReadingYesOrNo.No.GetEnumInt())
|
x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.IsLymph && y.Answer == ReadingYesOrNo.No.GetEnumInt())
|
||||||
));
|
)&& !x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && y.Answer == TargetState.UnableEvaluate.GetEnumInt()))
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
|
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository;
|
private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository;
|
||||||
private readonly IGeneralCalculateService _generalCalculateService;
|
private readonly IGeneralCalculateService _generalCalculateService;
|
||||||
|
@ -42,6 +43,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
|
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentRepository,
|
IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentRepository,
|
||||||
IGeneralCalculateService generalCalculateService,
|
IGeneralCalculateService generalCalculateService,
|
||||||
|
@ -56,6 +58,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||||
this._organInfoRepository = organInfoRepository;
|
this._organInfoRepository = organInfoRepository;
|
||||||
|
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
|
||||||
this._subjectVisitRepository = subjectVisitRepository;
|
this._subjectVisitRepository = subjectVisitRepository;
|
||||||
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
||||||
this._generalCalculateService = generalCalculateService;
|
this._generalCalculateService = generalCalculateService;
|
||||||
|
@ -174,7 +177,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new
|
||||||
|
{
|
||||||
|
x.TaskId,
|
||||||
|
x.GlobalVisitTask.VisitTaskNum,
|
||||||
|
x.QuestionId,
|
||||||
|
x.Answer
|
||||||
|
}).ToListAsync();
|
||||||
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
||||||
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||||
|
@ -241,13 +250,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
foreach (var task in taskInfoList)
|
foreach (var task in taskInfoList)
|
||||||
{
|
{
|
||||||
|
var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault();
|
||||||
|
|
||||||
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
||||||
question.Answer.Add(new TaskQuestionAnswer()
|
question.Answer.Add(new TaskQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = answer==null?string.Empty:answer.Answer,
|
Answer = answer==null?string.Empty:answer.Answer,
|
||||||
IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
|
IsGlobalChange = globalAnswer == null ? false : true,
|
||||||
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
|
GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer,
|
||||||
TaskName = task.TaskName,
|
TaskName = task.TaskName,
|
||||||
VisitTaskId = task.VisitTaskId,
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||||
private readonly IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository;
|
private readonly IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository;
|
||||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||||
|
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
|
@ -46,6 +47,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||||
IRepository<ReadingTaskQuestionMark> readingTaskQuestionMarkRepository,
|
IRepository<ReadingTaskQuestionMark> readingTaskQuestionMarkRepository,
|
||||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||||
|
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
|
@ -62,6 +64,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||||
this._readingTaskQuestionMarkRepository = readingTaskQuestionMarkRepository;
|
this._readingTaskQuestionMarkRepository = readingTaskQuestionMarkRepository;
|
||||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||||
|
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
|
||||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||||
this._organInfoRepository = organInfoRepository;
|
this._organInfoRepository = organInfoRepository;
|
||||||
this._subjectVisitRepository = subjectVisitRepository;
|
this._subjectVisitRepository = subjectVisitRepository;
|
||||||
|
@ -160,6 +163,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
|
||||||
|
var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId)&&x.GlobalVisitTask.TaskState== TaskState.Effect&&x.Answer!=string.Empty).Select(x => new
|
||||||
|
{
|
||||||
|
x.TaskId,
|
||||||
|
x.GlobalVisitTask.VisitTaskNum,
|
||||||
|
x.QuestionId,
|
||||||
|
x.Answer
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
||||||
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||||
|
@ -227,12 +238,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
foreach (var task in taskInfoList)
|
foreach (var task in taskInfoList)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault();
|
||||||
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
||||||
question.Answer.Add(new TaskQuestionAnswer()
|
question.Answer.Add(new TaskQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = answer == null ? string.Empty : answer.Answer,
|
Answer = answer == null ? string.Empty : answer.Answer,
|
||||||
IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
|
IsGlobalChange = globalAnswer == null ? false : true,
|
||||||
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
|
GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer,
|
||||||
TaskName = task.TaskName,
|
TaskName = task.TaskName,
|
||||||
VisitTaskId = task.VisitTaskId,
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
|
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository;
|
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository;
|
||||||
|
@ -36,6 +37,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
|
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
||||||
|
@ -49,6 +51,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||||
|
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
|
||||||
this._organInfoRepository = organInfoRepository;
|
this._organInfoRepository = organInfoRepository;
|
||||||
this._subjectVisitRepository = subjectVisitRepository;
|
this._subjectVisitRepository = subjectVisitRepository;
|
||||||
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
||||||
|
@ -128,7 +131,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}).ToList();
|
}).ToList();
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new
|
||||||
|
{
|
||||||
|
x.TaskId,
|
||||||
|
x.GlobalVisitTask.VisitTaskNum,
|
||||||
|
x.QuestionId,
|
||||||
|
x.Answer
|
||||||
|
}).ToListAsync();
|
||||||
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
||||||
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||||
|
@ -195,13 +204,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
foreach (var task in taskInfoList)
|
foreach (var task in taskInfoList)
|
||||||
{
|
{
|
||||||
|
var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault();
|
||||||
|
|
||||||
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
||||||
question.Answer.Add(new TaskQuestionAnswer()
|
question.Answer.Add(new TaskQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = answer==null?string.Empty:answer.Answer,
|
Answer = answer==null?string.Empty:answer.Answer,
|
||||||
IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
|
IsGlobalChange = globalAnswer == null ? false : true,
|
||||||
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
|
GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer,
|
||||||
TaskName = task.TaskName,
|
TaskName = task.TaskName,
|
||||||
VisitTaskId = task.VisitTaskId,
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
|
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<TumorAssessment_RECIST1Point1BM> _tumorAssessment_RECIST1Point1BM;
|
private readonly IRepository<TumorAssessment_RECIST1Point1BM> _tumorAssessment_RECIST1Point1BM;
|
||||||
private readonly IGeneralCalculateService _generalCalculateService;
|
private readonly IGeneralCalculateService _generalCalculateService;
|
||||||
|
@ -37,6 +38,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
|
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<TumorAssessment_RECIST1Point1BM> tumorAssessment_RECIST1Point1BM,
|
IRepository<TumorAssessment_RECIST1Point1BM> tumorAssessment_RECIST1Point1BM,
|
||||||
IGeneralCalculateService generalCalculateService,
|
IGeneralCalculateService generalCalculateService,
|
||||||
|
@ -50,6 +52,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||||
this._organInfoRepository = organInfoRepository;
|
this._organInfoRepository = organInfoRepository;
|
||||||
|
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
|
||||||
this._subjectVisitRepository = subjectVisitRepository;
|
this._subjectVisitRepository = subjectVisitRepository;
|
||||||
this._tumorAssessment_RECIST1Point1BM = tumorAssessment_RECIST1Point1BM;
|
this._tumorAssessment_RECIST1Point1BM = tumorAssessment_RECIST1Point1BM;
|
||||||
this._generalCalculateService = generalCalculateService;
|
this._generalCalculateService = generalCalculateService;
|
||||||
|
@ -124,7 +127,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new
|
||||||
|
{
|
||||||
|
x.TaskId,
|
||||||
|
x.GlobalVisitTask.VisitTaskNum,
|
||||||
|
x.QuestionId,
|
||||||
|
x.Answer
|
||||||
|
}).ToListAsync();
|
||||||
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
||||||
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||||
|
@ -191,13 +200,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
foreach (var task in taskInfoList)
|
foreach (var task in taskInfoList)
|
||||||
{
|
{
|
||||||
|
var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault();
|
||||||
|
|
||||||
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
||||||
question.Answer.Add(new TaskQuestionAnswer()
|
question.Answer.Add(new TaskQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = answer==null?string.Empty:answer.Answer,
|
Answer = answer==null?string.Empty:answer.Answer,
|
||||||
IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
|
IsGlobalChange = globalAnswer == null ? false : true,
|
||||||
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
|
GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer,
|
||||||
TaskName = task.TaskName,
|
TaskName = task.TaskName,
|
||||||
VisitTaskId = task.VisitTaskId,
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||||
|
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
|
@ -36,6 +37,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||||
|
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
|
@ -51,6 +53,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||||
|
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
|
||||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||||
this._subjectVisitRepository = subjectVisitRepository;
|
this._subjectVisitRepository = subjectVisitRepository;
|
||||||
this._organInfoRepository = organInfoRepository;
|
this._organInfoRepository = organInfoRepository;
|
||||||
|
@ -129,7 +132,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new
|
||||||
|
{
|
||||||
|
x.TaskId,
|
||||||
|
x.GlobalVisitTask.VisitTaskNum,
|
||||||
|
x.QuestionId,
|
||||||
|
x.Answer
|
||||||
|
}).ToListAsync();
|
||||||
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
||||||
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||||
|
@ -202,13 +211,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
foreach (var task in taskInfoList)
|
foreach (var task in taskInfoList)
|
||||||
{
|
{
|
||||||
|
var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault();
|
||||||
|
|
||||||
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
||||||
question.Answer.Add(new TaskQuestionAnswer()
|
question.Answer.Add(new TaskQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = answer == null ? string.Empty : answer.Answer,
|
Answer = answer == null ? string.Empty : answer.Answer,
|
||||||
IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
|
IsGlobalChange = globalAnswer == null ? false : true,
|
||||||
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
|
GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer,
|
||||||
TaskName = task.TaskName,
|
TaskName = task.TaskName,
|
||||||
VisitTaskId = task.VisitTaskId,
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue