diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFAdvanceCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFAdvanceCalculateService.cs index 313d1bb00..06cec87ae 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFAdvanceCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFAdvanceCalculateService.cs @@ -408,7 +408,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestionList = rowInfo.Where(x=>x.TableQuestionList.Any(x=>x.QuestionMark== QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.Yes))).SelectMany(x => x.TableQuestionList).ToList(); - if (rowInfo.Any(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.AverageValue && x.Answer.IsNullOrEmpty()))) + if (rowInfo.Any(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.MRIPDFF && x.Answer.IsNullOrEmpty()))) { return string.Empty; } @@ -416,7 +416,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { return "NE"; } - result = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).Average(x => x.Answer.IsNullOrEmptyReturn0()); + result = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.MRIPDFF).Average(x => x.Answer.IsNullOrEmptyReturn0()); return decimal.Round(result, inDto.DigitPlaces, MidpointRounding.AwayFromZero).ToString("F" + inDto.DigitPlaces.ToString()); ; } @@ -517,18 +517,18 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { - //ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId); + 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 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.AverageValue && x.Answer.IsNotNullOrEmpty())).ToList(); + var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.MRIPDFF && x.Answer.IsNotNullOrEmpty())).ToList(); - //if (tableQuestionList.Count() != 4) - //{ - // throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]); - //} + if (tableQuestionList.Count() != 4) + { + throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]); + } var instanceCount = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.InstanceId != null).Select(x => x.InstanceId).Distinct().CountAsync(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs index 0b564dfd5..cbd2039a9 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs @@ -408,7 +408,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestionList = rowInfo.Where(x=>x.TableQuestionList.Any(x=>x.QuestionMark== QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.Yes))).SelectMany(x => x.TableQuestionList).ToList(); - if (rowInfo.Any(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.AverageValue && x.Answer.IsNullOrEmpty()))) + if (rowInfo.Any(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.MRIPDFF && x.Answer.IsNullOrEmpty()))) { return string.Empty; } @@ -416,7 +416,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { return "NE"; } - result = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).Average(x => x.Answer.IsNullOrEmptyReturn0()); + result = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.MRIPDFF).Average(x => x.Answer.IsNullOrEmptyReturn0()); return decimal.Round(result, inDto.DigitPlaces, MidpointRounding.AwayFromZero).ToString("F" + inDto.DigitPlaces.ToString()); ; } @@ -466,7 +466,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate 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.MRIPDFF).FirstOrDefault(); var avgAnswer = string.Empty; List questionMarks = new List() { @@ -522,7 +522,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate 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.AverageValue && x.Answer.IsNotNullOrEmpty())).ToList(); + var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.MRIPDFF && x.Answer.IsNotNullOrEmpty())).ToList(); if (tableQuestionList.Count() != 8) { diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 8899f8bd1..6b8592eb7 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -2514,7 +2514,7 @@ namespace IRaCIS.Core.Domain.Share /// /// 平均值 /// - AverageValue = 1104, + MRIPDFF = 1104, /// /// 是否可测量