This commit is contained in:
2022-07-14 09:41:23 +08:00
parent 8307e06841
commit 8b30a64bcf
2 changed files with 48 additions and 96 deletions
@@ -191,31 +191,6 @@ namespace IRaCIS.Core.Application.Service
}
#region /退访
var arm1DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
var arm2DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.DoctorUserId == null
&& t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.ArmEnum == Arm.DoubleReadingArm1, u => new VisitTask()
{
TaskAllocationState=TaskAllocationState.Allocated,
DoctorUserId= arm1DoctorUserId,
AllocateTime=DateTime.Now,
});
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.DoctorUserId == null && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.ArmEnum == Arm.DoubleReadingArm2, u => new VisitTask()
{
TaskAllocationState = TaskAllocationState.Allocated,
DoctorUserId = arm2DoctorUserId,
AllocateTime = DateTime.Now,
});
#endregion
}
else
// 当前任务没有分配医生,初次分配
@@ -227,10 +202,37 @@ namespace IRaCIS.Core.Application.Service
}
#endregion
if (assignConfigList.Count>0)
{
#region /退访
var arm1DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
var arm2DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.DoctorUserId == null
&& t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.ArmEnum == Arm.DoubleReadingArm1, u => new VisitTask()
{
TaskAllocationState = TaskAllocationState.Allocated,
DoctorUserId = arm1DoctorUserId,
AllocateTime = DateTime.Now,
});
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.DoctorUserId == null && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.ArmEnum == Arm.DoubleReadingArm2, u => new VisitTask()
{
TaskAllocationState = TaskAllocationState.Allocated,
DoctorUserId = arm2DoctorUserId,
AllocateTime = DateTime.Now,
});
#endregion
}
}
else if (trialConfig.ReadingType == ReadingMethod.Single)
{
@@ -357,9 +359,9 @@ namespace IRaCIS.Core.Application.Service
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
IsAnalysisCreate = reReadingVisitTask.IsAnalysisCreate,
IsSelfAnalysis =reReadingVisitTask.IsSelfAnalysis,
BlindSubjectCode=reReadingVisitTask.BlindSubjectCode,
BlindTrialSiteCode=reReadingVisitTask.BlindTrialSiteCode
IsSelfAnalysis = reReadingVisitTask.IsSelfAnalysis,
BlindSubjectCode = reReadingVisitTask.BlindSubjectCode,
BlindTrialSiteCode = reReadingVisitTask.BlindTrialSiteCode
// TaskAllocationState = reReadingVisitTask.TaskAllocationState,
// AllocateTime = DateTime.Now,