diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index 087d4489d..65c97ebd4 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -617,7 +617,55 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { - + var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null) + && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State + ) + .Select(x => new + { + x.ReadingQuestionTrial.OrderMark, + x.RowIndex, + QuestionMark = x.ReadingTableQuestionTrial.QuestionMark, + Answer = x.Answer, + + }).ToListAsync(); + + + string errorMassage = string.Empty; + + //var rowAnswerList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.MeasureData == string.Empty || x.MeasureData == null)) + // .Select(x => new + // { + // x.ReadingQuestionTrial.OrderMark, + // x.RowIndex, + // x.Id, + // }).ToListAsync(); + + + //var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.Answer == TargetState.UnableEvaluate.GetEnumInt() + // && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State + //) + // .Select(x => x.RowId).Distinct().ToListAsync(); + + + //IEnumerable measureDataList = rowAnswerList.Where(x => !unableEvaluateRowIds.Contains(x.Id)).Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList(); + + + //if (measureDataList.Count() > 0) + //{ + // errorMassage += $" 病灶{ string.Join(',', measureDataList)}不存在标记,"; + //} + + + if (tableAnswerList.Count > 0) + { + errorMassage += $" 病灶{ string.Join(',', tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()))}状态为空,"; + } + + + if (errorMassage != string.Empty) + { + throw new BusinessValidationFailedException(errorMassage); + } } } }