重阅影响
parent
2b164b91f2
commit
fbe962debb
|
@ -11,6 +11,7 @@ using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -1401,13 +1402,74 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpGet("{taskId:guid}")]
|
[HttpGet("{taskId:guid}")]
|
||||||
public async Task<List<VisitTaskSimpleView>> GetReReadingInfluenceTaskList(Guid taskId)
|
public async Task<List<VisitTaskSimpleView>> GetReReadingInfluenceTaskList(Guid taskId)
|
||||||
{
|
{
|
||||||
var filterObj = await _visitTaskRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == taskId);
|
var filterObj = (await _visitTaskRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == taskId)).IfNullThrowException();
|
||||||
|
var trialId = filterObj.TrialId;
|
||||||
|
|
||||||
var list = await _visitTaskRepository.Where(t => t.TrialId == filterObj.TrialId && t.SubjectId == filterObj.SubjectId && t.VisitTaskNum >= filterObj.VisitTaskNum)
|
var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
|
List<VisitTaskSimpleView> list = null;
|
||||||
|
|
||||||
|
//有序
|
||||||
|
if (trialConfig.IsReadingTaskViewInOrder)
|
||||||
|
{
|
||||||
|
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
|
||||||
|
{
|
||||||
|
list = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId)
|
||||||
.Where(t => t.TaskState == TaskState.Effect && !t.IsAnalysisCreate)
|
.Where(t => t.TaskState == TaskState.Effect && !t.IsAnalysisCreate)
|
||||||
|
//过滤区别
|
||||||
|
.Where(t => t.VisitTaskNum >= filterObj.VisitTaskNum && t.DoctorUserId==filterObj.DoctorUserId)
|
||||||
|
|
||||||
|
.ProjectTo<VisitTaskSimpleView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
//影响所有阅片人
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
||||||
|
{
|
||||||
|
list = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId)
|
||||||
|
.Where(t => t.TaskState == TaskState.Effect && !t.IsAnalysisCreate)
|
||||||
|
//过滤区别
|
||||||
|
.Where(t => t.VisitTaskNum >= filterObj.VisitTaskNum )
|
||||||
|
|
||||||
|
.ProjectTo<VisitTaskSimpleView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//无序
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//1.当前任务及裁判任务
|
||||||
|
//2.影响当前阅片人的任务
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
|
||||||
|
{
|
||||||
|
|
||||||
|
list = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId )
|
||||||
|
.Where(t => t.TaskState == TaskState.Effect && !t.IsAnalysisCreate)
|
||||||
|
//过滤区别
|
||||||
|
.Where (t=> t.Id==filterObj.Id || t.Id ==filterObj.JudgeVisitTaskId)
|
||||||
|
|
||||||
.ProjectTo<VisitTaskSimpleView>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<VisitTaskSimpleView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//1.当前任务及裁判任务
|
||||||
|
// 2.影响所有阅片人的任务
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
||||||
|
{
|
||||||
|
var judegTaskNum = filterObj.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge];
|
||||||
|
|
||||||
|
list = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId)
|
||||||
|
.Where(t => t.TaskState == TaskState.Effect && !t.IsAnalysisCreate)
|
||||||
|
//过滤区别
|
||||||
|
.Where(t => t.VisitTaskNum==filterObj.VisitTaskNum || t.VisitTaskNum== judegTaskNum)
|
||||||
|
|
||||||
|
.ProjectTo<VisitTaskSimpleView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
public static class ReadingCommon
|
public static class ReadingCommon
|
||||||
{
|
{
|
||||||
|
|
||||||
public static Dictionary<ReadingCategory, dynamic> TaskNumDic = new Dictionary<ReadingCategory, dynamic>()
|
public static Dictionary<ReadingCategory, decimal> TaskNumDic = new Dictionary<ReadingCategory, decimal>()
|
||||||
{
|
{
|
||||||
{ReadingCategory.Visit, 0 },
|
{ReadingCategory.Visit, 0 },
|
||||||
{ReadingCategory.Global,0.03 },
|
{ReadingCategory.Global,(decimal) 0.03 },
|
||||||
{ReadingCategory.Judge,0.02 },
|
{ReadingCategory.Judge,(decimal) 0.02 },
|
||||||
{ReadingCategory.ReReading, 0 },
|
{ReadingCategory.ReReading, 0 },
|
||||||
{ReadingCategory.Oncology, 0 },
|
{ReadingCategory.Oncology, 0 },
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue