diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 7add36e94..7e4d51382 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -882,6 +882,26 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if(targetQuestion!=null) { // 找到状态问题 + var stateQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.State).FirstOrDefaultAsync(); + if (stateQuestion != null) + { + var state =await _readingTableQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId&&x.RowIndex== (int)Math.Floor(inDto.RowNumber)&&x.TableQuestionId== stateQuestion.Id).Select(x=>x.Answer).FirstOrDefaultAsync(); + + // 找到ppd问题 + var ppdQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.PPD).FirstOrDefaultAsync(); + + if(ppdQuestion!=null) + { + var ppdAnswerList= await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == stateQuestion.Id) + .Where(x=> x.RowIndex >= (int)Math.Floor(inDto.RowNumber) && x.RowIndex< ((int)Math.Floor(inDto.RowNumber)+1)) + .Select(x => x.Answer).ToListAsync(); + + var allPPd = ppdAnswerList.Select(x => x.IsNullOrEmptyReturn0()).Sum(); + + + + } + } }