修改有序阅片 影响列表

Uat_Study
hang 2022-09-14 13:42:30 +08:00
parent 54d88dab9e
commit 9bbfb7da4d
1 changed files with 65 additions and 54 deletions

View File

@ -1403,9 +1403,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
return ResponseOutput.NotOk("当前为有序阅片,当前访视之后,也申请了重阅 必须从后向前处理"); return ResponseOutput.NotOk("当前为有序阅片,当前访视之后,也申请了重阅 必须从后向前处理");
} }
} }
@ -1676,9 +1673,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
switch (origenalTask.ReadingCategory) switch (origenalTask.ReadingCategory)
{ {
case ReadingCategory.Visit: case ReadingCategory.Visit:
//影响后续访视已经读完的,未读的不做处理 以及其他类型任务 //影响后续访视已经读完的,正在读的,未读的不做处理 以及其他类型任务
filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum && filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum &&
((t.DoctorUserId == origenalTask.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global)) ((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.Judge || t.ReadingCategory == ReadingCategory.Oncology)
); );
@ -1686,9 +1683,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
case ReadingCategory.Global: case ReadingCategory.Global:
//全局不影响后续访视任务
filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum && filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum &&
((t.DoctorUserId == origenalTask.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge))); ((t.DoctorUserId == origenalTask.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.WaitReading) || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge)));
break; break;
case ReadingCategory.Oncology: case ReadingCategory.Oncology:
@ -1729,13 +1725,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
{ {
ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand); ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand);
//influenceTaskList.ForEach(t =>
//{
// //记录实际影像的任务
// influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
//});
await SetMedicalReviewInvalidAsync(influenceTaskList, false); await SetMedicalReviewInvalidAsync(influenceTaskList, false);
@ -1759,14 +1748,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
} }
if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned && influenceTask.ReadingCategory == ReadingCategory.Visit) if (/*influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned &&*/ influenceTask.ReadingCategory == ReadingCategory.Visit)
{ {
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand() await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
{ {
TrialId = trialId, TrialId = trialId,
ReadingCategory = GenerateTaskCategory.ReReading, ReadingCategory = GenerateTaskCategory.ReReading,
ReReadingTask = influenceTask, ReReadingTask = influenceTask,
//同步才可以 //同步才可以
@ -1781,36 +1770,34 @@ namespace IRaCIS.Core.Application.Service.Allocation
newTask.AllocateTime = DateTime.Now; newTask.AllocateTime = DateTime.Now;
newTask.SuggesteFinishedTime = DateTime.Now.AddDays(7); newTask.SuggesteFinishedTime = DateTime.Now.AddDays(7);
//拷贝表单 //拷贝后续表单
if ( (visitTaskReReadingAppply.IsCopyOrigenalForms && origenalTask.VisitTaskNum==influenceTask.VisitTaskNum)|| (visitTaskReReadingAppply.IsCopyFollowForms && origenalTask.VisitTaskNum != influenceTask.VisitTaskNum)) //if (visitTaskReReadingAppply.IsCopyFollowForms && origenalTask.VisitTaskNum != influenceTask.VisitTaskNum)
{ //{
if (origenalTask.ReadingCategory == ReadingCategory.Visit) // if (origenalTask.ReadingCategory == ReadingCategory.Visit)
{ // {
var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList(); // var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
foreach (var item in list) // foreach (var item in list)
{ // {
item.Id = Guid.Empty; // item.Id = Guid.Empty;
item.VisitTaskId = newTask.Id; // item.VisitTaskId = newTask.Id;
} // }
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result; // _ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
} // }
else if (origenalTask.ReadingCategory == ReadingCategory.Global) // else if (origenalTask.ReadingCategory == ReadingCategory.Global)
{ // {
var list = _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == origenalTask.Id).ToList(); // var list = _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == origenalTask.Id).ToList();
foreach (var item in list) // foreach (var item in list)
{ // {
item.Id = Guid.Empty; // item.Id = Guid.Empty;
item.GlobalTaskId = newTask.Id; // item.GlobalTaskId = newTask.Id;
} // }
_ = _repository.AddRangeAsync(list).Result; // _ = _repository.AddRangeAsync(list).Result;
} // }
//}
}
} }
}); });
@ -2385,11 +2372,24 @@ namespace IRaCIS.Core.Application.Service.Allocation
//影响当前医生 以及当前医生之后的 1、访视任务 已经读完的 //影响当前医生 以及当前医生之后的 1、访视任务 已经读完的
//2、后续任务如果是全局、肿瘤学阅片任务状态为阅片完成标记为重阅重置若在阅片中则标记为失效若为待阅片则标记为失效 //2、后续任务如果是全局、肿瘤学阅片任务状态为阅片完成标记为重阅重置若在阅片中则标记为失效若为待阅片则标记为失效
//3、当前任务、后续访视任务或者全局任务触发了裁判任务若裁判任务状态为阅片完成则标记为重阅重置若在阅片中或待阅片则标记为失效 //3、当前任务、后续访视任务或者全局任务触发了裁判任务若裁判任务状态为阅片完成则标记为重阅重置若在阅片中或待阅片则标记为失效
// filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum &&
//((t.DoctorUserId == filterObj.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global))
// ||
// t.ReadingCategory == ReadingCategory.Judge || t.ReadingCategory == ReadingCategory.Oncology)
// );
filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum && filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum &&
((t.DoctorUserId == filterObj.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global)) (
|| (((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.ReadingCategory == ReadingCategory.Judge
|| t.ReadingCategory == ReadingCategory.Oncology
)
); );
break; break;
case ReadingCategory.Global: case ReadingCategory.Global:
@ -2399,9 +2399,17 @@ namespace IRaCIS.Core.Application.Service.Allocation
//3、当前任务或者全局任务触发了裁判任务若裁判任务状态为阅片完成则标记为重阅重置若在阅片中或待阅片则标记为失效 //3、当前任务或者全局任务触发了裁判任务若裁判任务状态为阅片完成则标记为重阅重置若在阅片中或待阅片则标记为失效
//4、后续任务为肿瘤学阅片任务状态为阅片完成标记为重阅重置若在阅片中则标记为失效若为待阅片则标记为失效 //4、后续任务为肿瘤学阅片任务状态为阅片完成标记为重阅重置若在阅片中则标记为失效若为待阅片则标记为失效
//全局不影响后续访视任务 //filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum &&
//((t.DoctorUserId == filterObj.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge)));
filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum && filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum &&
((t.DoctorUserId == filterObj.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge))); (
(t.DoctorUserId == filterObj.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.WaitReading) || t.ReadingCategory == ReadingCategory.Global))
|| (t.ReadingCategory == ReadingCategory.Oncology)
|| (t.ReadingCategory == ReadingCategory.Judge)
));
break; break;
//1、后续任务如果是访视任务、全局任务或裁判任务均不处理 //1、后续任务如果是访视任务、全局任务或裁判任务均不处理
@ -2534,7 +2542,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (isReReading) if (isReReading)
{ {
if ((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId != null) || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null)) if ((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId != null) || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null))
{ {
//有序 //有序
@ -2544,10 +2551,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
{ {
influenceTask.OptType = ReReadingOrBackOptType.Return; influenceTask.OptType = ReReadingOrBackOptType.Return;
} }
else else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading)
{ {
influenceTask.OptType = ReReadingOrBackOptType.Abandon; influenceTask.OptType = ReReadingOrBackOptType.Abandon;
} }
else
{
throw new BusinessValidationFailedException("IR 申请重阅,不会影响到后续未读的任务");
}
} }
else else
{ {