diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs index c12bb24a3..12dae0094 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs @@ -747,6 +747,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate RowIndex = maxnum, TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.ElasticAreaDiffValue).Select(x => x.Id).FirstOrDefault(), }); + + + // 添加其他问题答案 + foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId))) + { + tableAnswers.Add(new ReadingTableQuestionAnswer() + { + Answer = string.Empty, + QuestionId = questionInfo.Id, + TrialId = taskinfo.TrialId, + VisitTaskId = taskinfo.Id, + RowId = newRowId, + RowIndex = maxnum, + TableQuestionId = otherQuestion.Id, + }); + } } @@ -929,6 +945,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate RowIndex = item, TableQuestionId = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.EEMSubtractLumenSum).Select(x => x.Id).FirstOrDefault(), }); + + // 添加其他问题答案 + foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId))) + { + tableAnswers.Add(new ReadingTableQuestionAnswer() + { + Answer = string.Empty, + QuestionId = questionInfo!.QuestionId, + TrialId = inDto.TrialId, + VisitTaskId = inDto.VisitTaskId, + RowId = newRowId, + RowIndex = item, + TableQuestionId = otherQuestion.Id, + }); + } } await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => (x.QuestionId == questionInfo.QuestionId || x.QuestionId == pAVquestionInfo.QuestionId) && x.VisitTaskId == inDto.VisitTaskId); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs index 7bb426e10..73f1e9b0e 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs @@ -609,6 +609,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate RowIndex = maxnum, TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Id).FirstOrDefault(), }); + + + // 添加其他问题答案 + foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId))) + { + tableAnswers.Add(new ReadingTableQuestionAnswer() + { + Answer = string.Empty, + QuestionId = questionInfo.Id, + TrialId = taskinfo.TrialId, + VisitTaskId = taskinfo.Id, + RowId = newRowId, + RowIndex = maxnum, + TableQuestionId = otherQuestion.Id, + }); + } + } await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id); await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id); @@ -768,7 +785,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate RowId = newRowId, RowIndex = maxnum, TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(), - }); + }); + + // 添加其他问题答案 + foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId))) + { + tableAnswers.Add(new ReadingTableQuestionAnswer() + { + Answer = string.Empty, + QuestionId = questionInfo.Id, + TrialId = taskinfo.TrialId, + VisitTaskId = taskinfo.Id, + RowId = newRowId, + RowIndex = maxnum, + TableQuestionId = otherQuestion.Id, + }); + } } await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id); await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id); @@ -1070,6 +1102,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }); + // 添加其他问题答案 + foreach (var otherQuestion in patchDataTableQuestion.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId))) + { + tableAnswers.Add(new ReadingTableQuestionAnswer() + { + Answer = string.Empty, + QuestionId = patchDataStatisticsInfo.Id, + TrialId = inDto.TrialId, + VisitTaskId = inDto.VisitTaskId, + RowId = newRowId, + RowIndex = item, + TableQuestionId = otherQuestion.Id, + }); + } + + } await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x =>x.QuestionId== patchDataStatisticsInfo.Id && x.VisitTaskId == inDto.VisitTaskId); await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == patchDataStatisticsInfo.Id && x.VisitTaskId == inDto.VisitTaskId);