分配规则修改
parent
e1a778c93d
commit
b2f093f79d
|
@ -184,7 +184,7 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.BatchAssignDoctorToSubject(IRaCIS.Core.Application.ViewModel.BatchAssignDoctorToSubjectCommand)">
|
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.BatchAssignDoctorToSubject(IRaCIS.Core.Application.ViewModel.BatchAssignDoctorToSubjectCommand)">
|
||||||
<summary>
|
<summary>
|
||||||
|
一次性分配所有医生 批量分配(添加),后端现在没限制
|
||||||
</summary>
|
</summary>
|
||||||
<param name="command"></param>
|
<param name="command"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
|
|
|
@ -91,16 +91,34 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public bool IsJudgeDoctor { get; set; }
|
public bool IsJudgeDoctor { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TaskAllocationRuleDTO : TaskAllocationRuleAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
public DateTime UpdateTime { get; set; }
|
||||||
|
public Guid UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
public UserSimpleInfo DoctorUser { get; set; }
|
||||||
|
|
||||||
|
public List<ReadingCategory> ReadingCategoryList { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///<summary> TaskAllocationRuleAddOrEdit 列表查询参数模型</summary>
|
///<summary> TaskAllocationRuleAddOrEdit 列表查询参数模型</summary>
|
||||||
public class TaskAllocationRuleAddOrEdit
|
public class TaskAllocationRuleAddOrEdit
|
||||||
{
|
{
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
public int PlanReadingRatio { get; set; }
|
|
||||||
public Guid DoctorUserId { get; set; }
|
public Guid EnrollId { get; set; }
|
||||||
|
//public Guid DoctorUserId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public int PlanSubjectCount { 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +128,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public ReadingMethod ReadingType { get; set; }
|
public ReadingMethod ReadingType { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid EnrollId { get; set; }
|
||||||
|
|
||||||
public Guid? DoctorUserId { get; set; }
|
public Guid? DoctorUserId { get; set; }
|
||||||
|
|
||||||
public string UserCode { get; set; }
|
public string UserCode { get; set; }
|
||||||
|
@ -151,7 +172,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
//重阅 产生任务
|
//重阅 产生任务
|
||||||
public VisitTask ReReadingTask { get; set; }
|
public VisitTask ReReadingTask { get; set; }
|
||||||
|
|
||||||
public Action< VisitTask> Action;
|
public Action<VisitTask> Action;
|
||||||
|
|
||||||
//public ReReadingApplyGenerateTaskCommand ReReadingApplyGenerateTaskCommand { get; set; } = new ReReadingApplyGenerateTaskCommand();
|
//public ReReadingApplyGenerateTaskCommand ReReadingApplyGenerateTaskCommand { get; set; } = new ReReadingApplyGenerateTaskCommand();
|
||||||
|
|
||||||
|
@ -161,7 +182,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
//组间一致性
|
//组间一致性
|
||||||
|
|
||||||
public List<VisitTaskGroupSimpleDTO> GenerataGroupConsistentTaskList { get; set; }
|
public List<VisitTaskGroupSimpleDTO> GenerataGroupConsistentTaskList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
public Guid SubjectId { get; set; }
|
public List<Guid> SubjectIdList { get; set; }
|
||||||
|
|
||||||
public List<DoctorArm> DoctorArmList { get; set; }
|
public List<DoctorArm> DoctorArmList { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Interfaces
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule);
|
Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule);
|
||||||
|
|
||||||
Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId, bool isJudgeDoctor);
|
Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,48 +25,36 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
private readonly IRepository<Trial> _trialRepository;
|
private readonly IRepository<Trial> _trialRepository;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository, IRepository<Trial> trialRepository)
|
public TaskAllocationRuleService(IRepository<TaskAllocationRule> taskAllocationRuleRepository, IRepository<User> userRepository, IRepository<Trial> trialRepository)
|
||||||
{
|
{
|
||||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||||
_userRepository = userRepository;
|
_userRepository = userRepository;
|
||||||
_trialRepository= trialRepository;
|
_trialRepository = trialRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<(List<DoctorVisitTaskStatView>,object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<List<TaskAllocationRuleDTO> > GetDoctorPlanAllocationRuleList(Guid trialId)
|
||||||
{
|
{
|
||||||
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t=>t.TrialId== queryTaskAllocationRule.TrialId && t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor)
|
|
||||||
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider);
|
|
||||||
|
|
||||||
|
var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskAllocationRuleDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
var trialTaskConfig= _trialRepository.Where(t=>t.Id==queryTaskAllocationRule.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider, new { isJudgeDoctor = queryTaskAllocationRule.IsJudgeDoctor }).FirstOrDefault();
|
return list;
|
||||||
|
|
||||||
return (await taskAllocationRuleQueryable.ToListAsync(), trialTaskConfig);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取访视任务 应用Subject后 医生比率情况
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<List<DoctorVisitTaskStatView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
|
|
||||||
{
|
|
||||||
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor)
|
|
||||||
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList , isJudgeDoctor = assignConfirmCommand.IsJudgeDoctor });
|
|
||||||
|
|
||||||
return await taskAllocationRuleQueryable.ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
|
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
|
||||||
{
|
{
|
||||||
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
|
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
|
||||||
{
|
{
|
||||||
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId== addOrEditTaskAllocationRule.TrialId && t.IsJudgeDoctor==addOrEditTaskAllocationRule.IsJudgeDoctor,
|
VerifyExp = t => t.EnrollId == addOrEditTaskAllocationRule.EnrollId && t.TrialId == addOrEditTaskAllocationRule.TrialId,
|
||||||
VerifyMsg = "已有该医生配置,不允许继续增加"
|
VerifyMsg = "已有该医生配置,不允许继续增加"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,10 +65,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpDelete("{taskAllocationRuleId:guid}/{isJudgeDoctor:bool}")]
|
[HttpDelete("{taskAllocationRuleId:guid}")]
|
||||||
public async Task<IResponseOutput> DeleteTaskAllocationRule( Guid taskAllocationRuleId, bool isJudgeDoctor )
|
public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId)
|
||||||
{
|
{
|
||||||
if(await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId ).AnyAsync(t => t.DoctorVisitTaskList.Where(t=>isJudgeDoctor?t.ArmEnum==Domain.Share.Arm.JudgeArm: t.ArmEnum != Domain.Share.Arm.JudgeArm).Count() > 0))
|
if (await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId).AnyAsync(t => t.DoctorVisitTaskList.Any()))
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("已分配任务给该医生,不允许删除");
|
return ResponseOutput.NotOk("已分配任务给该医生,不允许删除");
|
||||||
}
|
}
|
||||||
|
@ -91,6 +79,35 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取访视任务 应用Subject后 医生比率情况
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<List<DoctorVisitTaskStatView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
|
||||||
|
{
|
||||||
|
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor)
|
||||||
|
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList, isJudgeDoctor = assignConfirmCommand.IsJudgeDoctor });
|
||||||
|
|
||||||
|
return await taskAllocationRuleQueryable.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<(List<DoctorVisitTaskStatView>, object)> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
|
||||||
|
{
|
||||||
|
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == queryTaskAllocationRule.TrialId /*&& t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor*/)
|
||||||
|
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
|
||||||
|
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryTaskAllocationRule.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider, new { isJudgeDoctor = queryTaskAllocationRule.IsJudgeDoctor }).FirstOrDefault();
|
||||||
|
|
||||||
|
return (await taskAllocationRuleQueryable.ToListAsync(), trialTaskConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取项目下 医生账户信息下拉
|
/// 获取项目下 医生账户信息下拉
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -98,19 +115,20 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="_enrollRepository"></param>
|
/// <param name="_enrollRepository"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("{trialId:guid}")]
|
[HttpGet("{trialId:guid}")]
|
||||||
public async Task<List<TrialDoctorUserSelectView>> GetDoctorUserSelectList(Guid trialId,[FromServices] IRepository<Enroll> _enrollRepository)
|
public async Task<List<TrialDoctorUserSelectView>> GetDoctorUserSelectList(Guid trialId, [FromServices] IRepository<Enroll> _enrollRepository)
|
||||||
{
|
{
|
||||||
var query = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus >= (int)EnrollStatus.ConfirmIntoGroup)
|
var query = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus >= (int)EnrollStatus.ConfirmIntoGroup)
|
||||||
join user in _userRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId
|
join user in _userRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId
|
||||||
select new TrialDoctorUserSelectView()
|
select new TrialDoctorUserSelectView()
|
||||||
{
|
{
|
||||||
TrialId = enroll.TrialId,
|
TrialId = enroll.TrialId,
|
||||||
ReadingType=enroll.Trial.ReadingType,
|
ReadingType = enroll.Trial.ReadingType,
|
||||||
DoctorUserId= user.Id,
|
EnrollId =enroll.Id,
|
||||||
FullName=user.FullName,
|
DoctorUserId = user.Id,
|
||||||
UserCode=user.UserCode,
|
FullName = user.FullName,
|
||||||
UserName=user.UserName,
|
UserCode = user.UserCode,
|
||||||
UserTypeEnum=user.UserTypeRole.UserTypeEnum
|
UserName = user.UserName,
|
||||||
|
UserTypeEnum = user.UserTypeRole.UserTypeEnum
|
||||||
};
|
};
|
||||||
|
|
||||||
return query.ToList();
|
return query.ToList();
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inQuery"></param>
|
/// <param name="inQuery"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<GenerateMedicalReviewTaskView>> GetGenerateMedicalReviewTaskList(GenerateMedicalReviewTaskQuery inQuery)
|
public async Task<PageOutput<GenerateMedicalReviewTaskView>> GetGenerateMedicalReviewTaskList(GenerateMedicalReviewTaskQuery inQuery)
|
||||||
{
|
{
|
||||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
|
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.Where(t => t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
.Where(t => t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||||
|
@ -84,7 +84,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||||
.WhereIf(inQuery.IsGeneratedJudge != null, t => t.JudgeVisitTaskId != null)
|
.WhereIf(inQuery.IsGeneratedJudge != null, t => t.JudgeVisitTaskId != null)
|
||||||
.WhereIf(inQuery.IsGlobalHaveUpdate != null, t => t.IsGlobalHaveUpdate== inQuery.IsGlobalHaveUpdate)
|
.WhereIf(inQuery.IsGlobalHaveUpdate != null, t => t.IsGlobalHaveUpdate == inQuery.IsGlobalHaveUpdate)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var taskId in command.TaskIdList)
|
foreach (var taskId in command.TaskIdList)
|
||||||
{
|
{
|
||||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { TrialId = command.TrialId, VisitTaskId = taskId, MedicalManagerUserId = command.MedicalManagerUserId ,AllocateTime=DateTime.Now});
|
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { TrialId = command.TrialId, VisitTaskId = taskId, MedicalManagerUserId = command.MedicalManagerUserId, AllocateTime = DateTime.Now });
|
||||||
}
|
}
|
||||||
|
|
||||||
await _taskMedicalReviewRepository.SaveChangesAsync();
|
await _taskMedicalReviewRepository.SaveChangesAsync();
|
||||||
|
|
|
@ -76,15 +76,36 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// 一次性分配所有医生 批量分配(添加),后端现在没限制
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command"></param>
|
/// <param name="command"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IResponseOutput> BatchAssignDoctorToSubject(BatchAssignDoctorToSubjectCommand command)
|
public async Task<IResponseOutput> BatchAssignDoctorToSubject(BatchAssignDoctorToSubjectCommand command)
|
||||||
{
|
{
|
||||||
|
foreach (var subjectId in command.SubjectIdList)
|
||||||
|
{
|
||||||
|
foreach (var doctorArm in command.DoctorArmList)
|
||||||
|
{
|
||||||
|
await _subjectUserRepository.AddAsync(new SubjectUser() { ArmEnum = doctorArm.ArmEnum, DoctorUserId = doctorArm.DoctorUserId, SubjectId = subjectId, AssignTime = DateTime.Now });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await _subjectUserRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 阅片人维度 Subject统计表
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="command"></param>
|
||||||
|
///// <returns></returns>
|
||||||
|
//public async Task<IResponseOutput> GetDoctorSubjectStat(Guid trialId )
|
||||||
|
//{
|
||||||
|
// var query= from enroll in _repository.Where<Enroll>(t=>t.TrialId==trialId)
|
||||||
|
// join user in _repository.Where<User>() on enroll.DoctorId equals user.DoctorId
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1195,21 +1216,22 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
var origenalTask = (await _visitTaskRepository.Where(t => item.OriginalReReadingTaskId == t.Id).FirstOrDefaultAsync()).IfNullThrowException();
|
var origenalTask = (await _visitTaskRepository.Where(t => item.OriginalReReadingTaskId == t.Id).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
// 当前访视之前 已有任务申请
|
// 当前访视之前 已有任务申请
|
||||||
if (trialConfig.IsReadingTaskViewInOrder )
|
if (trialConfig.IsReadingTaskViewInOrder)
|
||||||
{
|
{
|
||||||
|
|
||||||
//var query = _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.SubjectId == origenalTask.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit
|
var query = _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.SubjectId == origenalTask.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit
|
||||||
// && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.OriginalReReadingTask.VisitTaskNum > origenalTask.VisitTaskNum && t.RequestReReadingResultEnum == RequestReReadingResult.Default)
|
&& t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.OriginalReReadingTask.VisitTaskNum > origenalTask.VisitTaskNum && t.RequestReReadingResultEnum == RequestReReadingResult.Default)
|
||||||
// .Where(t => t.OriginalReReadingTask.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
|
.Where(t => t.OriginalReReadingTask.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
|
||||||
|
|
||||||
//if(await query.AnyAsync())
|
if (await query.AnyAsync())
|
||||||
//{
|
{
|
||||||
// return ResponseOutput.NotOk("当前为有序阅片,当前访视之后,也申请了重阅 必须从后向前处理");
|
return ResponseOutput.NotOk("当前为有序阅片,当前访视之后,也申请了重阅 必须从后向前处理");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == origenalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState==TaskAllocationState.Allocated;
|
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);
|
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
|
||||||
|
@ -1233,6 +1255,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
// });
|
// });
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//PM申请 SPM / CPM审批 回退访视,在此不生成访视任务
|
//PM申请 SPM / CPM审批 回退访视,在此不生成访视任务
|
||||||
if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.TrialGroupApply && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM))
|
if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.TrialGroupApply && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM))
|
||||||
{
|
{
|
||||||
|
@ -1254,7 +1278,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
|
|
||||||
//访视影响当前以及当前之后的 两个阅片人的
|
//访视影响当前以及当前之后的 两个阅片人的
|
||||||
filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum );
|
filterExpression = filterExpression.And(t => t.VisitTaskNum >= origenalTask.VisitTaskNum);
|
||||||
|
|
||||||
|
|
||||||
#region 影响的任务
|
#region 影响的任务
|
||||||
|
@ -1274,6 +1298,12 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
|
influenceTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = t.Id });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//将医学审核设置为失效
|
||||||
|
|
||||||
|
var taskIdList = influenceTaskList.Select(t => t.Id).ToList();
|
||||||
|
|
||||||
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(t => taskIdList.Contains(t.VisitTaskId) && t.AuditState != MedicalReviewAuditState.HaveSigned , u => new TaskMedicalReview() { IsInvalid = false });
|
||||||
}
|
}
|
||||||
|
|
||||||
//申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配
|
//申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配
|
||||||
|
|
|
@ -65,6 +65,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
CreateMap<TaskAllocationRule, TaskAllocationRuleDTO>()
|
||||||
|
.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.Enroll.DoctorUser))
|
||||||
|
.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t=>t.ReadingCategory).ToList()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<Subject, SubjectAssignStat>()
|
CreateMap<Subject, SubjectAssignStat>()
|
||||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.TrialSite.TrialSiteCode))
|
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.TrialSite.TrialSiteCode))
|
||||||
|
|
|
@ -392,6 +392,8 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
await _trialUserRepository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId });
|
await _trialUserRepository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId });
|
||||||
|
|
||||||
|
await _enrollRepository.BatchUpdateNoTrackingAsync(t => t.Id == intoGroupItem.Id, u => new Enroll() { DoctorUserId = userId });
|
||||||
|
|
||||||
await _taskAllocationRuleRepository.AddAsync(new TaskAllocationRule() { TrialId = trialId, DoctorUserId = userId });
|
await _taskAllocationRuleRepository.AddAsync(new TaskAllocationRule() { TrialId = trialId, DoctorUserId = userId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public Arm ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
|
|
||||||
public bool IsConfirmed { get; set; }
|
public bool IsConfirmed { get; set; } = true;
|
||||||
|
|
||||||
//该属性有值 说明该医生被替换了 分配的时候 要过滤掉
|
//该属性有值 说明该医生被替换了 分配的时候 要过滤掉
|
||||||
public Guid? OrignalSubjectUserId { get; set; }
|
public Guid? OrignalSubjectUserId { get; set; }
|
||||||
|
|
|
@ -19,77 +19,36 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
|
|
||||||
public Trial Trial { get; set; }
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// CreateUserId
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// CreateTime
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UpdateTime
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public DateTime UpdateTime { get; set; }
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UpdateUserId
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public Guid UpdateUserId { get; set; }
|
public Guid UpdateUserId { get; set; }
|
||||||
|
public int PlanSubjectCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
public bool IsEnable { get; set; }
|
||||||
/// 计划比率
|
|
||||||
/// </summary>
|
public string Note { get; set; } = string.Empty;
|
||||||
[Required]
|
|
||||||
public int PlanReadingRatio { get; set; }
|
public Guid EnrollId { get; set; }
|
||||||
|
|
||||||
|
public Enroll Enroll { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
//是否是裁判医生 裁判医生单独加入
|
||||||
|
public bool IsJudgeDoctor { get; set; }
|
||||||
public Guid DoctorUserId { get; set; }
|
public Guid DoctorUserId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("DoctorUserId")]
|
[ForeignKey("DoctorUserId")]
|
||||||
|
|
||||||
public User DoctorUser { get; set; }
|
public User DoctorUser { get; set; }
|
||||||
|
public int PlanReadingRatio { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// IsEnable
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public bool IsEnable { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
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>();
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// Arm 组
|
|
||||||
///// </summary>
|
|
||||||
//[Required]
|
|
||||||
//public int GroupEnum { get; set; }
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 分配类型
|
|
||||||
///// </summary>
|
|
||||||
//[Required]
|
|
||||||
//public int AllocationObjectEnum { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,161 +11,164 @@ using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models
|
namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
///<summary>
|
///<summary>
|
||||||
///TaskMedicalReview
|
///TaskMedicalReview
|
||||||
///</summary>
|
///</summary>
|
||||||
[Table("TaskMedicalReview")]
|
[Table("TaskMedicalReview")]
|
||||||
public class TaskMedicalReview :Entity, IAuditUpdate, IAuditAdd
|
public class TaskMedicalReview : Entity, IAuditUpdate, IAuditAdd
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
|
/// <summary>
|
||||||
/// CreateUserId
|
/// CreateUserId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CreateTime
|
/// CreateTime
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// UpdateTime
|
/// UpdateTime
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public DateTime UpdateTime { get; set; }
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// UpdateUserId
|
/// UpdateUserId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public Guid UpdateUserId { get; set; }
|
public Guid UpdateUserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分配时间
|
/// 分配时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? AllocateTime { get; set; }
|
public DateTime? AllocateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 审核状态
|
/// 审核状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public MedicalReviewAuditState AuditState { get; set; }
|
public MedicalReviewAuditState AuditState { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 审核通过时间
|
/// 审核通过时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? AuditSignTime { get; set; }
|
public DateTime? AuditSignTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 阅片人是否认同
|
/// 阅片人是否认同
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MedicalReviewDoctorUserIdea DoctorUserIdeaEnum { get; set; }
|
public MedicalReviewDoctorUserIdea DoctorUserIdeaEnum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MedicalManagerUserId
|
/// MedicalManagerUserId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? MedicalManagerUserId { get; set; }
|
public Guid? MedicalManagerUserId { get; set; }
|
||||||
|
|
||||||
public User MedicalManagerUser { get; set; }
|
public User MedicalManagerUser { get; set; }
|
||||||
|
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("VisitTaskId")]
|
[ForeignKey("VisitTaskId")]
|
||||||
public VisitTask VisitTask { get; set; }
|
public VisitTask VisitTask { get; set; }
|
||||||
|
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 冗余 废弃
|
/// 冗余 废弃
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid DoctorUserId { get; set; }
|
public Guid DoctorUserId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public TaskMedicalReviewRule TaskMedicalReviewRule { get; set; }
|
public TaskMedicalReviewRule TaskMedicalReviewRule { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否有问题
|
/// 是否有问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsHaveQuestion { get; set; } = false;
|
public bool IsHaveQuestion { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 质询问题
|
/// 质询问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Questioning { get; set; } = string.Empty;
|
public string Questioning { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 图片路径
|
/// 图片路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ImagePath { get; set; } = string.Empty;
|
public string ImagePath { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 审核建议
|
/// 审核建议
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public AuditAdvice AuditAdviceEnum { get; set; }
|
public AuditAdvice AuditAdviceEnum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否关闭对话
|
/// 是否关闭对话
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsClosedDialog { get; set; }
|
public bool IsClosedDialog { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存问题的时间
|
/// 保存问题的时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? SaveQuestionTime { get; set; }
|
public DateTime? SaveQuestionTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 不同意重阅原因
|
/// 不同意重阅原因
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DisagreeReason { get; set; } = string.Empty;
|
public string DisagreeReason { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否申请重阅
|
/// 是否申请重阅
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsApplyHeavyReading { get; set; } = false;
|
public bool IsApplyHeavyReading { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存结论时间
|
/// 保存结论时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? SaveConclusionTime { get; set; }
|
public DateTime? SaveConclusionTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件名称
|
/// 文件名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FileName { get; set; } = string.Empty;
|
public string FileName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
public List<ReadingMedicalReviewDialog> ReadingMedicalReviewDialogList { get; set; }
|
public List<ReadingMedicalReviewDialog> ReadingMedicalReviewDialogList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否发送消息
|
/// 是否发送消息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSendMessage { get; set; } = false;
|
public bool IsSendMessage { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 医学审核对话关闭原因
|
/// 医学审核对话关闭原因
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MedicalDialogClose MedicalDialogCloseEnum { get; set; }
|
public MedicalDialogClose MedicalDialogCloseEnum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 对话关闭原因
|
/// 对话关闭原因
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DialogCloseReason { get; set; } = string.Empty;
|
public string DialogCloseReason { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 无效的
|
||||||
|
/// </summary>
|
||||||
|
public bool IsInvalid { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -7,8 +7,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[Table("Enroll")]
|
[Table("Enroll")]
|
||||||
public partial class Enroll : Entity,IAuditUpdate,IAuditAdd
|
public partial class Enroll : Entity,IAuditUpdate,IAuditAdd
|
||||||
{
|
{
|
||||||
[ForeignKey("TrialId")]
|
|
||||||
public virtual TaskConsistentRule TaskConsistentRule { get; set; }
|
|
||||||
|
|
||||||
[ForeignKey("TrialId")]
|
[ForeignKey("TrialId")]
|
||||||
public virtual Trial Trial { get; set; }
|
public virtual Trial Trial { get; set; }
|
||||||
|
@ -60,6 +59,15 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public int DoctorTrialState { get; set; }
|
public int DoctorTrialState { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成账号 加入到项目中后 赋值
|
||||||
|
/// </summary>
|
||||||
|
public Guid? DoctorUserId { get; set; }
|
||||||
|
|
||||||
|
public User DoctorUser { get; set; }
|
||||||
|
|
||||||
|
public TaskAllocationRule TaskAllocationRule { get; set; }
|
||||||
|
|
||||||
public List<EnrollReadingCategory> EnrollReadingCategoryList { get; set; }
|
public List<EnrollReadingCategory> EnrollReadingCategoryList { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue