From 7b853c74f3c167cff3cea3c53d39a26bab6fc1ce Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Fri, 26 May 2023 16:18:35 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bm=E9=80=80=E5=9B=9E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 19 ++-
.../Service/Allocation/VisitTaskService.cs | 142 +++++++++++-------
2 files changed, 101 insertions(+), 60 deletions(-)
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index ecb34cf08..489d8d0e0 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -1382,9 +1382,9 @@
-
+
- 与前一访视相比iSOD变化量
+ 与触发iRECIST访视相比iSOD变化量
@@ -7474,6 +7474,11 @@
与基线期SOD相比减小≥30 %
+
+
+ 非靶病灶中淋巴结病灶全部消失
+
+
IRECIST 非靶病灶
@@ -7554,6 +7559,16 @@
至少有一个新靶病无法评估
+
+
+ 当有“存在”状态的淋巴结新靶病灶
+
+
+
+
+ 当有“存在”或“太小”状态的非淋巴结新靶病灶
+
+
其他既往新病灶
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
index e651ccf6e..9929211b8 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
@@ -1092,7 +1092,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
.WhereIf(!string.IsNullOrEmpty(inDto.SubjectCode), t => (t.Subject.Code.Contains(inDto.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inDto.SubjectCode) && t.IsAnalysisCreate));
- var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
+ var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
{
@@ -1141,7 +1141,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
// 不这样写会有问题
var count = visitQuery.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
- .GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }).Count();
+ .GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }).Count();
var result = new List();
@@ -1336,7 +1336,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
// 针对同一个subject 不同阅片人 针对同一个访视申请重阅,是允许的,所以同一阅片人,针对同一suject 有访视申请重阅还未处理,不允许申请重阅
if (await _visitTaskReReadingRepository.AnyAsync(t => t.OriginalReReadingTask.TrialId == task.TrialId && t.OriginalReReadingTask.SubjectId == task.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect
- && t.OriginalReReadingTask.TrialReadingCriterionId == task.TrialReadingCriterionId &&t.OriginalReReadingTask.DoctorUserId==task.DoctorUserId
+ && t.OriginalReReadingTask.TrialReadingCriterionId == task.TrialReadingCriterionId && t.OriginalReReadingTask.DoctorUserId == task.DoctorUserId
&& t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.DocotorApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default))
{
//---当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅
@@ -1540,6 +1540,27 @@ namespace IRaCIS.Core.Application.Service.Allocation
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
+
+ //附加评估 IR 和PM 看到的影响列表不一样 //1.1 有附加评估,会影响其他标准的任务
+ if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment)
+ {
+ if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM)
+ {
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
+ }
+ else
+ {
+
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId);
+ }
+ }
+ else
+ {
+ //默认影响的都是该标准的任务
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId);
+ }
+
+
if (agreeReReadingCommand.RequestReReadingResultEnum == RequestReReadingResult.Agree)
{
//PM申请 SPM / CPM审批 回退访视,在此不生成访视任务 影响多个标准的任务
@@ -1735,39 +1756,12 @@ namespace IRaCIS.Core.Application.Service.Allocation
//IR申请 PM 审批 注意这里有一致性分析的申请同意 不会回退访视,在此要生成影响的访视任务
else if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.DocotorApply && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.AIR))
{
- // #region 两个IR 申请同一访视,其他人的申请记录也设置为同意
- // await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.OriginalReReadingTask.SubjectId == origenalTask.SubjectId &&
- // t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed &&
- // t.RequestReReadingType == RequestReReadingType.DocotorApply &&
- //t.OriginalReReadingTask.VisitTaskNum == origenalTask.VisitTaskNum &&
- //t.Id != item.Id, u => new VisitTaskReReading()
- //{
- // RequestReReadingConfirmUserId = _userInfo.Id,
- // RequestReReadingResultEnum = RequestReReadingResult.Agree,
- //});
-
- // #endregion
-
//有序阅片
if (criterionConfig.IsReadingTaskViewInOrder)
- {
- //1.1 有附加评估,会影响其他标准的任务
- if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment == true)
- {
- filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
-
- }
- else
- {
- filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId);
- }
-
-
-
-
+ {
#region 有序 IR 申请 重阅 影响的其他访视查询
@@ -1879,7 +1873,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
-
+
if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
{
@@ -1895,7 +1889,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
// 影响的任务 仅仅访视类别的才生成 或者就是IR 申请的任务
- if ( influenceTask.ReadingCategory == ReadingCategory.Visit || influenceTask.Id == origenalTask.Id)
+ if (influenceTask.ReadingCategory == ReadingCategory.Visit || influenceTask.Id == origenalTask.Id)
{
@@ -1908,11 +1902,11 @@ namespace IRaCIS.Core.Application.Service.Allocation
// i1.1标准 当前任务是转变任务,并且影响列表里有转变之前的任务 那么该访视任务就不生成
- if (criterionConfig.CriterionType == CriterionType.IRECIST1Point1 )
+ if (criterionConfig.CriterionType == CriterionType.IRECIST1Point1)
{
//申请的任务是冻结的任务(该任务发生转变) 影响自己 以及转变后的 以及后续任务 但是生成的时候,仅仅生成转变之前的
//申请的是转变之后的任务 (转变生成的任务) 影响自己以及后续任务 生成转变后的任务
- if ( influenceTask.BeforeConvertedTaskId != null && influenceTaskList.Any(t => t.Id == influenceTask.BeforeConvertedTaskId))
+ if (influenceTask.BeforeConvertedTaskId != null && influenceTaskList.Any(t => t.Id == influenceTask.BeforeConvertedTaskId))
{
//有转化的任务 和转化之前的任务时,转化后的任务时不生成的
continue;
@@ -1947,7 +1941,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
newTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
- if (visitTaskReReadingAppply.IsCopyOrigenalForms && influenceTask.Id==origenalTask.Id)
+ if (visitTaskReReadingAppply.IsCopyOrigenalForms && influenceTask.Id == origenalTask.Id)
{
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
{
@@ -2031,7 +2025,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
else
{
- filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId);
+
//1.当前任务及裁判任务
//2.影响当前阅片人的任务
filterExpression = filterExpression.And(t => t.Id == origenalTask.Id || t.Id == origenalTask.JudgeVisitTaskId);
@@ -2090,7 +2084,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
newTask.TaskAllocationState = TaskAllocationState.Allocated;
newTask.AllocateTime = DateTime.Now;
newTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
-
+
//裁判任务 需要进行特殊处理 在重阅逻辑里面处理
@@ -2109,7 +2103,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
}
-
+
}
//拷贝后续表单
@@ -2201,7 +2195,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
var task = (await _visitTaskRepository.Where(t => t.Id == taskId).FirstOrDefaultAsync()).IfNullThrowException();
- var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == task.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.CriterionType, x.IsAutoCreate, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
+ var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == task.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.CriterionType, x.IsAutoCreate, x.IsAdditionalAssessment, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
if (criterionConfig.IsAutoCreate == false)
{
@@ -2230,6 +2224,27 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
+
+
+ //附加评估 IR 和PM 看到的影响列表不一样
+ if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment)
+ {
+ if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM)
+ {
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
+ }
+ else
+ {
+
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId);
+ }
+ }
+ else
+ {
+ //默认影响的都是该标准的任务
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId);
+ }
+
//PM 才允许操作
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
{
@@ -2454,7 +2469,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
//BM后续访视 ,筛选状态不变,任务生成状态重置(实际该访视任务状态 可能是重阅重置了或者失效了,需要后续生成,或者取消分配了,需要后续重新分配)
- await _subjectCriteriaEvaluationVisitFilterRepository.BatchUpdateNoTrackingAsync(t => t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB && t.SubjectVisit.SubjectId == task.SubjectId && otherVisitIdList.Contains(t.SubjectVisitId),
+ await _subjectCriteriaEvaluationVisitFilterRepository.UpdatePartialFromQueryAsync(t => t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB && t.SubjectVisit.SubjectId == task.SubjectId && otherVisitIdList.Contains(t.SubjectVisitId),
t => new SubjectCriteriaEvaluationVisitFilter()
{
IsGeneratedTask = false
@@ -2560,6 +2575,29 @@ namespace IRaCIS.Core.Application.Service.Allocation
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == filterObj.IsAnalysisCreate);
+
+
+ //附加评估 IR 和PM 看到的影响列表不一样
+ if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment)
+ {
+ if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM)
+ {
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
+ }
+ else
+ {
+
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId);
+ }
+ }
+ else
+ {
+ //默认影响的都是该标准的任务
+ filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId);
+ }
+
+
+
//重阅影响
if (isReReading)
{
@@ -2572,24 +2610,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|| (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null))
{
- //附加评估 IR 和PM 看到的影响列表不一样
- if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment)
- {
- if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
- {
- filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
- }
- else
- {
- filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId);
- }
- }
- else
- {
- //默认影响的都是该标准的任务
- filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId);
- }
+
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务
@@ -2702,6 +2724,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
else if (((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM) && applyId != null && await _visitTaskReReadingRepository.AnyAsync(t => t.Id == applyId && t.CreateUser.UserTypeEnum == UserTypeEnum.ProjectManager) && filterObj.IsAnalysisCreate == false && filterObj.ReadingCategory == ReadingCategory.Visit)
|| (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId == null))
{
+
+
+
+
//有序
if (criterionConfig.IsReadingTaskViewInOrder)
{