Merge branch 'Test.IRC' of http://192.168.3.69:2000/XCKJ/irc-netcore-api into Test.IRC

IRC_NewDev
hang 2023-11-08 10:19:14 +08:00
commit 66682260a0
4 changed files with 23 additions and 39 deletions

View File

@ -1816,8 +1816,6 @@ namespace IRaCIS.Application.Services
{ {
var tablequestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId && x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions).ToListAsync(); var tablequestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId && x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions).ToListAsync();
// 判断表格问题是否为空 // 判断表格问题是否为空
if (tablequestionList.Count > 0) if (tablequestionList.Count > 0)
{ {

View File

@ -635,26 +635,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ImageQualityAssessment && x.VisitTaskId == inDto.VisitTaskId && x.Answer == ImageQualityEvaluation.Abnormal.GetEnumInt())) if (await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ImageQualityAssessment && x.VisitTaskId == inDto.VisitTaskId && x.Answer == ImageQualityEvaluation.Abnormal.GetEnumInt()))
{ {
//影像质量不正常 验证
return; return;
} }
var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null) var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null)
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State)
)
.Select(x => new .Select(x => new
{ {
x.ReadingQuestionTrial.OrderMark, x.ReadingQuestionTrial.OrderMark,
x.RowIndex, x.RowIndex,
QuestionMark = x.ReadingTableQuestionTrial.QuestionMark, x.ReadingTableQuestionTrial.QuestionMark,
Answer = x.Answer, x.Answer,
}).ToListAsync(); }).ToListAsync();
// 错误信息
string errorMassage = string.Empty; string errorMassage = string.Empty;
var rowAnswerList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.MeasureData == string.Empty || x.MeasureData == null)) var rowAnswerList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.MeasureData == string.Empty || x.MeasureData == null))
.Select(x => new .Select(x => new
{ {
@ -662,37 +658,32 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
x.RowIndex, x.RowIndex,
x.Id, x.Id,
}).ToListAsync(); }).ToListAsync();
var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.Answer == TargetState.UnableEvaluate.GetEnumInt() var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.Answer == TargetState.UnableEvaluate.GetEnumInt()
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State)
)
.Select(x => x.RowId).Distinct().ToListAsync(); .Select(x => x.RowId).Distinct().ToListAsync();
List<string> measureDataList = rowAnswerList.Where(x => !unableEvaluateRowIds.Contains(x.Id)).Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList(); List<string> measureDataList = rowAnswerList.Where(x => !unableEvaluateRowIds.Contains(x.Id)).Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList(); List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList(); List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
// 取差
measureDataList = measureDataList.Except(allExists).ToList(); measureDataList = measureDataList.Except(allExists).ToList();
stateIsNullList = stateIsNullList.Except(allExists).ToList(); stateIsNullList = stateIsNullList.Except(allExists).ToList();
if (measureDataList.Count() > 0) if (measureDataList.Count() > 0)
{ {
// 无标记
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ","; errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
} }
if (tableAnswerList.Count > 0) if (tableAnswerList.Count > 0)
{ {
// 状态为空
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ","; errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
} }
if (allExists.Count > 0) if (allExists.Count > 0)
{ {
// 未做标记且状态为空
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', stateIsNullList)] + ","; errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', stateIsNullList)] + ",";
} }
@ -702,8 +693,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
errorMassage = _localizer["ReadingCalculate_Questionable"] + errorMassage; errorMassage = _localizer["ReadingCalculate_Questionable"] + errorMassage;
throw new BusinessValidationFailedException(errorMassage); throw new BusinessValidationFailedException(errorMassage);
} }
} }

View File

@ -925,9 +925,6 @@ namespace IRaCIS.Core.Application
_mapper.Map(trialConfig, trialInfo); _mapper.Map(trialConfig, trialInfo);
trialInfo.UpdateTime = DateTime.Now; trialInfo.UpdateTime = DateTime.Now;
return ResponseOutput.Ok(await _repository.SaveChangesAsync()); return ResponseOutput.Ok(await _repository.SaveChangesAsync());
} }