Uat_IRC_Net8
parent
2c818b9caa
commit
4403a09e79
|
@ -1,8 +1,10 @@
|
||||||
using DocumentFormat.OpenXml.EMMA;
|
using DocumentFormat.OpenXml.EMMA;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -620,7 +622,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
foreach (var item in questionInfo.TableRowInfoList)
|
foreach (var item in questionInfo.TableRowInfoList)
|
||||||
{
|
{
|
||||||
var avg = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).FirstOrDefault();
|
var avg = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).FirstOrDefault();
|
||||||
var avgAnswer = string.Empty;
|
var avgAnswer = "NA";
|
||||||
List<QuestionMark?> questionMarks = new List<QuestionMark?>()
|
List<QuestionMark?> questionMarks = new List<QuestionMark?>()
|
||||||
{
|
{
|
||||||
QuestionMark.FirstMeasurement,
|
QuestionMark.FirstMeasurement,
|
||||||
|
@ -666,6 +668,30 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||||
{
|
{
|
||||||
|
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
|
|
||||||
|
|
||||||
|
var markList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
||||||
|
var rowInfo = readingData.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction)
|
||||||
|
.SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
|
|
||||||
|
var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.IsNotNullOrEmpty())).ToList();
|
||||||
|
|
||||||
|
if (tableQuestionList.Count() != 8)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var notableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.No))).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in notableQuestionList)
|
||||||
|
{
|
||||||
|
if (markList.Any(x => x.RowId == item.RowId))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_NeedClearMark"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue