Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
fe81bb224a
|
@ -585,8 +585,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = subjectVisit.IsUrgent,
|
||||
TaskBlindName = blindTaskName,
|
||||
|
||||
IsUrgent = subjectVisit.IsUrgent,
|
||||
TaskUrgentType = taskUrgentType,
|
||||
IsCanEditUrgentState = isCanEditUrgentState,
|
||||
TaskName = subjectVisit.VisitName,
|
||||
|
@ -611,9 +612,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = subjectVisit.IsUrgent,
|
||||
TaskBlindName = blindTaskName,
|
||||
TaskName = subjectVisit.VisitName,
|
||||
IsUrgent = subjectVisit.IsUrgent,
|
||||
|
||||
TaskUrgentType = taskUrgentType,
|
||||
IsCanEditUrgentState = isCanEditUrgentState,
|
||||
VisitTaskNum = subjectVisit.VisitNum,
|
||||
|
@ -716,6 +718,32 @@ namespace IRaCIS.Core.Application.Service
|
|||
//每个访视去判断 是分配还是生成(因为影响哪里有些是取消分配,有些是重阅重置需要重新生成)
|
||||
foreach (var visitGroup in followVisitGroup)
|
||||
{
|
||||
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == visitGroup.First().SourceSubjectVisitId).Select(x => new
|
||||
{
|
||||
x.PDState,
|
||||
x.IsEnrollmentConfirm,
|
||||
x.IsUrgent,
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
|
||||
TaskUrgentType? urgentType = null;
|
||||
|
||||
if (subjectVisitInfo.PDState == PDStateEnum.PDProgress)
|
||||
{
|
||||
urgentType = TaskUrgentType.PDProgress;
|
||||
}
|
||||
else if (subjectVisitInfo.IsEnrollmentConfirm)
|
||||
{
|
||||
urgentType = TaskUrgentType.EnrollmentConfirm;
|
||||
}
|
||||
else if (subjectVisitInfo.IsUrgent)
|
||||
{
|
||||
urgentType = TaskUrgentType.VisitUrgent;
|
||||
}
|
||||
|
||||
bool isCanEdit = urgentType == TaskUrgentType.EnrollmentConfirm || urgentType == TaskUrgentType.PDProgress ? false : true;
|
||||
|
||||
//如果后续访视已分配有效 就不用处理
|
||||
if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm1))
|
||||
{
|
||||
|
@ -731,6 +759,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
//有可能仅仅只分配了一个Subject 未分配 那么
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||
{
|
||||
arm1.IsUrgent = visit.IsUrgent;
|
||||
arm1.TaskUrgentType = urgentType;
|
||||
arm1.IsCanEditUrgentState = isCanEdit;
|
||||
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
arm1.AllocateTime = DateTime.Now;
|
||||
arm1.DoctorUserId = task1.DoctorUserId;
|
||||
|
@ -742,11 +773,16 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
|
||||
|
||||
|
||||
|
||||
|
||||
var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = subjectVisit.IsUrgent,
|
||||
IsUrgent = visit.IsUrgent,
|
||||
TaskUrgentType = urgentType,
|
||||
IsCanEditUrgentState = isCanEdit,
|
||||
ArmEnum = Arm.DoubleReadingArm1,//特殊
|
||||
Code = currentMaxCodeInt + 1,
|
||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||
|
@ -790,6 +826,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
//有可能仅仅只分配了一个Subject
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
arm2.IsUrgent = visit.IsUrgent;
|
||||
arm2.TaskUrgentType = urgentType;
|
||||
arm2.IsCanEditUrgentState = isCanEdit;
|
||||
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
arm2.AllocateTime = DateTime.Now;
|
||||
arm2.DoctorUserId = task2.DoctorUserId;
|
||||
|
@ -805,7 +844,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
TrialId = trialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
IsUrgent = subjectVisit.IsUrgent,
|
||||
IsUrgent = visit.IsUrgent,
|
||||
TaskUrgentType = urgentType,
|
||||
IsCanEditUrgentState = isCanEdit,
|
||||
|
||||
//CheckPassedTime = subjectVisit.CheckPassedTime,
|
||||
ArmEnum = Arm.DoubleReadingArm2,//特殊
|
||||
|
@ -823,6 +864,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||
TaskAllocationState = TaskAllocationState.Allocated,
|
||||
|
||||
AllocateTime = DateTime.Now,
|
||||
DoctorUserId = task2.DoctorUserId,
|
||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
||||
|
|
|
@ -1967,6 +1967,11 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
}
|
||||
|
||||
|
||||
if( await _subjectVisitRepository.AnyAsync(t=>t.Id==task.SourceSubjectVisitId && t.CheckState!= CheckStateEnum.CVPassed))
|
||||
{
|
||||
return ResponseOutput.NotOk("当前访视已回退到影像上传,不允许继续回退!");
|
||||
}
|
||||
|
||||
|
||||
if (task.IsAnalysisCreate)
|
||||
{
|
||||
|
@ -2105,7 +2110,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
#region 方式二
|
||||
|
||||
var origenalTask = influenceTaskList.Where(t => t.Id == task.Id).First();
|
||||
var origenalTask = influenceTaskList.Where(t => t.Id == task.Id).FirstOrDefault();
|
||||
|
||||
foreach (var influenceTask in influenceTaskList)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue