调整申请重阅调整
parent
5250cd524a
commit
2c5ba280e9
|
@ -995,6 +995,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid TrialReadingCriterionId { get; set; }
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
|
public Guid? VisitTaskId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1185,7 +1185,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
return ResponseOutput.Ok(result, new
|
return ResponseOutput.Ok(result, new
|
||||||
{
|
{
|
||||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder==ReadingOrder.InOrder,
|
IsReadingTaskViewInOrder = isReadingTaskViewInOrder == ReadingOrder.InOrder,
|
||||||
RandomReadInfo = iRUnReadOut,
|
RandomReadInfo = iRUnReadOut,
|
||||||
ReadingTool = readingTool,
|
ReadingTool = readingTool,
|
||||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
||||||
|
@ -1516,53 +1516,77 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> AIRReReading(AIRReReadingCommand command, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
|
public async Task<IResponseOutput> AIRReReading(AIRReReadingCommand command, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
|
||||||
{
|
{
|
||||||
var baseLineTaskList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.AIR)
|
||||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SourceSubjectVisit.IsBaseLine == true).ToListAsync();
|
|
||||||
|
|
||||||
var judegeList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
|
||||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Judge && t.ReadingTaskState == ReadingTaskState.HaveSigned).ToListAsync();
|
|
||||||
|
|
||||||
foreach (var item in judegeList)
|
|
||||||
{
|
{
|
||||||
if (!baseLineTaskList.Any(t => t.SubjectId == item.SubjectId))
|
var baseLineTaskList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||||
|
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SourceSubjectVisit.IsBaseLine == true).ToListAsync();
|
||||||
|
|
||||||
|
var judegeList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||||
|
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Judge && t.ReadingTaskState == ReadingTaskState.HaveSigned).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in judegeList)
|
||||||
{
|
{
|
||||||
baseLineTaskList.Add(item);
|
if (!baseLineTaskList.Any(t => t.SubjectId == item.SubjectId))
|
||||||
|
{
|
||||||
|
baseLineTaskList.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var baseLineTaskIdList = baseLineTaskList.Select(t => t.Id).ToList();
|
||||||
|
|
||||||
|
if (baseLineTaskIdList.Count == 0)
|
||||||
|
{
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (baseLineTaskList == null)
|
||||||
|
//{
|
||||||
|
// return ResponseOutput.NotOk("基线任务未阅完,不允许重阅基线任务");
|
||||||
|
//}
|
||||||
|
|
||||||
|
await ApplyReReading(new ApplyReReadingCommand() { IsCopyFollowForms = false, IsCopyOrigenalForms = false, TaskIdList = baseLineTaskIdList, TrialId = command.TrialId, RequestReReadingReason = "AIR自动重阅基线", RequestReReadingType = RequestReReadingType.DocotorApply });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var requestRecordList = await _visitTaskReReadingRepository.Where(t => baseLineTaskIdList.Contains(t.OriginalReReadingTaskId) && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "AIR自动重阅基线").ToListAsync();
|
||||||
|
|
||||||
|
if (requestRecordList.Count != baseLineTaskIdList.Count)
|
||||||
|
{
|
||||||
|
//---后台数据有错误
|
||||||
|
return ResponseOutput.NotOk(_localizer["VisitTask_DoctorConfiguration"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
await ConfirmReReading(new ConfirmReReadingCommand()
|
||||||
|
{
|
||||||
|
TrialId = command.TrialId,
|
||||||
|
RequestReReadingResultEnum = RequestReReadingResult.Agree,
|
||||||
|
//ConfirmReReadingList = new List<ConfirmReReadingDTO>() { new ConfirmReReadingDTO() { Id = requestRecord.Id, OriginalReReadingTaskId = task.Id } }
|
||||||
|
ConfirmReReadingList = requestRecordList.Select(t => new ConfirmReReadingDTO() { Id = t.Id, OriginalReReadingTaskId = t.OriginalReReadingTaskId }).ToList()
|
||||||
|
}, _visitTaskCommonService);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (command.VisitTaskId != null)
|
||||||
|
{
|
||||||
|
var visitTaskId = command.VisitTaskId.Value;
|
||||||
|
var taskIdList = new List<Guid>();
|
||||||
|
|
||||||
|
taskIdList.Add(visitTaskId);
|
||||||
|
|
||||||
|
await ApplyReReading(new ApplyReReadingCommand() { IsCopyFollowForms = false, IsCopyOrigenalForms = true, TaskIdList = taskIdList, TrialId = command.TrialId, RequestReReadingReason = "阅片人自动重阅阅片任务", RequestReReadingType = RequestReReadingType.DocotorApply });
|
||||||
|
|
||||||
|
var requestRecord = await _visitTaskReReadingRepository.Where(t => visitTaskId == t.OriginalReReadingTaskId && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "阅片人自动重阅阅片任务").FirstAsync();
|
||||||
|
|
||||||
|
await ConfirmReReading(new ConfirmReReadingCommand()
|
||||||
|
{
|
||||||
|
TrialId = command.TrialId,
|
||||||
|
RequestReReadingResultEnum = RequestReReadingResult.Agree,
|
||||||
|
ConfirmReReadingList = new List<ConfirmReReadingDTO>() { new ConfirmReReadingDTO() { Id = requestRecord.Id, OriginalReReadingTaskId = visitTaskId } }
|
||||||
|
}, _visitTaskCommonService);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var baseLineTaskIdList = baseLineTaskList.Select(t => t.Id).ToList();
|
|
||||||
|
|
||||||
if (baseLineTaskIdList.Count == 0)
|
|
||||||
{
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
//if (baseLineTaskList == null)
|
|
||||||
//{
|
|
||||||
// return ResponseOutput.NotOk("基线任务未阅完,不允许重阅基线任务");
|
|
||||||
//}
|
|
||||||
|
|
||||||
await ApplyReReading(new ApplyReReadingCommand() { IsCopyFollowForms = false, IsCopyOrigenalForms = false, TaskIdList = baseLineTaskIdList, TrialId = command.TrialId, RequestReReadingReason = "AIR自动重阅基线", RequestReReadingType = RequestReReadingType.DocotorApply });
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var requestRecordList = await _visitTaskReReadingRepository.Where(t => baseLineTaskIdList.Contains(t.OriginalReReadingTaskId) && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "AIR自动重阅基线").ToListAsync();
|
|
||||||
|
|
||||||
if (requestRecordList.Count != baseLineTaskIdList.Count)
|
|
||||||
{
|
|
||||||
//---后台数据有错误
|
|
||||||
return ResponseOutput.NotOk(_localizer["VisitTask_DoctorConfiguration"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
await ConfirmReReading(new ConfirmReReadingCommand()
|
|
||||||
{
|
|
||||||
TrialId = command.TrialId,
|
|
||||||
RequestReReadingResultEnum = RequestReReadingResult.Agree,
|
|
||||||
//ConfirmReReadingList = new List<ConfirmReReadingDTO>() { new ConfirmReReadingDTO() { Id = requestRecord.Id, OriginalReReadingTaskId = task.Id } }
|
|
||||||
ConfirmReReadingList = requestRecordList.Select(t => new ConfirmReReadingDTO() { Id = t.Id, OriginalReReadingTaskId = t.OriginalReReadingTaskId }).ToList()
|
|
||||||
}, _visitTaskCommonService);
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1599,7 +1623,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
throw new BusinessValidationFailedException(_localizer["VisitTask_BackendData"]);
|
throw new BusinessValidationFailedException(_localizer["VisitTask_BackendData"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogError("重阅申请状态"+ (int)task.ReReadingApplyState);
|
_logger.LogError("重阅申请状态" + (int)task.ReReadingApplyState);
|
||||||
|
|
||||||
if (task.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.Agree)
|
if (task.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.Agree)
|
||||||
{
|
{
|
||||||
|
@ -1743,7 +1767,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
}
|
}
|
||||||
|
|
||||||
//AIR 不加验证
|
//AIR 不加验证
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.AIR)
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.AIR || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR)
|
||||||
{
|
{
|
||||||
task.ReReadingApplyState = ReReadingApplyState.DocotorHaveApplyed;
|
task.ReReadingApplyState = ReReadingApplyState.DocotorHaveApplyed;
|
||||||
}
|
}
|
||||||
|
@ -1879,7 +1903,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
visitTaskReReadingAppply.RequestReReadingRejectReason = agreeReReadingCommand.RequestReReadingRejectReason;
|
visitTaskReReadingAppply.RequestReReadingRejectReason = agreeReReadingCommand.RequestReReadingRejectReason;
|
||||||
|
|
||||||
|
|
||||||
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == origenalTask.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
|
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == origenalTask.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) /*&& t.TaskAllocationState == TaskAllocationState.Allocated*/;
|
||||||
|
|
||||||
//是否是一致性分析任务 正常申请 会影响一致性分析任务
|
//是否是一致性分析任务 正常申请 会影响一致性分析任务
|
||||||
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
|
filterExpression = filterExpression.And(t => t.IsAnalysisCreate == origenalTask.IsAnalysisCreate);
|
||||||
|
@ -2045,7 +2069,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
}
|
}
|
||||||
//IR申请 PM 审批 注意这里有一致性分析的申请同意 不会回退访视,在此要生成影响的访视任务
|
//IR申请 PM 审批 注意这里有一致性分析的申请同意 不会回退访视,在此要生成影响的访视任务
|
||||||
else if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.DocotorApply && (IsPMOrAPm() || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.AIR))
|
else if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.DocotorApply && (IsPMOrAPm() ||
|
||||||
|
_userInfo.UserTypeEnumInt == (int)UserTypeEnum.AIR
|
||||||
|
|| _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR
|
||||||
|
|| _userInfo.UserTypeEnumInt == (int)UserTypeEnum.PI))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
.ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId))
|
.ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId))
|
||||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
//.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
||||||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||||
|
|
||||||
|
|
|
@ -3163,6 +3163,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await VerifyTaskIsSign(visitTaskId);
|
await VerifyTaskIsSign(visitTaskId);
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(visitTaskId, x => new VisitTask()
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(visitTaskId, x => new VisitTask()
|
||||||
{
|
{
|
||||||
|
DoctorUserId = _userInfo.Id,
|
||||||
ReadingTaskState = ReadingTaskState.HaveSigned,
|
ReadingTaskState = ReadingTaskState.HaveSigned,
|
||||||
SignTime = DateTime.Now,
|
SignTime = DateTime.Now,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue