修改一版
parent
cf70afda15
commit
c4cbe5cfe6
|
@ -374,6 +374,69 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (generateTaskCommand.ReadingCategory == ReadingCategory.Oncology)
|
||||||
|
{
|
||||||
|
if (trialConfig.ReadingType == ReadingMethod.Double)
|
||||||
|
{
|
||||||
|
foreach (var item in generateTaskCommand.ReadingGenerataTaskList)
|
||||||
|
{
|
||||||
|
//每个访视 根据项目配置生成任务 双审生成两个
|
||||||
|
var task1 = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
|
{
|
||||||
|
TrialId = trialId,
|
||||||
|
SubjectId = item.SubjectId,
|
||||||
|
IsUrgent = item.IsUrgent,
|
||||||
|
TaskName = item.ReadingName,
|
||||||
|
ArmEnum = Arm.DoubleReadingArm1,//特殊
|
||||||
|
Code = currentMaxCodeInt + 1,
|
||||||
|
SouceReadModuleId = item.ReadModuleId,
|
||||||
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||||
|
ReadingCategory = ReadingCategory.Oncology
|
||||||
|
});
|
||||||
|
var task2 = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
|
{
|
||||||
|
TrialId = trialId,
|
||||||
|
SubjectId = item.SubjectId,
|
||||||
|
IsUrgent = item.IsUrgent,
|
||||||
|
TaskName = item.ReadingName,
|
||||||
|
ArmEnum = Arm.DoubleReadingArm2,//特殊
|
||||||
|
Code = currentMaxCodeInt + 2,
|
||||||
|
SouceReadModuleId = item.ReadModuleId,
|
||||||
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 2, nameof(VisitTask)),
|
||||||
|
ReadingCategory = ReadingCategory.Oncology
|
||||||
|
});
|
||||||
|
currentMaxCodeInt = currentMaxCodeInt + 2;
|
||||||
|
_provider.Set<int>($"{trialId }_{ StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt + 2, TimeSpan.FromMinutes(30));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var item in generateTaskCommand.ReadingGenerataTaskList)
|
||||||
|
{
|
||||||
|
var singleTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
|
{
|
||||||
|
TrialId = trialId,
|
||||||
|
SubjectId = item.SubjectId,
|
||||||
|
IsUrgent = item.IsUrgent,
|
||||||
|
TaskName = item.ReadingName,
|
||||||
|
ArmEnum = Arm.SingleReadingArm, //特殊
|
||||||
|
Code = currentMaxCodeInt + 1,
|
||||||
|
SouceReadModuleId = item.ReadModuleId,
|
||||||
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||||
|
ReadingCategory = ReadingCategory.Oncology
|
||||||
|
});
|
||||||
|
|
||||||
|
singleTask.AllocateTime = DateTime.Now;
|
||||||
|
|
||||||
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
|
_provider.Set<int>($"{trialId }_{ StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt + 1, TimeSpan.FromMinutes(30));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,6 @@ namespace IRaCIS.Application.Services
|
||||||
await this.TriggerJudgeQuestionNew(inDto.VisitTaskId);
|
await this.TriggerJudgeQuestionNew(inDto.VisitTaskId);
|
||||||
// 添加阅片期任务
|
// 添加阅片期任务
|
||||||
await this.AddReadingTask(inDto.VisitTaskId);
|
await this.AddReadingTask(inDto.VisitTaskId);
|
||||||
|
|
||||||
// 完成阅片修改状态
|
// 完成阅片修改状态
|
||||||
await this.FinishReadUpdateState(inDto.VisitTaskId);
|
await this.FinishReadUpdateState(inDto.VisitTaskId);
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
|
@ -329,7 +328,6 @@ namespace IRaCIS.Application.Services
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstOrDefaultAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstOrDefaultAsync();
|
||||||
if (!await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.ReadingTaskState != ReadingTaskState.HaveSigned))
|
if (!await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.ReadingTaskState != ReadingTaskState.HaveSigned))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (taskInfo.SouceReadModuleId != null)
|
if (taskInfo.SouceReadModuleId != null)
|
||||||
{
|
{
|
||||||
await _readModuleRepository.UpdatePartialFromQueryAsync(taskInfo.SouceReadModuleId.Value, x => new ReadModule
|
await _readModuleRepository.UpdatePartialFromQueryAsync(taskInfo.SouceReadModuleId.Value, x => new ReadModule
|
||||||
|
@ -344,7 +342,6 @@ namespace IRaCIS.Application.Services
|
||||||
ReadingStatus = ReadingStatusEnum.ReadCompleted
|
ReadingStatus = ReadingStatusEnum.ReadCompleted
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await _subjectVisitRepository.SaveChangesAsync();
|
await _subjectVisitRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,6 +405,13 @@ namespace IRaCIS.Application.Services
|
||||||
ReadingCategory = typeChange[x.ModuleType],
|
ReadingCategory = typeChange[x.ModuleType],
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList();
|
needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList();
|
||||||
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
|
{
|
||||||
|
|
||||||
|
ReadingCategory = ReadingCategory.Oncology,
|
||||||
|
TrialId = taskInfo.TrialId,
|
||||||
|
ReadingGenerataTaskList = needReadList
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue