Test.EIImageViewer
parent
b28ef3b82e
commit
8e22284833
|
@ -1290,42 +1290,80 @@ namespace IRaCIS.Application.Services
|
|||
QuestionMark.Organ,
|
||||
|
||||
};
|
||||
|
||||
Dictionary<CriterionType, string> errorMsgDic = new Dictionary<CriterionType, string>()
|
||||
{
|
||||
{CriterionType.RECIST1Pointt1, _localizer["ReadingImage_Maxlesion", item.MaxRowCount.Value]},
|
||||
};
|
||||
string msg = string.Empty;
|
||||
foreach (var item in tableQuestions)
|
||||
{
|
||||
var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault();
|
||||
if (!answer.IsNullOrEmpty())
|
||||
{
|
||||
var rowCount = 0;
|
||||
if (questionMarks.Contains(item.QuestionMark))
|
||||
if ((item.QuestionMark == QuestionMark.Part|| item.QuestionMark == QuestionMark.Organ) &&inDto.OrganInfoId!=null)
|
||||
{
|
||||
rowCount = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && ((x.RowIndex % 1) == 0) && x.OrganInfoId == inDto.OrganInfoId && x.OrganInfoId != null && x.RowIndex != inDto.RowIndex).CountAsync();
|
||||
var organIds= await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && ((x.RowIndex % 1) == 0) && x.OrganInfoId != null && x.RowIndex != inDto.RowIndex).Select(x=>x.OrganInfoId).ToListAsync();
|
||||
organIds.Add(inDto.OrganInfoId);
|
||||
|
||||
var orginInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||
|
||||
if (item.QuestionMark == QuestionMark.Part)
|
||||
{
|
||||
rowCount = orginInfos.Select(x => x.Part).Distinct().Count();
|
||||
}
|
||||
else
|
||||
{
|
||||
rowCount = orginInfos.Select(x => x.TULOC).Distinct().Count();
|
||||
}
|
||||
|
||||
if (rowCount > item.MaxRowCount.Value)
|
||||
{
|
||||
if (rowCount > item.MaxRowCount.Value )
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
msg = errorMsgDic[criterionInfo.CriterionType];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
msg = _localizer["ReadingImage_Maximum", item.QuestionName.LanguageName(item.QuestionEnName, _userInfo.IsEn_Us), item.MaxRowCount.Value, item.MaxRowCount.Value];
|
||||
}
|
||||
|
||||
throw new BusinessValidationFailedException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && ((x.RowIndex % 1) == 0) && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync();
|
||||
|
||||
if (rowCount > item.MaxRowCount.Value - 1)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
msg = errorMsgDic[criterionInfo.CriterionType];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
msg = _localizer["ReadingImage_Maximum", item.QuestionName.LanguageName(item.QuestionEnName, _userInfo.IsEn_Us), item.MaxRowCount.Value, rowCount];
|
||||
}
|
||||
|
||||
throw new BusinessValidationFailedException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (rowCount > item.MaxRowCount.Value - 1)
|
||||
{
|
||||
|
||||
Dictionary<CriterionType, string> errorMsgDic = new Dictionary<CriterionType, string>()
|
||||
{
|
||||
{CriterionType.RECIST1Pointt1, _localizer["ReadingImage_Maxlesion", item.MaxRowCount.Value]},
|
||||
};
|
||||
string msg = string.Empty;
|
||||
try
|
||||
{
|
||||
msg = errorMsgDic[criterionInfo.CriterionType];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
msg = _localizer["ReadingImage_Maximum", item.QuestionName.LanguageName(item.QuestionEnName, _userInfo.IsEn_Us), item.MaxRowCount.Value, rowCount] ;
|
||||
}
|
||||
|
||||
throw new BusinessValidationFailedException(msg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue