Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
This commit is contained in:
+128
-1
@@ -1370,8 +1370,135 @@ namespace IRaCIS.Application.Services
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_Idnotcorrespond"]);
|
||||
}
|
||||
}
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
|
||||
switch (taskinfo.TrialReadingCriterion.CriterionType)
|
||||
{
|
||||
// 对于非靶病灶,如果状态选择为显著增大,请验证:
|
||||
// 1) 对于非淋巴结病灶,验证当前访视该病灶的长径 > 上一访视该病灶的长径。
|
||||
// 约束条件:两次访视该病灶的长径有测量值。
|
||||
// 提示语:当前访视该非淋巴结病灶的长径小于上一访视的值,不能设置为显著增大。
|
||||
// 2) 对于淋巴结病灶,验证当前访视该病灶的短径 > 上一访视该病灶的短径。
|
||||
// 约束条件:两次访视该病灶的短径有测量值。
|
||||
// 提示语:当前访视该淋巴结病灶的短径小于上一访视的值,不能设置为显著增大。
|
||||
case CriterionType.RECIST1Pointt1:
|
||||
var lastTaskinfo = await _visitTaskRepository
|
||||
.Where(x => x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||
x.SubjectId==taskinfo.SubjectId&&
|
||||
x.ReadingCategory == taskinfo.ReadingCategory &&
|
||||
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||
x.ArmEnum == taskinfo.ArmEnum &&
|
||||
x.TrialReadingCriterionId==taskinfo.TrialReadingCriterionId&&
|
||||
x.ReadingTaskState==ReadingTaskState.HaveSigned&&
|
||||
x.TaskState == TaskState.Effect &&
|
||||
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||
x.VisitTaskNum < taskinfo.VisitTaskNum
|
||||
).OrderByDescending(x => x.VisitTaskNum).FirstOrDefaultAsync();
|
||||
if (lastTaskinfo != null)
|
||||
{
|
||||
var tablequestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId&&x.ReadingQuestionTrial.LesionType==LesionType.NonTargetLesions).ToListAsync();
|
||||
|
||||
|
||||
|
||||
// 判断表格问题是否为空
|
||||
if (tablequestionList.Count > 0)
|
||||
{
|
||||
// 找到状态值
|
||||
var stateQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.State).FirstOrDefault();
|
||||
|
||||
if (stateQuestion != null)
|
||||
{
|
||||
// 判断是否为非靶病灶
|
||||
if (inDto.QuestionId == tablequestionList[0].ReadingQuestionId && inDto.AnswerList.Any(x => x.TableQuestionId== stateQuestion.Id&&x.Answer.EqEnum(NoTargetState.Increase)))
|
||||
{
|
||||
var lymphQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.IsLymph).FirstOrDefault();
|
||||
if (lymphQuestion != null)
|
||||
{
|
||||
|
||||
// 判断是否是淋巴结
|
||||
if (inDto.AnswerList.Any(x => x.TableQuestionId == lymphQuestion.Id && x.Answer.EqEnum(YesOrNoOrNa.Yes)))
|
||||
{
|
||||
var shortAxisQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).FirstOrDefault();
|
||||
if (shortAxisQuestion != null)
|
||||
{
|
||||
var lastAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTaskinfo.Id && x.TableQuestionId == shortAxisQuestion.Id
|
||||
&& x.RowIndex == inDto.RowIndex
|
||||
).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||
|
||||
var thisAnswer = inDto.AnswerList.Where(x => x.TableQuestionId == shortAxisQuestion.Id).Select(x => x.Answer).FirstOrDefault();
|
||||
if (!lastAnswer.IsNullOrEmpty() && !thisAnswer.IsNullOrEmpty())
|
||||
{
|
||||
|
||||
var lastvalue = 0m;
|
||||
var thisvalue = 0m;
|
||||
try
|
||||
{
|
||||
lastvalue = decimal.Parse(lastAnswer);
|
||||
thisvalue = decimal.Parse(thisAnswer);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (lastvalue >= thisvalue)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_IsLymphNotbigger"]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
var majorAxisQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).FirstOrDefault();
|
||||
if (majorAxisQuestion != null)
|
||||
{
|
||||
var lastAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTaskinfo.Id && x.TableQuestionId == majorAxisQuestion.Id
|
||||
&& x.RowIndex == inDto.RowIndex
|
||||
).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||
|
||||
var thisAnswer = inDto.AnswerList.Where(x => x.TableQuestionId == majorAxisQuestion.Id).Select(x => x.Answer).FirstOrDefault();
|
||||
if (!lastAnswer.IsNullOrEmpty() && !thisAnswer.IsNullOrEmpty())
|
||||
{
|
||||
var lastvalue = 0m;
|
||||
var thisvalue = 0m;
|
||||
try
|
||||
{
|
||||
lastvalue = decimal.Parse(lastAnswer);
|
||||
thisvalue = decimal.Parse(thisAnswer);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (lastvalue >= thisvalue)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NotLymphNotbigger"]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
|
||||
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync();
|
||||
|
||||
Reference in New Issue
Block a user