Uat_Study
he 2022-07-20 10:34:16 +08:00
parent 88bdeff571
commit 9ae1cb5fe1
3 changed files with 215 additions and 158 deletions

View File

@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
{
public Guid? QuestionId { get; set; }
public Guid visitTaskId { get; set; }
public Guid VisitTaskId { get; set; }
public string Answer { get; set; }
}

View File

@ -78,6 +78,7 @@ namespace IRaCIS.Application.Services
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
}
#region 全局阅片相关
/// <summary>
/// 获取全局阅片历史记录
/// </summary>
@ -115,7 +116,7 @@ namespace IRaCIS.Application.Services
QuestionId = x.QuestionId,
SubjectId = inDto.SubjectId,
GlobalTaskId = inDto.GlobalTaskId,
TaskId=x.visitTaskId,
TaskId = x.VisitTaskId,
TrialId = inDto.TrialId,
}).ToList());
@ -138,7 +139,8 @@ namespace IRaCIS.Application.Services
{
throw new BusinessValidationFailedException("当前任务不是全局阅片任务");
}
GetGlobalReadingInfoOutDto result = new GetGlobalReadingInfoOutDto() {
GetGlobalReadingInfoOutDto result = new GetGlobalReadingInfoOutDto()
{
GlobalTaskId = inDto.VisitTaskId,
};
@ -195,8 +197,9 @@ namespace IRaCIS.Application.Services
return result;
}
#endregion
#region 获取下一个阅片任务
/// <summary>
/// 获取下一个阅片任务
/// </summary>
@ -289,7 +292,9 @@ namespace IRaCIS.Application.Services
await _visitTaskRepository.SaveChangesAsync();
return task;
}
#endregion
#region 获取阅片非Dicom文件
/// <summary>
/// 获取阅片非Dicom文件
/// </summary>
@ -298,7 +303,8 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<(List<NoneDicomStudyView>, object)> GetReadingImageFile(GetReadingImgInDto inDto)
{
var task=await GetNextTask( new GetNextTaskInDto() {
var task = await GetNextTask(new GetNextTaskInDto()
{
TrialId = inDto.TrialId,
SubjectId = inDto.SubjectId,
VisistTaskId = inDto.VisistTaskId,
@ -341,7 +347,8 @@ namespace IRaCIS.Application.Services
return (result, new {
return (result, new
{
VisitTaskId = task.VisitTaskId,
SubjectId = task.SubjectId,
SubjectCode = task.SubjectCode,
@ -352,7 +359,9 @@ namespace IRaCIS.Application.Services
IsExistsClinicalData = isExistsClinicalData,
});
}
#endregion
#region 获取项目已确认的标准
/// <summary>
/// 获取项目已确认的标准
/// </summary>
@ -369,6 +378,9 @@ namespace IRaCIS.Application.Services
}).ToListAsync();
return result;
}
#endregion
#region 配置裁判问题相关
/// <summary>
/// 获取项目标准的裁判问题
@ -422,7 +434,9 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(result);
}
#endregion
#region 获取项目的阅片问题
/// <summary>
/// 获取项目的阅片问题
/// </summary>
@ -540,7 +554,9 @@ namespace IRaCIS.Application.Services
}); ;
}
#endregion
#region 获取阅片任务和答案
/// <summary>
/// 获取阅片任务和答案
/// </summary>
@ -573,7 +589,9 @@ namespace IRaCIS.Application.Services
return groupList;
}
#endregion
#region 获取裁判阅片任务信息
/// <summary>
/// 获取裁判阅片任务信息
/// </summary>
@ -607,7 +625,8 @@ namespace IRaCIS.Application.Services
judgeInfo.VisitTaskInfoList.Add(
new JudgeReadingInfoDto()
{
JudgeQuestionAnswerInfoList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == item.Id&&x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo {
JudgeQuestionAnswerInfoList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == item.Id && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
{
Answer = x.Answer,
QuestionName = x.ReadingQuestionTrial.QuestionName,
}).ToListAsync(),
@ -618,7 +637,9 @@ namespace IRaCIS.Application.Services
}
return judgeInfo;
}
#endregion
#region 保存裁判问题
/// <summary>
/// 保存裁判问题
/// </summary>
@ -637,27 +658,9 @@ namespace IRaCIS.Application.Services
var result = await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result);
}
#endregion
/// <summary>
/// 提交裁判问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[NonDynamicMethod]
public async Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto)
{
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
{
JudgeResultTaskId = inDto.JudgeResultTaskId,
ReadingTaskState = ReadingTaskState.HaveSigned,
JudgeResultRemark = inDto.JudgeResultRemark,
SignTime = DateTime.Now,
JudgeResultImagePath=inDto.JudgeResultImagePath,
});
var result = await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result);
}
#region 获取既往结果
/// <summary>
/// 获取既往结果
/// </summary>
@ -669,7 +672,9 @@ namespace IRaCIS.Application.Services
&& x.Id != inDto.VisitTaskId && x.ReadingTaskState == ReadingTaskState.HaveSigned).ProjectTo<GetReadingPastResultListOutDto>(_mapper.ConfigurationProvider).ToListAsync();
return readingPastResultList;
}
#endregion
#region 找子问题
/// <summary>
/// 找子问题
/// </summary>
@ -687,7 +692,9 @@ namespace IRaCIS.Application.Services
});
}
}
#endregion
#region 保存任务问题
/// <summary>
/// 保存任务问题
/// </summary>
@ -718,11 +725,13 @@ namespace IRaCIS.Application.Services
var result = await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result);
}
#endregion
#region 提交问题
/// <summary>
/// 提交问题
/// 提交访视阅片问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
@ -735,6 +744,7 @@ namespace IRaCIS.Application.Services
ReadingTaskState = ReadingTaskState.HaveSigned,
SignTime = DateTime.Now,
});
var result = await _visitTaskRepository.SaveChangesAsync();
// 触裁判任务
await this.TriggerJudgeQuestion(inDto.VisitTaskId);
@ -745,6 +755,53 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(result);
}
/// <summary>
/// 提交裁判问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[NonDynamicMethod]
public async Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto)
{
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
{
JudgeResultTaskId = inDto.JudgeResultTaskId,
ReadingTaskState = ReadingTaskState.HaveSigned,
JudgeResultRemark = inDto.JudgeResultRemark,
SignTime = DateTime.Now,
JudgeResultImagePath = inDto.JudgeResultImagePath,
});
var result = await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result);
}
/// <summary>
/// 提交全局阅片结果
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[NonDynamicMethod]
public async Task<IResponseOutput> SubmitGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
{
var result = await this.SaveGlobalReadingInfo(inDto);
return result;
}
//public async Task<IResponseOutput> SubmitTaskChangeState()
//{
//}
#endregion
/// <summary>
/// 完成阅片修改状态
/// </summary>

View File

@ -267,7 +267,7 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<List<GetReadingVisitListOutDto>> GetReadingVisitList(GetReadingVisitListInDto inDto)
{
var maxVisitNum = await _readingPeriodSetRepository.Where(x => x.TrialId == inDto.TrialId && x.ReadingSetType == inDto.ReadingSetType&&(x.IsTakeEffect== ReadingPeriodStatus.TakeEffect||x.IsTakeEffect==ReadingPeriodStatus.Revocation)).MaxAsync(x => x.ExpirationVisitNum)??0;
var maxVisitNum = await _readingPeriodSetRepository.Where(x => x.TrialId == inDto.TrialId && x.ReadingSetType == inDto.ReadingSetType&&x.IsTakeEffect== ReadingPeriodStatus.TakeEffect).MaxAsync(x => x.ExpirationVisitNum)??0;
var thisVisitNum = await _readingPeriodSetRepository.Where(x => x.Id == inDto.ReadingPeriodSetId).Select(x => x.ExpirationVisitNum).FirstOrDefaultAsync() ?? -1;
List <GetReadingVisitListOutDto> result = await _visitStageRepository.Where(x => x.TrialId == inDto.TrialId ).Where(x=>x.VisitNum== thisVisitNum || x.VisitNum >= maxVisitNum).Select(x => new GetReadingVisitListOutDto()
{