修改参数名字
parent
9a5ed8d4dc
commit
2741678aeb
|
@ -22,7 +22,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public ReadingCategory ReadingCategory { get; set; }
|
||||
|
||||
public TaskState TaskState { get; set; }
|
||||
public TaskAllocationState TaskAllocationState { get; set; }
|
||||
|
||||
public bool IsJudgeTaskReturn { get; set; }
|
||||
|
||||
|
@ -188,7 +188,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public ReadingCategory? ReadingCategory { get; set; }
|
||||
|
||||
public TaskState? TaskState { get; set; }
|
||||
public TaskAllocationState? TaskAllocationState { get; set; }
|
||||
|
||||
public ReadingTaskState? ReadingTaskState { get; set; }
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
case ReadingCategory.Visit:
|
||||
foreach (var subjectVisit in generateTaskCommand.VisitGenerataTaskList)
|
||||
{
|
||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.OrignalSubjectUserId== null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||
|
||||
|
||||
if (trialConfig.ReadingType == ReadingMethod.Double)
|
||||
|
@ -163,11 +163,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
//配置了医生
|
||||
if (assignConfigList.Count > 0)
|
||||
{
|
||||
var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskState.InitAllocated : TaskState.Allocated;
|
||||
var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||
|
||||
|
||||
task1.TaskState = defaultState;
|
||||
task2.TaskState = defaultState;
|
||||
task1.TaskAllocationState = defaultState;
|
||||
task2.TaskAllocationState = defaultState;
|
||||
|
||||
//分配给对应Arm的人
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
|
||||
|
@ -251,9 +251,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
//配置了医生
|
||||
if (assignConfigList.Count > 0)
|
||||
{
|
||||
var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskState.InitAllocated : TaskState.Allocated;
|
||||
var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||
|
||||
singleTask.TaskState = defaultState;
|
||||
singleTask.TaskAllocationState = defaultState;
|
||||
|
||||
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == 0).DoctorUserId;
|
||||
|
||||
|
@ -294,6 +294,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
OriginalReReadingId = reReadingVisitTask.Id,
|
||||
|
||||
TrialId = reReadingVisitTask.TrialId,
|
||||
SubjectId = reReadingVisitTask.SubjectId,
|
||||
ArmEnum= reReadingVisitTask.ArmEnum,
|
||||
TaskName= reReadingVisitTask.TaskName,
|
||||
TaskBlindName = reReadingVisitTask.TaskBlindName,
|
||||
TaskAllocationState= reReadingVisitTask.TaskAllocationState,
|
||||
ReadingCategory = reReadingVisitTask.ReadingCategory,
|
||||
Code = currentMaxCodeInt + 1,
|
||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||
AllocateTime=DateTime.Now,
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
|
@ -138,7 +138,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
|
@ -175,7 +175,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
|
@ -210,7 +210,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
|
@ -323,7 +323,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
|
@ -358,7 +358,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
|
@ -430,12 +430,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
var armEnum = assginSubjectDoctorCommand.DoctorUserIdArmList.Where(t => t.DoctorUserId == doctorUserId).First().ArmEnum;
|
||||
|
||||
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum))
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum && t.OrignalSubjectUserId==null))
|
||||
{
|
||||
throw new BusinessValidationFailedException("有Subject 在其他Arm组已有该医生,不允许在新的组添加该医生");
|
||||
}
|
||||
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum))
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum && t.OrignalSubjectUserId == null))
|
||||
{
|
||||
throw new BusinessValidationFailedException("有Subject 已有该Arm组的医生,不允许继续分配,请刷新页面,确认页面数据是否过期");
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
if (assignConfirmCommand.SubjectDoctorUserList.Count == 0)
|
||||
{
|
||||
|
||||
subjectDoctorIdArmList = _subjectUserRepository.Where(t => t.SubjectId == subjectId).Select(t => new DoctorArm() { DoctorUserId = t.DoctorUserId, ArmEnum = t.ArmEnum }).ToList();
|
||||
subjectDoctorIdArmList = _subjectUserRepository.Where(t => t.SubjectId == subjectId && t.OrignalSubjectUserId == null).Select(t => new DoctorArm() { DoctorUserId = t.DoctorUserId, ArmEnum = t.ArmEnum }).ToList();
|
||||
|
||||
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
task.DoctorUserId = subjectDoctorArm.DoctorUserId;
|
||||
task.AllocateTime = DateTime.Now;
|
||||
task.TaskState = TaskState.Allocated;
|
||||
task.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
|
||||
task.SuggesteFinishedTime = task.IsUrgent ? DateTime.Now.AddDays(2) : DateTime.Now.AddDays(7);
|
||||
|
||||
|
@ -615,8 +615,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
.Select(t => new
|
||||
{
|
||||
SubjectId = t.Id,
|
||||
DoctorUserList = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Select(t => new { t.DoctorUserId, t.ArmEnum }),
|
||||
IsApplyed = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).SelectMany(t => t.SubjectArmVisitTaskList).Any(c => c.DoctorUserId != null)
|
||||
|
||||
//给Subject分配医生的时候, 未确认绑定关系的
|
||||
DoctorUserList = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t=> t.OrignalSubjectUserId==null).Select(t => new { t.DoctorUserId, t.ArmEnum }),
|
||||
IsApplyed = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t => t.OrignalSubjectUserId == null).SelectMany(t => t.SubjectArmVisitTaskList).Any(c => c.DoctorUserId != null)
|
||||
}).ToList();
|
||||
|
||||
//已产生任务的Subject数量(裁判情况下,就是产生裁判任务Subject 的数量)
|
||||
|
@ -836,7 +838,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
visitTask.AllocateTime = DateTime.Now;
|
||||
visitTask.DoctorUserId = assignSubjectTaskToDoctorCommand.DoctorUserId;
|
||||
visitTask.TaskState = TaskState.Allocated;
|
||||
visitTask.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == visitTask.SourceSubjectVisitId, u => new SubjectVisit() { ReadingStatus = ReadingStatusEnum.ImageReading });
|
||||
|
||||
|
@ -858,13 +860,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
else if (assignSubjectTaskToDoctorCommand.TaskOptType == TaskOptType.Confirm)
|
||||
{
|
||||
visitTask.TaskState = TaskState.Allocated;
|
||||
visitTask.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
}
|
||||
else if (assignSubjectTaskToDoctorCommand.TaskOptType == TaskOptType.CancelAssign)
|
||||
{
|
||||
visitTask.AllocateTime = null;
|
||||
visitTask.DoctorUserId = null;
|
||||
visitTask.TaskState = TaskState.NotAllocate;
|
||||
visitTask.TaskAllocationState = TaskAllocationState.NotAllocate;
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == visitTask.SourceSubjectVisitId, u => new SubjectVisit() { ReadingStatus = ReadingStatusEnum.TaskAllocate });
|
||||
|
||||
|
@ -891,9 +893,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
foreach (var task in taskList)
|
||||
{
|
||||
if(await _visitTaskRepository.AnyAsync(t=>t.OriginalReReadingId==task.Id))
|
||||
{
|
||||
throw new BusinessValidationFailedException("已产生重阅任务,不允许再次申请");
|
||||
}
|
||||
|
||||
|
||||
task.IsReReading = true;
|
||||
task.RequestReReadingReason = applyReReadingCommand.RequestReReadingReason;
|
||||
task.RequestReReadingType = applyReReadingCommand.RequestReReadingTypeEnum;
|
||||
task.RequestReReadingTime = DateTime.Now;
|
||||
|
@ -904,14 +909,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
if (task.ReadingTaskState == ReadingTaskState.WaitReading || task.ReadingTaskState == ReadingTaskState.Reading)
|
||||
{
|
||||
task.JudgeVisitTask.ReadingTaskState = ReadingTaskState.HaveCanceled;
|
||||
task.JudgeVisitTask.TaskState = TaskState.HaveCanceled;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
task.JudgeVisitTask.ReadingTaskState = ReadingTaskState.HaveReturned;
|
||||
task.JudgeVisitTask.TaskState = TaskState.HaveReturned;
|
||||
|
||||
//task.JudgeVisitTask.IsJudgeTaskReturn = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -953,6 +957,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => agreeReReadingCommand.TaskIdList.Contains(t.Id), u => new VisitTask()
|
||||
{
|
||||
IsReReading = true,
|
||||
RequestReReadingResultEnum = agreeReReadingCommand.RequestReReadingResultEnum,
|
||||
RequestReReadingConfirmUserId = _userInfo.Id
|
||||
}, true);
|
||||
|
|
|
@ -108,13 +108,13 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
|
||||
// if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.Allocated)
|
||||
// {
|
||||
// task1.TaskState = TaskState.Allocated;
|
||||
// task2.TaskState = TaskState.Allocated;
|
||||
// task1.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
// task2.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
// }
|
||||
// else if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.InitAllocated)
|
||||
// {
|
||||
// task1.TaskState = TaskState.InitAllocated;
|
||||
// task2.TaskState = TaskState.InitAllocated;
|
||||
// task1.TaskAllocationState = TaskAllocationState.InitAllocated;
|
||||
// task2.TaskAllocationState = TaskAllocationState.InitAllocated;
|
||||
// }
|
||||
|
||||
// if (trialConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
|
||||
|
@ -199,11 +199,11 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
|
||||
// if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.Allocated)
|
||||
// {
|
||||
// singleTask.TaskState = TaskState.Allocated;
|
||||
// singleTask.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
// }
|
||||
// else if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.InitAllocated)
|
||||
// {
|
||||
// singleTask.TaskState = TaskState.InitAllocated;
|
||||
// singleTask.TaskAllocationState = TaskAllocationState.InitAllocated;
|
||||
// }
|
||||
|
||||
// if (trialConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
ReReading = 6,
|
||||
}
|
||||
|
||||
public enum TaskState
|
||||
public enum TaskAllocationState
|
||||
{
|
||||
//未分配
|
||||
NotAllocate = 0,
|
||||
|
@ -93,6 +93,14 @@ namespace IRaCIS.Core.Domain.Share
|
|||
|
||||
}
|
||||
|
||||
public enum TaskState
|
||||
{
|
||||
// 裁判任务,没做,或者做了没签名 已取消
|
||||
HaveCanceled = 3,
|
||||
|
||||
HaveReturned = 4
|
||||
}
|
||||
|
||||
//阅片状态
|
||||
public enum ReadingTaskState
|
||||
{
|
||||
|
@ -102,10 +110,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
|
||||
HaveSigned = 2,
|
||||
|
||||
// 裁判任务,没做,或者做了没签名 已取消
|
||||
HaveCanceled = 3,
|
||||
|
||||
HaveReturned = 4
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -121,9 +121,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
|
||||
//分配状态
|
||||
public TaskState TaskState { get; set; }
|
||||
public TaskAllocationState TaskAllocationState { get; set; }
|
||||
|
||||
|
||||
public TaskState TaskState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DoctorUserId
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue