修改影响列表

Uat_Study
hang 2022-07-29 10:25:22 +08:00
parent 0a455dc4c5
commit f96e0168a0
4 changed files with 43 additions and 17 deletions

View File

@ -98,6 +98,8 @@ namespace IRaCIS.Core.Application.ViewModel
public class AnalysisTaskView : ReadingTaskView
{
public bool? IsSelfAnalysis { get; set; }
public bool IsReReadingOrBackInfluenceAnalysis { get; set; }
}
//public class IRReReadingTaskView: ReReadingTaskView

View File

@ -1305,6 +1305,21 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
}
/// <summary>
/// PM 申请重阅 被同意 或者 PM 直接退回的时候影响
/// </summary>
/// <param name="subjectId"></param>
/// <returns></returns>
private async Task SetReReadingOrBackInfluenceAnalysisAsync(Guid subjectId)
{
if (await _repository.AnyAsync<VisitTask>(t => t.IsAnalysisCreate && t.SubjectId == subjectId))
{
await _repository.UpdatePartialFromQueryAsync<Subject>(t => t.Id == subjectId, u => new Subject() { IsReReadingOrBackInfluenceAnalysis = true });
}
}
/// <summary>
/// 确认重阅与否 1同意 2 拒绝
/// </summary>
@ -1359,6 +1374,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == origenalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated;
//是否是一致性分析任务 正常申请 会影响一致性分析任务
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
if (agreeReReadingCommand.RequestReReadingResultEnum == RequestReReadingResult.Agree)
@ -1422,6 +1439,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
// influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
//});
await SetReReadingOrBackInfluenceAnalysisAsync(origenalTask.SubjectId);
await SetMedicalReviewInvalidAsync(influenceTaskList);
@ -1544,6 +1562,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
// influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
//});
await SetReReadingOrBackInfluenceAnalysisAsync(origenalTask.SubjectId);
await SetMedicalReviewInvalidAsync(influenceTaskList);
trakingOrigenalTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Return });
@ -1574,9 +1594,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
else if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.DocotorApply && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
{
//是否是一致性分析任务 正常申请 会影响一致性分析任务
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
//有序阅片
if (trialConfig.IsReadingTaskViewInOrder)
@ -1594,15 +1612,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
((t.DoctorUserId == origenalTask.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global))
||
t.ReadingCategory == ReadingCategory.Judge || t.ReadingCategory == ReadingCategory.Oncology)
)
;
);
break;
case ReadingCategory.Global:
//全局不影响后续访视任务
filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum &&
((t.DoctorUserId == origenalTask.DoctorUserId && t.ReadingCategory == ReadingCategory.Global && t.ReadingTaskState == ReadingTaskState.HaveSigned) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge)));
((t.DoctorUserId == origenalTask.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge)));
break;
case ReadingCategory.Oncology:
@ -1658,6 +1675,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
//处理其他任务
else
{
if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
{
influenceTask.TaskState = TaskState.HaveReturned;
@ -1954,7 +1972,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
var influenceTaskList = await _visitTaskRepository.Where(filterExpression, true).ToListAsync();
await SetMedicalReviewInvalidAsync(influenceTaskList);
#region 方式一
@ -2074,6 +2092,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
// influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
//});
await SetReReadingOrBackInfluenceAnalysisAsync(influenceTask.SubjectId);
await SetMedicalReviewInvalidAsync(influenceTaskList);
influenceTask.IsPMSetBack = true;
}
@ -2262,6 +2284,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated;
//是否是一致性分析任务 (一致性分析的任务 不会产生裁判 肿瘤学 仅仅有生成的访视和全局)
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == filterObj.IsAnalysisCreate);
//重阅影响
if (isReReading)
@ -2274,9 +2299,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|| (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null))
{
//是否是一致性分析任务 (一致性分析的任务 不会产生裁判 肿瘤学 仅仅有生成的访视和全局)
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == filterObj.IsAnalysisCreate);
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务
@ -2294,8 +2316,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
((t.DoctorUserId == filterObj.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global))
||
t.ReadingCategory == ReadingCategory.Judge || t.ReadingCategory == ReadingCategory.Oncology)
)
;
);
break;
case ReadingCategory.Global:
@ -2307,7 +2328,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
//全局不影响后续访视任务
filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum &&
((t.DoctorUserId == filterObj.DoctorUserId && t.ReadingCategory == ReadingCategory.Global && t.ReadingTaskState==ReadingTaskState.HaveSigned) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge)));
((t.DoctorUserId == filterObj.DoctorUserId && ((t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned) || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Oncology) || (t.ReadingCategory == ReadingCategory.Judge)));
break;
//1、后续任务如果是访视任务、全局任务或裁判任务均不处理

View File

@ -118,7 +118,8 @@ namespace IRaCIS.Core.Application.Service
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>();
CreateMap<VisitTask, AnalysisTaskView>().IncludeBase<VisitTask, VisitTaskView>();
CreateMap<VisitTask, AnalysisTaskView>().IncludeBase<VisitTask, VisitTaskView>()
.ForMember(o => o.IsReReadingOrBackInfluenceAnalysis, t => t.MapFrom(u => u.Subject.IsReReadingOrBackInfluenceAnalysis));

View File

@ -91,6 +91,8 @@ namespace IRaCIS.Core.Domain.Models
public Guid? DeleteUserId { get; set; }
public bool IsReReadingOrBackInfluenceAnalysis { get; set; }
//是否分配了读片医生
//public bool IsAssignDoctorUser{get;set;}
}