修改一版
parent
61ee182bea
commit
a50c933abb
|
@ -36,6 +36,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public Guid? VisistTaskId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetConfirmCriterionInDto
|
public class GetConfirmCriterionInDto
|
||||||
|
|
|
@ -56,9 +56,23 @@ namespace IRaCIS.Application.Services
|
||||||
/// <param name="subjectId"></param>
|
/// <param name="subjectId"></param>
|
||||||
/// <param name="trialId"></param>
|
/// <param name="trialId"></param>
|
||||||
/// <returns></returns>
|
/// <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();
|
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)
|
if (subjectId != null)
|
||||||
{
|
{
|
||||||
task = await _visitTaskRepository.Where(x => x.TrialId == trialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.SubjectId == subjectId.Value).Select(x => new GetReadingTaskDto()
|
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]
|
[HttpPost]
|
||||||
public async Task<(List<NoneDicomStudyView>,object)> GetReadingImageFile(GetReadingImgInDto inDto)
|
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>();
|
List<Guid> visitIds = new List<Guid>();
|
||||||
if (task.ReadingCategory == ReadingCategory.Visit)
|
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());
|
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))
|
List<NoneDicomStudyView> result=await _noneDicomStudyRepository.Where(t => visitIds.Contains(t.SubjectVisitId))
|
||||||
|
|
||||||
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync();
|
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
return (result, new {
|
return (result, new {
|
||||||
VisitTaskId= task.VisistTaskId
|
VisitTaskId= task.VisistTaskId
|
||||||
});
|
});
|
||||||
|
@ -193,7 +201,7 @@ namespace IRaCIS.Application.Services
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[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();
|
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);
|
FindChildQuestion(x, qusetionList);
|
||||||
});
|
});
|
||||||
return (groupList, readingTaskState);
|
return (groupList, new
|
||||||
|
{
|
||||||
|
readingTaskState = readingTaskState
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -291,9 +302,5 @@ namespace IRaCIS.Application.Services
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue