随机阅片NextTask-4
parent
c49a74d742
commit
180b02b28c
|
@ -647,7 +647,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
||||||
IsConvertedTask = x.IsConvertedTask,
|
IsConvertedTask = x.IsConvertedTask,
|
||||||
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
||||||
IsExistUnprocessedFeedback=x.UserFeedBackList.Any(y => y.State == 0),
|
IsExistUnprocessedFeedback = x.UserFeedBackList.Any(y => y.State == 0),
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
@ -1649,7 +1649,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
QuestionMark.IsLymph,
|
QuestionMark.IsLymph,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch (taskInfo.TrialReadingCriterion.CriterionType)
|
switch (taskInfo.TrialReadingCriterion.CriterionType)
|
||||||
{
|
{
|
||||||
|
@ -2449,14 +2449,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
|
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync();
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync();
|
||||||
var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList();
|
var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList();
|
||||||
|
@ -3117,17 +3117,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
||||||
&& x.TaskState == TaskState.Effect)
|
&& x.TaskState == TaskState.Effect)
|
||||||
.Where(x => !cacheSkipIds.Contains(x.Id));
|
.Where(x => !cacheSkipIds.Contains(x.Id));
|
||||||
var count = await query.CountAsync();
|
|
||||||
if (count == 0)
|
//如果是随机阅片
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
|
||||||
}
|
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
var skipcount = 0;
|
var skipcount = 0;
|
||||||
if (count >= 2)
|
|
||||||
{
|
|
||||||
skipcount = random.Next(0, count - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
||||||
if (maxReadingTime != null)
|
if (maxReadingTime != null)
|
||||||
|
@ -3135,6 +3129,29 @@ namespace IRaCIS.Core.Application.Service
|
||||||
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
||||||
skipcount = 0;
|
skipcount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var minRandomOrder = query.Where(t => t.RandomOrder != null).Select(t => t.RandomOrder).MinOrDefault();
|
||||||
|
|
||||||
|
//阅片中的可能没序号,以阅片中优先先给IR
|
||||||
|
if (minRandomOrder != null && maxReadingTime == null)
|
||||||
|
{
|
||||||
|
query = query.Where(x => x.RandomOrder == minRandomOrder);
|
||||||
|
skipcount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var count = await query.CountAsync();
|
||||||
|
if (count >= 2)
|
||||||
|
{
|
||||||
|
skipcount = random.Next(0, count - 1);
|
||||||
|
}
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
task = await query
|
task = await query
|
||||||
.Select(x => new GetReadingTaskDto()
|
.Select(x => new GetReadingTaskDto()
|
||||||
{
|
{
|
||||||
|
@ -3235,7 +3252,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
||||||
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
||||||
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
||||||
task.IsShowStudyName= trialInfo.IsShowStudyName;
|
task.IsShowStudyName = trialInfo.IsShowStudyName;
|
||||||
task.IsBaseLine = isBaseLine;
|
task.IsBaseLine = isBaseLine;
|
||||||
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
|
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
|
||||||
task.ReadingToolList = criterionInfo.ReadingToolList;
|
task.ReadingToolList = criterionInfo.ReadingToolList;
|
||||||
|
@ -3351,7 +3368,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<bool> ResetReadingRestTime(Guid? userRoleId)
|
public async Task<bool> ResetReadingRestTime(Guid? userRoleId)
|
||||||
{
|
{
|
||||||
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid) userRoleId : _userInfo.UserRoleId;
|
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid)userRoleId : _userInfo.UserRoleId;
|
||||||
|
|
||||||
//int readingMinute = 120; // 为60整数
|
//int readingMinute = 120; // 为60整数
|
||||||
int restMinute = 10; //
|
int restMinute = 10; //
|
||||||
|
|
Loading…
Reference in New Issue