修改裁判任务分配
parent
522d7eca07
commit
243cbec782
|
@ -3344,7 +3344,14 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.ConfigTrialReadingTaskViewRule(IRaCIS.Core.Application.Contracts.TrialReadingTaskViewConfig)">
|
<member name="M:IRaCIS.Core.Application.TrialConfigService.ConfigTrialReadingTaskViewRule(IRaCIS.Core.Application.Contracts.TrialReadingTaskViewConfig)">
|
||||||
<summary>
|
<summary>
|
||||||
配置项目赌片规则信息
|
配置项目读片查看规则
|
||||||
|
</summary>
|
||||||
|
<param name="trialConfig"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.TrialConfigService.ConfigJudgeTaskAllocateRule(IRaCIS.Core.Application.Contracts.TrialJudgeTaskConfig)">
|
||||||
|
<summary>
|
||||||
|
配置项目 裁判任务 分配规则
|
||||||
</summary>
|
</summary>
|
||||||
<param name="trialConfig"></param>
|
<param name="trialConfig"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
|
|
|
@ -39,37 +39,42 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
//该医生未应用Subject 数量 不是两者相减 跟批量勾选有关系
|
//该医生未应用Subject 数量 不是两者相减 跟批量勾选有关系
|
||||||
public int? WaitApplySelfSubjectCount { get; set; }
|
public int? WaitApplySelfSubjectCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//该医生未应用的任务数
|
//该医生未应用的任务数
|
||||||
public int? WaitApplySelfTaskCount { get; set; }
|
public int? WaitApplySelfTaskCount { get; set; }
|
||||||
|
|
||||||
|
//该医生已应用的任务数
|
||||||
|
public int? SelfApplyedTaskCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//总共未应用的Subejct 数量
|
//总共未应用的Subejct 数量
|
||||||
public int? WaitApplyTotalSubjectCount { get; set; }
|
public int? WaitApplyTotalSubjectCount { get; set; }
|
||||||
|
|
||||||
public int? WaitApplyTotalTaskCount { get; set; }
|
public int? WaitApplyTotalTaskCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
//该医生已应用的任务数
|
|
||||||
public int? SelfApplyedTaskCount { get; set; }
|
|
||||||
|
|
||||||
//已分配但是未读片签名的数量
|
//已分配该医生但是未读片签名的数量
|
||||||
public int? SelfUndoTaskCount { get; set; }
|
public int? SelfUndoTaskCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//总共已应用 的Subject 数
|
//总共已应用 的Subject 数
|
||||||
public int? ApplyedTotalSubjectCount { get; set; }
|
public int? ApplyedTotalSubjectCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
//总共 已经应用的任务总数
|
||||||
|
public int? ApplyedTotalTaskCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
//系统 Subject数
|
//系统 Subject数
|
||||||
public int? TotalSubjectCount { get; set; }
|
public int? TotalSubjectCount { get; set; }
|
||||||
|
|
||||||
//总任务数
|
//总任务数
|
||||||
public int? TotalTaskCount { get; set; }
|
public int? TotalTaskCount { get; set; }
|
||||||
|
|
||||||
//总共 已经应用的任务总数
|
|
||||||
public int? ApplyedTotalTaskCount { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,6 +111,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
{
|
{
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public bool? IsJudgeDoctor { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
///<summary> TaskAllocationRuleAddOrEdit 列表查询参数模型</summary>
|
///<summary> TaskAllocationRuleAddOrEdit 列表查询参数模型</summary>
|
||||||
|
@ -116,6 +123,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public int PlanReadingRatio { get; set; }
|
public int PlanReadingRatio { get; set; }
|
||||||
public Guid DoctorUserId { get; set; }
|
public Guid DoctorUserId { get; set; }
|
||||||
public bool IsEnable { get; set; }
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
|
public bool IsJudgeDoctor { get; set; }
|
||||||
public string Note { get; set; } = string.Empty;
|
public string Note { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public string TaskCode { get; set; }
|
public string TaskCode { get; set; }
|
||||||
public bool IsUrgent { get; set; }
|
public bool IsUrgent { get; set; }
|
||||||
public int ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
public Guid? DoctorUserId { get; set; }
|
public Guid? DoctorUserId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public DateTime? AssignTime { get; set; }
|
public DateTime? AssignTime { get; set; }
|
||||||
|
|
||||||
public int ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
|
|
||||||
public bool IsAssignDoctorApplyedTask { get; set; }
|
public bool IsAssignDoctorApplyedTask { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
{
|
{
|
||||||
public Guid DoctorUserId { get; set; }
|
public Guid DoctorUserId { get; set; }
|
||||||
|
|
||||||
public int ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CancelSubjectAssignCommand
|
public class CancelSubjectAssignCommand
|
||||||
|
@ -304,7 +304,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
{
|
{
|
||||||
public Guid SubjectId { get; set; }
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
public int ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,6 +312,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public bool? IsJudgeDoctor { get; set; }
|
||||||
|
|
||||||
public List<Guid> SubjectIdList { get; set; } = new List<Guid>();
|
public List<Guid> SubjectIdList { get; set; } = new List<Guid>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Interfaces
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule);
|
Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule);
|
||||||
|
|
||||||
Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId);
|
Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId, bool isJudgeDoctor);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,10 +37,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<(List<TaskAllocationRuleView>,object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
|
public async Task<(List<TaskAllocationRuleView>,object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
|
||||||
{
|
{
|
||||||
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t=>t.TrialId== queryTaskAllocationRule.TrialId)
|
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t=>t.TrialId== queryTaskAllocationRule.TrialId)
|
||||||
|
.WhereIf(queryTaskAllocationRule.IsJudgeDoctor!=null ,t=>t.IsJudgeDoctor== queryTaskAllocationRule.IsJudgeDoctor)
|
||||||
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider);
|
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
|
||||||
var trialTaskConfig= _trialRepository.Where(t=>t.Id==queryTaskAllocationRule.TrialId).ProjectTo<TrialTaskConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
var trialTaskConfig= _trialRepository.Where(t=>t.Id==queryTaskAllocationRule.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||||
|
|
||||||
return (await taskAllocationRuleQueryable.ToListAsync(), trialTaskConfig);
|
return (await taskAllocationRuleQueryable.ToListAsync(), trialTaskConfig);
|
||||||
}
|
}
|
||||||
|
@ -54,6 +55,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<List<TaskAllocationRuleView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
|
public async Task<List<TaskAllocationRuleView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
|
||||||
{
|
{
|
||||||
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId)
|
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId)
|
||||||
|
.WhereIf(assignConfirmCommand.IsJudgeDoctor != null, t => t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor)
|
||||||
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList });
|
.ProjectTo<TaskAllocationRuleView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList });
|
||||||
|
|
||||||
return await taskAllocationRuleQueryable.ToListAsync();
|
return await taskAllocationRuleQueryable.ToListAsync();
|
||||||
|
@ -76,9 +78,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpDelete("{taskAllocationRuleId:guid}")]
|
[HttpDelete("{taskAllocationRuleId:guid}/{isJudgeDoctor:bool}")]
|
||||||
public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId)
|
public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId, bool isJudgeDoctor )
|
||||||
{
|
{
|
||||||
|
if(await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId && t.IsJudgeDoctor== isJudgeDoctor).AnyAsync(t => t.DoctorVisitTaskList.Count() > 0))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk("已分配任务给该医生,不允许删除");
|
||||||
|
}
|
||||||
|
|
||||||
var success = await _taskAllocationRuleRepository.DeleteFromQueryAsync(t => t.Id == taskAllocationRuleId, true);
|
var success = await _taskAllocationRuleRepository.DeleteFromQueryAsync(t => t.Id == taskAllocationRuleId, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TaskBlindName = subjectVisit.BlindName,
|
TaskBlindName = subjectVisit.BlindName,
|
||||||
TaskName = subjectVisit.VisitName,
|
TaskName = subjectVisit.VisitName,
|
||||||
CheckPassedTime = subjectVisit.CheckPassedTime,
|
CheckPassedTime = subjectVisit.CheckPassedTime,
|
||||||
ArmEnum = 1,//特殊
|
ArmEnum = Arm.DoubleReadingArm1,//特殊
|
||||||
Code = currentMaxCodeInt + 1,
|
Code = currentMaxCodeInt + 1,
|
||||||
SourceSubjectVisitId=subjectVisit.Id,
|
SourceSubjectVisitId=subjectVisit.Id,
|
||||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||||
|
@ -93,7 +93,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TaskBlindName = subjectVisit.BlindName,
|
TaskBlindName = subjectVisit.BlindName,
|
||||||
TaskName = subjectVisit.VisitName,
|
TaskName = subjectVisit.VisitName,
|
||||||
CheckPassedTime = subjectVisit.CheckPassedTime,
|
CheckPassedTime = subjectVisit.CheckPassedTime,
|
||||||
ArmEnum = 2,//特殊
|
ArmEnum = Arm.DoubleReadingArm2,//特殊
|
||||||
Code = currentMaxCodeInt + 2,
|
Code = currentMaxCodeInt + 2,
|
||||||
SourceSubjectVisitId = subjectVisit.Id,
|
SourceSubjectVisitId = subjectVisit.Id,
|
||||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 2, nameof(VisitTask)),
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 2, nameof(VisitTask)),
|
||||||
|
@ -117,10 +117,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
if (trialConfig.IsFollowVisitAutoAssign)
|
if (trialConfig.IsFollowVisitAutoAssign)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 验证历史任务
|
#region 验证历史任务
|
||||||
|
|
||||||
var allocateSubjectArmList = _visitTaskRepository.Where(t => t.SubjectId == subjectVisit.SubjectId && t.TrialId == subjectVisit.TrialId && t.DoctorUserId != null).Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList();
|
var allocateSubjectArmList = _visitTaskRepository.Where(t => t.SubjectId == subjectVisit.SubjectId && t.TrialId == subjectVisit.TrialId && t.DoctorUserId != null).Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList();
|
||||||
|
@ -140,7 +136,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
//手动分配的时候 如果只分配了Arm1 没有分配Arm2 就会有问题
|
//手动分配的时候 如果只分配了Arm1 没有分配Arm2 就会有问题
|
||||||
if (!(allocateSubjectArmList.Any(t => t.ArmEnum == 1) && allocateSubjectArmList.Any(t => t.ArmEnum == 2)))
|
if (!(allocateSubjectArmList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && allocateSubjectArmList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2)))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("请确认是否改了配置,或者手动分配时,只分配了一个Arm ");
|
throw new BusinessValidationFailedException("请确认是否改了配置,或者手动分配时,只分配了一个Arm ");
|
||||||
}
|
}
|
||||||
|
@ -155,8 +151,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
task2.TaskState = defaultState;
|
task2.TaskState = defaultState;
|
||||||
|
|
||||||
//分配给对应Arm的人
|
//分配给对应Arm的人
|
||||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == 1).DoctorUserId;
|
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
|
||||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == 2).DoctorUserId;
|
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -210,7 +206,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TaskBlindName = subjectVisit.BlindName,
|
TaskBlindName = subjectVisit.BlindName,
|
||||||
TaskName = subjectVisit.VisitName,
|
TaskName = subjectVisit.VisitName,
|
||||||
CheckPassedTime = subjectVisit.CheckPassedTime,
|
CheckPassedTime = subjectVisit.CheckPassedTime,
|
||||||
ArmEnum = 0, //特殊
|
ArmEnum = Arm.DoubleReadingArm1, //特殊
|
||||||
Code = currentMaxCodeInt + 1,
|
Code = currentMaxCodeInt + 1,
|
||||||
SourceSubjectVisitId = subjectVisit.Id,
|
SourceSubjectVisitId = subjectVisit.Id,
|
||||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||||
|
|
||||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialTaskConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||||
return (pageList, trialTaskConfig);
|
return (pageList, trialTaskConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -791,35 +791,35 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.OrderByDescending(t => t.SubjectCount).FirstOrDefault()?.ArmEnum;
|
.OrderByDescending(t => t.SubjectCount).FirstOrDefault()?.ArmEnum;
|
||||||
|
|
||||||
//存放医生分配的Arm
|
//存放医生分配的Arm
|
||||||
var doctor1Arm = 1;
|
var doctor1Arm = Arm.DoubleReadingArm1;
|
||||||
var doctor2Arm = 2;
|
var doctor2Arm = Arm.DoubleReadingArm2;
|
||||||
|
|
||||||
if ((preferredDoctor1Arm == null && preferredDoctor2Arm == null) ||
|
if ((preferredDoctor1Arm == null && preferredDoctor2Arm == null) ||
|
||||||
(preferredDoctor1Arm == null && preferredDoctor2Arm == 2) ||
|
(preferredDoctor1Arm == null && preferredDoctor2Arm == Arm.DoubleReadingArm2) ||
|
||||||
(preferredDoctor1Arm == 1 && preferredDoctor2Arm == null) ||
|
(preferredDoctor1Arm == Arm.DoubleReadingArm1 && preferredDoctor2Arm == null) ||
|
||||||
(preferredDoctor1Arm == 1 && preferredDoctor2Arm == 2)
|
(preferredDoctor1Arm == Arm.DoubleReadingArm1 && preferredDoctor2Arm == Arm.DoubleReadingArm2)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
doctor1Arm = 1;
|
doctor1Arm = Arm.DoubleReadingArm1;
|
||||||
doctor2Arm = 2;
|
doctor2Arm = Arm.DoubleReadingArm2;
|
||||||
}
|
}
|
||||||
else if ((preferredDoctor1Arm == null && preferredDoctor2Arm == 1) ||
|
else if ((preferredDoctor1Arm == null && preferredDoctor2Arm == Arm.DoubleReadingArm1) ||
|
||||||
(preferredDoctor1Arm == 2 && preferredDoctor2Arm == 1) ||
|
(preferredDoctor1Arm == Arm.DoubleReadingArm2 && preferredDoctor2Arm == Arm.DoubleReadingArm1) ||
|
||||||
(preferredDoctor1Arm == 2 && preferredDoctor2Arm == null))
|
(preferredDoctor1Arm == Arm.DoubleReadingArm2 && preferredDoctor2Arm == null))
|
||||||
{
|
{
|
||||||
doctor1Arm = 2;
|
doctor1Arm = Arm.DoubleReadingArm2;
|
||||||
doctor2Arm = 1;
|
doctor2Arm = Arm.DoubleReadingArm1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (preferredDoctor1Arm == 1 && preferredDoctor2Arm == 1)
|
else if (preferredDoctor1Arm == Arm.DoubleReadingArm1 && preferredDoctor2Arm == Arm.DoubleReadingArm1)
|
||||||
{
|
{
|
||||||
doctor1Arm = 1;
|
doctor1Arm = Arm.DoubleReadingArm1;
|
||||||
doctor2Arm = 2;
|
doctor2Arm = Arm.DoubleReadingArm2;
|
||||||
}
|
}
|
||||||
else if (preferredDoctor1Arm == 2 && preferredDoctor2Arm == 2)
|
else if (preferredDoctor1Arm == Arm.DoubleReadingArm2 && preferredDoctor2Arm == Arm.DoubleReadingArm2)
|
||||||
{
|
{
|
||||||
doctor1Arm = 2;
|
doctor1Arm = Arm.DoubleReadingArm2;
|
||||||
doctor2Arm = 1;
|
doctor2Arm = Arm.DoubleReadingArm1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -861,10 +861,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctor.DoctorUserId).SubjectArmList.Add(new SubjectArm()
|
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctor.DoctorUserId).SubjectArmList.Add(new SubjectArm()
|
||||||
{
|
{
|
||||||
SubjectId = subject.SubjectId,
|
SubjectId = subject.SubjectId,
|
||||||
ArmEnum = 0
|
ArmEnum = Arm.SingleReadingArm
|
||||||
});
|
});
|
||||||
|
|
||||||
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctor.DoctorUserId, ArmEnum = 0, AssignTime = DateTime.Now });
|
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctor.DoctorUserId, ArmEnum = Arm.SingleReadingArm, AssignTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,10 +144,19 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public TaskAllocateDefaultState FollowGlobalVisitAutoAssignDefaultState { get; set; }
|
public TaskAllocateDefaultState FollowGlobalVisitAutoAssignDefaultState { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialTaskConfigView : TrialTaskConfig
|
||||||
|
{
|
||||||
public ReadingTaskViewMethod ReadingTaskViewEnum { get; set; }
|
public ReadingTaskViewMethod ReadingTaskViewEnum { get; set; }
|
||||||
|
|
||||||
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
||||||
|
|
||||||
|
public bool IsFollowJudgeTaskAutoAssign { get; set; }
|
||||||
|
|
||||||
|
public TaskAllocateDefaultState FollowJudgeTaskAutoAssignDefaultState { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialReadingTaskViewConfig
|
public class TrialReadingTaskViewConfig
|
||||||
|
@ -159,6 +168,16 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TrialJudgeTaskConfig
|
||||||
|
{
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public bool IsFollowJudgeTaskAutoAssign { get; set; }
|
||||||
|
|
||||||
|
public TaskAllocateDefaultState FollowJudgeTaskAutoAssignDefaultState { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class TrialUrgentConfig
|
public class TrialUrgentConfig
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
@ -223,7 +242,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public string SignCode { get; set; } = string.Empty;
|
public string SignCode { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialConfigDTO: BasicTrialConfig
|
public class TrialConfigDTO : BasicTrialConfig
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -406,7 +406,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
_mapper.Map(trialConfig, trialInfo);
|
_mapper.Map(trialConfig, trialInfo);
|
||||||
|
|
||||||
if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialConfig.TrialId && t.IsEnable).Sum(t => t.PlanReadingRatio) != 100)
|
if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialConfig.TrialId && t.IsEnable && t.IsJudgeDoctor==false).Sum(t => t.PlanReadingRatio) != 100)
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("已启用医生比率不为百分之100");
|
return ResponseOutput.NotOk("已启用医生比率不为百分之100");
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 配置项目赌片规则信息
|
/// 配置项目读片查看规则
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trialConfig"></param>
|
/// <param name="trialConfig"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
@ -430,6 +430,28 @@ namespace IRaCIS.Core.Application
|
||||||
return ResponseOutput.Ok(await _trialRepository.SaveChangesAsync());
|
return ResponseOutput.Ok(await _trialRepository.SaveChangesAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 配置项目 裁判任务 分配规则
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="trialConfig"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPut]
|
||||||
|
public async Task<IResponseOutput> ConfigJudgeTaskAllocateRule(TrialJudgeTaskConfig trialConfig)
|
||||||
|
{
|
||||||
|
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
||||||
|
|
||||||
|
_mapper.Map(trialConfig, trialInfo);
|
||||||
|
|
||||||
|
if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialConfig.TrialId && t.IsEnable && t.IsJudgeDoctor ).Sum(t => t.PlanReadingRatio) != 100)
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk("已启用医生比率不为百分之100");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(await _trialRepository.SaveChangesAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,11 +18,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<TrialTaskConfigView, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId)).ReverseMap();
|
||||||
CreateMap<TrialTaskConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId)).ReverseMap();
|
CreateMap<TrialTaskConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId)).ReverseMap();
|
||||||
|
|
||||||
CreateMap<TrialReadingTaskViewConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId)).ReverseMap();
|
CreateMap<TrialReadingTaskViewConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId)).ReverseMap();
|
||||||
|
|
||||||
|
CreateMap<TrialJudgeTaskConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<UserTrialCommand, TrialUser>();
|
CreateMap<UserTrialCommand, TrialUser>();
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,17 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
Allocated = 2,
|
Allocated = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum Arm
|
||||||
|
{
|
||||||
|
SingleReadingArm=0,
|
||||||
|
|
||||||
|
DoubleReadingArm1 = 1,
|
||||||
|
|
||||||
|
DoubleReadingArm2 = 2,
|
||||||
|
|
||||||
|
JudgeArm=3
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分配对象
|
/// 分配对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public User DoctorUser { get; set; }
|
public User DoctorUser { get; set; }
|
||||||
|
|
||||||
public int ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public List<VisitTask> SubjectArmVisitTaskList { get; set; }
|
public List<VisitTask> SubjectArmVisitTaskList { get; set; }
|
||||||
|
|
|
@ -71,6 +71,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public string Note { get; set; } = string.Empty;
|
public string Note { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
//是否是裁判医生 裁判医生单独加入
|
||||||
|
public bool IsJudgeDoctor {get;set;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<VisitTask> DoctorVisitTaskList { get; set; } = new List<VisitTask>();
|
public List<VisitTask> DoctorVisitTaskList { get; set; } = new List<VisitTask>();
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// 0 代表 单重阅片 产生的任务 否则就是双重 任务 1 任务 2
|
/// 0 代表 单重阅片 产生的任务 否则就是双重 任务 1 任务 2
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public int ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
//分配状态
|
//分配状态
|
||||||
|
|
|
@ -328,6 +328,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
//后续全局自动分配
|
//后续全局自动分配
|
||||||
public bool IsFollowGlobalVisitAutoAssign { get; set; }
|
public bool IsFollowGlobalVisitAutoAssign { get; set; }
|
||||||
|
|
||||||
|
public bool IsFollowJudgeTaskAutoAssign { get; set; }
|
||||||
|
|
||||||
|
public TaskAllocateDefaultState FollowJudgeTaskAutoAssignDefaultState { get; set; }
|
||||||
|
|
||||||
//后续访视自动分配默认状态
|
//后续访视自动分配默认状态
|
||||||
public TaskAllocateDefaultState FollowVisitAutoAssignDefaultState { get; set; }
|
public TaskAllocateDefaultState FollowVisitAutoAssignDefaultState { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue