Uat_Study
parent
49ac88399f
commit
1e990815b0
|
@ -25,6 +25,18 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public int Index { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class GetNextTaskInDto
|
||||
{
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
public Guid? VisistTaskId { get; set; }
|
||||
}
|
||||
|
||||
public class GetReadingTaskDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
|
|
@ -75,16 +75,16 @@ namespace IRaCIS.Application.Services
|
|||
/// <summary>
|
||||
/// 获取下一个阅片任务
|
||||
/// </summary>
|
||||
/// <param name="subjectId"></param>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<GetReadingTaskDto> GetNextTask(Guid? subjectId,Guid trialId,Guid? visistTaskId)
|
||||
[HttpPost]
|
||||
public async Task<GetReadingTaskDto> GetNextTask(GetNextTaskInDto inDto)
|
||||
{
|
||||
GetReadingTaskDto? task = new GetReadingTaskDto();
|
||||
|
||||
if (visistTaskId != null)
|
||||
if (inDto.VisistTaskId != null)
|
||||
{
|
||||
task = await _visitTaskRepository.Where(x => x.Id==visistTaskId).Select(x => new GetReadingTaskDto()
|
||||
task = await _visitTaskRepository.Where(x => x.Id== inDto.VisistTaskId).Select(x => new GetReadingTaskDto()
|
||||
{
|
||||
VisitTaskId = x.Id,
|
||||
TaskBlindName = x.TaskBlindName,
|
||||
|
@ -96,9 +96,9 @@ namespace IRaCIS.Application.Services
|
|||
}).FirstOrDefaultAsync();
|
||||
|
||||
}
|
||||
else if (subjectId != null)
|
||||
else if (inDto.SubjectId != null)
|
||||
{
|
||||
var subjectList =await _subjectRepository.Where(t => t.TrialId == trialId)
|
||||
var subjectList =await _subjectRepository.Where(t => t.TrialId == inDto.TrialId)
|
||||
.Where(t => t.SubjectDoctorList.Any(t => t.DoctorUserId == _userInfo.Id))
|
||||
.Select(s => new SubjectTask()
|
||||
{
|
||||
|
@ -113,10 +113,10 @@ namespace IRaCIS.Application.Services
|
|||
}).ToList();
|
||||
|
||||
|
||||
var subjectIndex = subjectList.Where(x => x.SubjectId == subjectId).Select(x=>x.Index).FirstOrDefault();
|
||||
var subjectIndex = subjectList.Where(x => x.SubjectId == inDto.SubjectId).Select(x=>x.Index).FirstOrDefault();
|
||||
var newSubjectId = subjectList.Where(x => x.Index >= subjectIndex && x.UnReadTaskCount != 0).Select(x=>x.SubjectId).FirstOrDefault();
|
||||
|
||||
var taskquery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.SubjectId == newSubjectId && x.DoctorUserId == _userInfo.Id).Select(x => new GetReadingTaskDto()
|
||||
var taskquery = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.SubjectId == newSubjectId && x.DoctorUserId == _userInfo.Id).Select(x => new GetReadingTaskDto()
|
||||
{
|
||||
VisitTaskId = x.Id,
|
||||
TaskBlindName=x.TaskBlindName,
|
||||
|
@ -130,13 +130,13 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
throw new BusinessValidationFailedException("任务都已经完成");
|
||||
}
|
||||
task.SubjectId = subjectId.Value;
|
||||
task.SubjectId = inDto.SubjectId.Value;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
task = await _visitTaskRepository.Where(x => x.TrialId == trialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.Id).Select(x => new GetReadingTaskDto()
|
||||
task = await _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.Id).Select(x => new GetReadingTaskDto()
|
||||
{
|
||||
VisitTaskId = x.Id,
|
||||
TaskBlindName = x.TaskBlindName,
|
||||
|
@ -163,12 +163,6 @@ namespace IRaCIS.Application.Services
|
|||
});
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
return task;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -179,7 +173,11 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<(List<NoneDicomStudyView>,object)> GetReadingImageFile(GetReadingImgInDto inDto)
|
||||
{
|
||||
var task=await GetNextTask(inDto.SubjectId, inDto.TrialId,inDto.VisistTaskId);
|
||||
var task=await GetNextTask( new GetNextTaskInDto() {
|
||||
TrialId=inDto.TrialId,
|
||||
SubjectId=inDto.SubjectId,
|
||||
VisistTaskId=inDto.VisistTaskId,
|
||||
});
|
||||
List<Guid> visitIds = new List<Guid>();
|
||||
if (task.ReadingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue