验证提交
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ce608b8743
commit
7685439398
|
|
@ -826,6 +826,29 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
/// <returns></returns>
|
||||
public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||
{
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
|
||||
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.PatchDataStatistics && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
|
||||
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == question.Id)
|
||||
.Where(x => x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show).ToListAsync();
|
||||
|
||||
var rowinfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == question.Id).Include(x => x.ReadingQuestionTrial).OrderBy(x => x.RowIndex).ToListAsync();
|
||||
|
||||
var tableQuesionAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == question.Id).ToListAsync();
|
||||
|
||||
foreach (var item in rowinfoList)
|
||||
{
|
||||
foreach (var tq in tableQuestions)
|
||||
{
|
||||
var answer = tableQuesionAnswerList.Where(x => x.TableQuestionId == tq.Id && x.RowId == item.Id).FirstOrDefault();
|
||||
if (answer == null || answer.Answer.IsNullOrEmpty())
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["OCTTableRequired", item.ReadingQuestionTrial.OrderMark + item.RowIndex.GetLesionMark()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue