diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index 77b03262a..9c7828668 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -203,6 +203,8 @@ "ReadingImage_NotaTask": "The coalesced lesions are not from the same timepoint. ", "ReadingImage_DeleteError": "Other lesions have split from or coalesced into the current lesion. Deletion failed.", "ReadingImage_Idnotcorrespond": "Failed to add the lesion mark. The Instance ID and Series ID of the image do not match.", + "ReadingImage_IsLymphNotbigger": "", + "ReadingImage_NotLymphNotbigger": "", "ReadingImage_Twice": "System call error. Questions & answers submitted are duplicated.", "ReadingImage_MaxQuestion": "According to the imaging charter, the number of the current type of lesion cannot exceed {0}.", "ReadingImage_Maxlesion": "According to the imaging charter, the number of target lesions in the same organ cannot exceed {0}. Please confirm.", @@ -255,5 +257,6 @@ + } diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 84b6dccd3..b4b15072b 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -194,8 +194,6 @@ //SystemAnonymizationService - //ReadingGlobalTaskService - "ReadingGlobal_NotGlobal": "系统调用错误,当前任务不是全局阅片任务。", //ReadingImageTaskService "ReadingImage_NotVisit": "系统调用错误,当前任务不是访视任务。", "ReadingImage_CantSplit": "当前任务是基线任务,不能执行分裂病灶的操作。", @@ -204,6 +202,8 @@ "ReadingImage_NotaTask": "合并的病灶并非同一个访视任务", "ReadingImage_DeleteError": "当前病灶分裂出其他病灶或者其他病灶合并到了当前病灶,删除失败。", "ReadingImage_Idnotcorrespond": "病灶标记添加失败,影像的Instance ID和Series ID不对应。", + "ReadingImage_IsLymphNotbigger": "当前访视该淋巴结病灶的短径小于上一访视的值,不能设置为显著增大。", + "ReadingImage_NotLymphNotbigger": "当前访视该非淋巴结病灶的长径小于上一访视的值,不能设置为显著增大。", "ReadingImage_Twice": "系统调用错误,提交的问题及答案重复。", "ReadingImage_MaxQuestion": "按照《独立影像评估章程》的相关规则,当前病灶类型的病灶数量不超过{0}个。", "ReadingImage_Maxlesion": "按照《独立影像评估章程》的相关规则,同一器官的靶病灶数量不超过{0}个,请确认", @@ -251,5 +251,6 @@ + } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index dada12c9a..02129acd8 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1370,8 +1370,116 @@ 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.ReadingCategory == taskinfo.ReadingCategory && + x.DoctorUserId == taskinfo.DoctorUserId && + x.ArmEnum == taskinfo.ArmEnum && + 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()) + { + try + { + if (decimal.Parse(lastAnswer) >= decimal.Parse(thisAnswer)) + { + throw new BusinessValidationFailedException(_localizer["ReadingImage_IsLymphNotbigger"]); + } + } + catch (Exception) + { + + + } + } + } + } + else + + { + var majorAxisQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).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()) + { + try + { + if (decimal.Parse(lastAnswer) >= decimal.Parse(thisAnswer)) + { + throw new BusinessValidationFailedException(_localizer["ReadingImage_NotLymphNotbigger"]); + } + } + catch (Exception) + { + + + } + } + } + } + } + + + } + } + + } + + } + 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(); diff --git a/后端提示语.xlsx b/后端提示语.xlsx index f0a499874..425aeb4d5 100644 Binary files a/后端提示语.xlsx and b/后端提示语.xlsx differ