Uat_Study
he 2023-03-30 17:44:49 +08:00
commit 2838a21a2f
2 changed files with 107 additions and 41 deletions

View File

@ -1433,6 +1433,7 @@ namespace IRaCIS.Core.Application.Service
TrialReadingCriterionId = reReadingVisitTask.TrialReadingCriterionId,
IsNeedClinicalDataSign = reReadingVisitTask.IsNeedClinicalDataSign,
IsClinicalDataSign = reReadingVisitTask.IsClinicalDataSign,
BeforeConvertedTaskId = reReadingVisitTask.BeforeConvertedTaskId,
// TaskAllocationState = reReadingVisitTask.TaskAllocationState,
// AllocateTime = DateTime.Now,

View File

@ -1521,7 +1521,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
var criterionConfig = await _trialReadingCriterionRepository.Where(x => x.Id == origenalTask.TrialReadingCriterionId).Select(x => new { x.ReadingTool,x.CriterionType,x.IsAdditionalAssessment, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync();
var criterionConfig = await _trialReadingCriterionRepository.Where(x => x.Id == origenalTask.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.CriterionType, x.IsAdditionalAssessment, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync();
//更新申请信息
@ -1815,8 +1815,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
//有序阅片
if (criterionConfig.IsReadingTaskViewInOrder)
{
if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment==true)
//1.1 有附加评估,会影响其他标准的任务
if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment == true)
{
filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
@ -1837,11 +1837,38 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
case ReadingCategory.Visit:
//影响后续访视已经读完的,正在读的,未读的不做处理 以及其他类型任务
//申请的是转化的,那么影响列表要排除转化之前的
if (criterionConfig.CriterionType == CriterionType.IRECIST1Point1 && origenalTask.BeforeConvertedTaskId != null)
{
filterExpression = filterExpression.And(t => (t.VisitTaskNum > origenalTask.VisitTaskNum &&
(
(((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.WaitReading) || t.ReadingCategory == ReadingCategory.Global) && t.DoctorUserId == origenalTask.DoctorUserId)
// 裁判 肿瘤学是另外的医生做
|| t.ReadingCategory == ReadingCategory.Judge
|| t.ReadingCategory == ReadingCategory.Oncology
)) || t.Id == origenalTask.Id)
;
}
else
{
filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum &&
((t.DoctorUserId == origenalTask.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.WaitReading) || t.ReadingCategory == ReadingCategory.Global))
||
t.ReadingCategory == ReadingCategory.Judge || t.ReadingCategory == ReadingCategory.Oncology)
(
(((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.WaitReading) || t.ReadingCategory == ReadingCategory.Global) && t.DoctorUserId == origenalTask.DoctorUserId)
// 裁判 肿瘤学是另外的医生做
|| t.ReadingCategory == ReadingCategory.Judge
|| t.ReadingCategory == ReadingCategory.Oncology
)
);
}
break;
@ -1878,7 +1905,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
#region 这里时影响其他的任务 /*不包括申请的任务 申请的任务,在上面会统一处理*/
var influenceTaskList = await _visitTaskRepository.Where(filterExpression, true).OrderBy(t=>t.VisitTaskNum).ToListAsync();
var influenceTaskList = await _visitTaskRepository.Where(filterExpression, true).OrderBy(t => t.VisitTaskNum).ToListAsync();
var trakingOrigenalTask = influenceTaskList.Where(t => t.Id == origenalTask.Id).FirstOrDefault();
@ -1916,9 +1943,26 @@ namespace IRaCIS.Core.Application.Service.Allocation
trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
}
//冻结的任务不生成任务 影响的其他标准的附加评估的任务不立即生成 比如1.1基线 重阅
if ( influenceTask.ReadingCategory == ReadingCategory.Visit && beforeTaskState == TaskState.Effect && influenceTask.TrialReadingCriterionId== origenalTask.TrialReadingCriterionId)
// 影响的任务 仅仅访视类别的才生成
if (influenceTask.ReadingCategory == ReadingCategory.Visit)
{
// 影响的其他标准的附加评估的任务不立即生成 比如1.1基线 重阅 PM 同意仅仅生成1.1任务不生成BM任务
if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment && influenceTask.TrialReadingCriterionId != origenalTask.TrialReadingCriterionId)
{
//BM标准的不生成任务
continue;
}
//当前任务是转变任务,并且影响列表里有转变之前的任务 那么该访视任务就不生成
if (criterionConfig.CriterionType == CriterionType.IRECIST1Point1 && influenceTask.BeforeConvertedTaskId != null && influenceTaskList.Any(t => t.Id == influenceTask.BeforeConvertedTaskId))
{
continue;
}
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
{
TrialId = trialId,
@ -1970,6 +2014,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
});
}
}
@ -2418,7 +2465,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (criterion.CriterionType == CriterionType.RECIST1Point1)
{
//影像回退了|| IR 申请及基线重阅
if (_subjectVisitRepository.Any(t => t.Id == task.SourceSubjectVisitId && t.IsBaseLine) )
if (_subjectVisitRepository.Any(t => t.Id == task.SourceSubjectVisitId && t.IsBaseLine))
{
await _subjectCriteriaEvaluationRepository.UpdatePartialFromQueryAsync(t => t.TrialReadingCriterion.IsAutoCreate == false && t.SubjectId == task.SubjectId, u => new SubjectCriteriaEvaluation()
{
@ -2548,7 +2595,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == filterObj.TrialReadingCriterionId).Select(x => new { x.ReadingTool,x.CriterionType,x.IsAdditionalAssessment, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == filterObj.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.CriterionType, x.IsAdditionalAssessment, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
@ -2606,7 +2653,22 @@ namespace IRaCIS.Core.Application.Service.Allocation
// t.ReadingCategory == ReadingCategory.Judge || t.ReadingCategory == ReadingCategory.Oncology)
// );
//申请的是转化的,那么影响列表要排除转化之前的
if (criterionConfig.CriterionType == CriterionType.IRECIST1Point1 && filterObj.BeforeConvertedTaskId != null)
{
filterExpression = filterExpression.And(t => (t.VisitTaskNum > filterObj.VisitTaskNum &&
(
(((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.WaitReading) || t.ReadingCategory == ReadingCategory.Global) && t.DoctorUserId == filterObj.DoctorUserId)
// 裁判 肿瘤学是另外的医生做
|| t.ReadingCategory == ReadingCategory.Judge
|| t.ReadingCategory == ReadingCategory.Oncology
)) || t.Id == filterObj.Id)
;
}
else
{
filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum &&
(
(((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.WaitReading) || t.ReadingCategory == ReadingCategory.Global) && t.DoctorUserId == filterObj.DoctorUserId)
@ -2615,6 +2677,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|| t.ReadingCategory == ReadingCategory.Oncology
)
);
}