修改配置
parent
3acb30cc93
commit
ac220ab495
|
@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -65,7 +66,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
|
||||
{
|
||||
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId== addOrEditTaskAllocationRule.TrialId && t.IsJudgeDoctor,
|
||||
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId== addOrEditTaskAllocationRule.TrialId && t.IsJudgeDoctor==addOrEditTaskAllocationRule.IsJudgeDoctor,
|
||||
VerifyMsg = "已有该医生配置,不允许继续增加"
|
||||
};
|
||||
|
||||
|
@ -99,7 +100,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<TrialDoctorUserSelectView>> GetDoctorUserSelectList(Guid trialId,[FromServices] IRepository<Enroll> _enrollRepository)
|
||||
{
|
||||
var query = from enroll in _enrollRepository.Where(t => t.TrialId == trialId)
|
||||
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
|
||||
select new TrialDoctorUserSelectView()
|
||||
{
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
await _visitTaskCommonService.GenerateVisitTaskAsync(queryVisitTask.TrialId, svIdList);
|
||||
|
||||
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate==false)
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
|
||||
|
||||
|
@ -667,6 +667,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
var subjectList = _subjectRepository.Where(t => t.TrialId == trialId)
|
||||
.WhereIf(isJudge == false, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(isJudge, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
//过滤掉 那些回退的subject
|
||||
.Where(t=>! t.SubjectVisitList.Any(t=>t.IsPMBackOrReReading))
|
||||
.Select(t => new
|
||||
{
|
||||
SubjectId = t.Id,
|
||||
|
@ -894,6 +896,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
throw new BusinessValidationFailedException("出现脏数据 任务来源字段没有值");
|
||||
}
|
||||
|
||||
//PM 回退了 但是还没生成任务
|
||||
if( await _subjectVisitRepository.AnyAsync(t=>t.SubjectId== visitTask.SubjectId && t.IsPMBackOrReReading))
|
||||
{
|
||||
return ResponseOutput.NotOk("该受试者有访视进入了退回流程,还未经过一致性核查通过,不允许分配");
|
||||
}
|
||||
|
||||
|
||||
visitTask.AllocateTime = DateTime.Now;
|
||||
|
@ -1287,10 +1294,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
//同步才可以
|
||||
Action = (newTask) =>
|
||||
{
|
||||
//申请表 设置新任务Id
|
||||
//申请表 设置新任务Id
|
||||
visitTaskReReadingAppply.NewReReadingTaskId = newTask.Id;
|
||||
|
||||
//生成的任务分配给原始医生
|
||||
//生成的任务分配给原始医生
|
||||
newTask.DoctorUserId = origenalTask.DoctorUserId;
|
||||
newTask.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
newTask.AllocateTime = DateTime.Now;
|
||||
|
@ -1316,10 +1323,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
//同步才可以
|
||||
Action = (newTask) =>
|
||||
{
|
||||
//申请表 设置新任务Id
|
||||
//申请表 设置新任务Id
|
||||
visitTaskReReadingAppply.NewReReadingTaskId = newTask.Id;
|
||||
|
||||
//生成的任务分配给原始医生
|
||||
//生成的任务分配给原始医生
|
||||
newTask.DoctorUserId = origenalTask.DoctorUserId;
|
||||
newTask.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
newTask.AllocateTime = DateTime.Now;
|
||||
|
@ -1365,10 +1372,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
//同步才可以
|
||||
Action = (newTask) =>
|
||||
{
|
||||
//申请表 设置新任务Id
|
||||
//申请表 设置新任务Id
|
||||
visitTaskReReadingAppply.NewReReadingTaskId = newTask.Id;
|
||||
|
||||
//生成的任务分配给原始医生
|
||||
//生成的任务分配给原始医生
|
||||
newTask.DoctorUserId = origenalTask.DoctorUserId;
|
||||
newTask.TaskAllocationState = TaskAllocationState.Allocated;
|
||||
newTask.AllocateTime = DateTime.Now;
|
||||
|
@ -1406,6 +1413,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var task = (await _visitTaskRepository.FirstOrDefaultAsync(t => t.Id == taskId)).IfNullThrowException();
|
||||
|
||||
if (task.TaskState != TaskState.Effect)
|
||||
{
|
||||
return ResponseOutput.NotOk("仅仅允许针对生效的任务进行退回操作,请刷新页面数据");
|
||||
}
|
||||
|
||||
//申请的任务 肯定是未完成阅片的 并且是访视类型的
|
||||
if (task.ReadingCategory != ReadingCategory.Visit || task.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
{
|
||||
|
@ -1473,6 +1485,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
influenceTask.DoctorUserId = null;
|
||||
influenceTask.AllocateTime = null;
|
||||
influenceTask.SuggesteFinishedTime = null;
|
||||
influenceTask.TaskAllocationState = TaskAllocationState.NotAllocate;
|
||||
break;
|
||||
|
||||
|
@ -1521,6 +1534,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
influenceTask.DoctorUserId = null;
|
||||
influenceTask.AllocateTime = null;
|
||||
influenceTask.SuggesteFinishedTime = null;
|
||||
influenceTask.TaskAllocationState = TaskAllocationState.NotAllocate;
|
||||
break;
|
||||
|
||||
|
@ -1564,6 +1578,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
//需要重新产生任务
|
||||
sv.IsVisitTaskGenerated = false;
|
||||
sv.IsPMBackOrReReading = true;
|
||||
|
||||
sv.AuditState = AuditStateEnum.None;
|
||||
sv.SubmitState = SubmitStateEnum.ToSubmit;
|
||||
|
|
|
@ -231,6 +231,8 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
|
||||
#endregion
|
||||
|
||||
context.Entity.IsPMBackOrReReading = false;
|
||||
|
||||
await _visitTaskHelpeService.GenerateVisitTaskAsync(subjectVisit.TrialId, new List<Guid>() { subjectVisit.Id }, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public bool IsVisitTaskGenerated { get; set; }
|
||||
|
||||
public bool IsPMBackOrReReading { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关闭一致性质疑原因
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue