修改获取下一个任务接口 增加标准处理
parent
249765d3fc
commit
8e570f2e85
|
@ -753,8 +753,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
[NotDefault]
|
|
||||||
public Guid TrialReadingCriterionId { get; set; }
|
public Guid? TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
public Guid? VisistTaskId { get; set; }
|
public Guid? VisistTaskId { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -778,6 +778,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public bool IsReadingShowPreviousResults { get; set; } = false;
|
public bool IsReadingShowPreviousResults { get; set; } = false;
|
||||||
|
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetReadingImgInDto
|
public class GetReadingImgInDto
|
||||||
|
|
|
@ -1227,6 +1227,13 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
GetReadingTaskDto? task = new GetReadingTaskDto();
|
GetReadingTaskDto? task = new GetReadingTaskDto();
|
||||||
|
|
||||||
|
var trialReadingCriterionId = inDto.TrialReadingCriterionId;
|
||||||
|
|
||||||
|
if(trialReadingCriterionId==null && inDto.VisistTaskId == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当没有任务Id的时候,标准Id必传");
|
||||||
|
}
|
||||||
|
|
||||||
if (inDto.VisistTaskId != null)
|
if (inDto.VisistTaskId != null)
|
||||||
{
|
{
|
||||||
task = await _visitTaskRepository.Where(x => x.Id == inDto.VisistTaskId).Select(x => new GetReadingTaskDto()
|
task = await _visitTaskRepository.Where(x => x.Id == inDto.VisistTaskId).Select(x => new GetReadingTaskDto()
|
||||||
|
@ -1237,9 +1244,12 @@ namespace IRaCIS.Application.Services
|
||||||
ReadingCategory = x.ReadingCategory,
|
ReadingCategory = x.ReadingCategory,
|
||||||
VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : default(Guid),
|
VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : default(Guid),
|
||||||
VisitNum = x.VisitTaskNum,
|
VisitNum = x.VisitTaskNum,
|
||||||
|
TrialReadingCriterionId=x.TrialReadingCriterionId,
|
||||||
|
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
trialReadingCriterionId = task.TrialReadingCriterionId;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (inDto.SubjectId != null)
|
else if (inDto.SubjectId != null)
|
||||||
{
|
{
|
||||||
|
@ -1273,7 +1283,7 @@ namespace IRaCIS.Application.Services
|
||||||
//}).OrderBy(x => x.VisitNum).ThenBy(x => x.ReadingCategory);
|
//}).OrderBy(x => x.VisitNum).ThenBy(x => x.ReadingCategory);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var subjectTaskList = await _visitTaskService.GetOrderReadingIQueryable(inDto.TrialId, inDto.TrialReadingCriterionId).Item2.ToListAsync();
|
var subjectTaskList = await _visitTaskService.GetOrderReadingIQueryable(inDto.TrialId, trialReadingCriterionId).Item2.ToListAsync();
|
||||||
|
|
||||||
var index = 0;
|
var index = 0;
|
||||||
subjectTaskList.ForEach(x =>
|
subjectTaskList.ForEach(x =>
|
||||||
|
@ -1299,7 +1309,8 @@ namespace IRaCIS.Application.Services
|
||||||
TaskBlindName = x.TaskBlindName,
|
TaskBlindName = x.TaskBlindName,
|
||||||
VisitNum = x.VisitNum,
|
VisitNum = x.VisitNum,
|
||||||
VisistId = x.VisistId ?? default(Guid),
|
VisistId = x.VisistId ?? default(Guid),
|
||||||
VisitTaskId = x.Id
|
VisitTaskId = x.Id,
|
||||||
|
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
||||||
}).FirstOrDefault();
|
}).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
|
@ -1307,7 +1318,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
task = await _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect).Select(x => new GetReadingTaskDto()
|
task = await _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId==trialReadingCriterionId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect).Select(x => new GetReadingTaskDto()
|
||||||
{
|
{
|
||||||
VisitTaskId = x.Id,
|
VisitTaskId = x.Id,
|
||||||
TaskBlindName = x.TaskBlindName,
|
TaskBlindName = x.TaskBlindName,
|
||||||
|
@ -1316,6 +1327,7 @@ namespace IRaCIS.Application.Services
|
||||||
VisitNum = x.VisitTaskNum,
|
VisitNum = x.VisitTaskNum,
|
||||||
SubjectId = x.SubjectId,
|
SubjectId = x.SubjectId,
|
||||||
SubjectCode = x.Subject.Code,
|
SubjectCode = x.Subject.Code,
|
||||||
|
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstOrDefaultAsync();
|
||||||
if (task == null)
|
if (task == null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue