修改一版
parent
61ee182bea
commit
a50c933abb
|
@ -36,6 +36,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? VisistTaskId { get; set; }
|
||||
}
|
||||
|
||||
public class GetConfirmCriterionInDto
|
||||
|
|
|
@ -56,9 +56,23 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="subjectId"></param>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<GetReadingTaskDto> GetNextTaskId(Guid? subjectId,Guid trialId)
|
||||
private async Task<GetReadingTaskDto> GetNextTaskId(Guid? subjectId,Guid trialId,Guid? visistTaskId)
|
||||
{
|
||||
GetReadingTaskDto? task = new GetReadingTaskDto();
|
||||
|
||||
if (visistTaskId != null)
|
||||
{
|
||||
task = await _visitTaskRepository.Where(x => x.Id==visistTaskId).Select(x => new GetReadingTaskDto()
|
||||
{
|
||||
VisistTaskId = x.Id,
|
||||
ReadingCategory = x.ReadingCategory,
|
||||
VisistId = x.ReadingCategory == ReadingCategory.Visit ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId,
|
||||
VisitNum = x.ReadingCategory == ReadingCategory.Visit ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum
|
||||
}).FirstOrDefaultAsync();
|
||||
|
||||
task.SubjectId = await _subjectVisitRepository.Where(x => x.Id == task.VisistId).Select(x => x.SubjectId).FirstOrDefaultAsync();
|
||||
return task;
|
||||
}
|
||||
if (subjectId != null)
|
||||
{
|
||||
task = await _visitTaskRepository.Where(x => x.TrialId == trialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.SubjectId == subjectId.Value).Select(x => new GetReadingTaskDto()
|
||||
|
@ -109,7 +123,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<(List<NoneDicomStudyView>,object)> GetReadingImageFile(GetReadingImgInDto inDto)
|
||||
{
|
||||
var task=await GetNextTaskId(inDto.SubjectId, inDto.TrialId);
|
||||
var task=await GetNextTaskId(inDto.SubjectId, inDto.TrialId,inDto.VisistTaskId);
|
||||
List<Guid> visitIds = new List<Guid>();
|
||||
if (task.ReadingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
|
@ -120,14 +134,8 @@ namespace IRaCIS.Application.Services
|
|||
// 阅片期取前面所有的图像
|
||||
visitIds.AddRange(await _subjectVisitRepository.Where(x => x.VisitNum <= task.VisitNum && x.SubjectId == task.SubjectId).Select(x => x.Id).ToListAsync());
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<NoneDicomStudyView> result=await _noneDicomStudyRepository.Where(t => visitIds.Contains(t.SubjectVisitId))
|
||||
|
||||
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync();
|
||||
|
||||
|
||||
return (result, new {
|
||||
VisitTaskId= task.VisistTaskId
|
||||
});
|
||||
|
@ -193,7 +201,7 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<(List<GetTrialReadingQuestionOutDto>, TaskState)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
||||
public async Task<(List<GetTrialReadingQuestionOutDto>, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
||||
{
|
||||
|
||||
var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TaskState).FirstOrDefaultAsync();
|
||||
|
@ -225,7 +233,10 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
FindChildQuestion(x, qusetionList);
|
||||
});
|
||||
return (groupList, readingTaskState);
|
||||
return (groupList, new
|
||||
{
|
||||
readingTaskState = readingTaskState
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -291,9 +302,5 @@ namespace IRaCIS.Application.Services
|
|||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue