修改一版

Uat_Study
he 2022-09-21 16:34:33 +08:00
parent d2e6094f8b
commit 6adb0ccd83
4 changed files with 34 additions and 7 deletions

View File

@ -1230,6 +1230,11 @@
非淋巴结靶病灶长径之和 decimal 非淋巴结靶病灶长径之和 decimal
</summary> </summary>
</member> </member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TargetLesionCalculateDto.SODPercent">
<summary>
SOD变化百分比
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TargetLesionCalculateDto.DiameterLessThan10"> <member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TargetLesionCalculateDto.DiameterLessThan10">
<summary> <summary>
所有淋巴结靶病灶的短径小于10mm 所有淋巴结靶病灶的短径小于10mm

View File

@ -23,6 +23,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary> /// </summary>
public decimal SumOfDiameter { get; set; } public decimal SumOfDiameter { get; set; }
/// <summary>
/// SOD变化百分比
/// </summary>
public decimal SODPercent { get; set; }
/// <summary> /// <summary>
/// 所有淋巴结靶病灶的短径小于10mm /// 所有淋巴结靶病灶的短径小于10mm
/// </summary> /// </summary>

View File

@ -591,7 +591,7 @@ namespace IRaCIS.Core.Application.Service
{ {
if (inDto.IsBaseLine) if (inDto.IsBaseLine)
{ {
return nameof(YesOrNoOrNa.NA); return YesOrNoOrNa.NA.GetEnumInt();
} }
var LastVisitTaskId = await this.GetLastVisitTaskId(inDto); var LastVisitTaskId = await this.GetLastVisitTaskId(inDto);
@ -615,7 +615,7 @@ namespace IRaCIS.Core.Application.Service
} }
} }
return isExists? nameof(YesOrNoOrNa.Yes) : nameof(YesOrNoOrNa.No); return isExists? YesOrNoOrNa.Yes.GetEnumInt() : YesOrNoOrNa.No.GetEnumInt();
} }
#endregion #endregion
@ -659,7 +659,7 @@ namespace IRaCIS.Core.Application.Service
var newLesions = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesions).Select(x => x.Answer).FirstOrDefault(); var newLesions = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesions).Select(x => x.Answer).FirstOrDefault();
var result = await _tumorAssessmentRepository.Where(x => x.TargetLesion.GetEnumInt() == targetLesion && x.NonTargetLesions.GetEnumInt() == noTargetLesion && x.NewLesion.GetEnumInt() == newLesions).Select(x => x.OverallEfficacy).ToListAsync(); var result = await _tumorAssessmentRepository.Where(x => x.TargetLesion.GetEnumInt() == targetLesion && x.NonTargetLesions.GetEnumInt() == noTargetLesion && x.NewLesion.GetEnumInt() == newLesions).Select(x => x.OverallEfficacy).ToListAsync();
return result.Count == 0 ? string.Empty : result[0].GetEnumInt(); return result.Count == 0 ? OverallAssessment.NA.GetEnumInt() : result[0].GetEnumInt();
} }
#endregion #endregion
@ -860,6 +860,9 @@ namespace IRaCIS.Core.Application.Service
//所有淋巴结靶病灶的短径小于10mm bool //所有淋巴结靶病灶的短径小于10mm bool
DiameterLessThan10 = true, DiameterLessThan10 = true,
// SOD变化百分比
SODPercent = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SODPercent).Sum(x => x.Answer.IsNullOrEmptyReturn0()),
// SOD 百分比与基线期SOD相比减小≥30% bool // SOD 百分比与基线期SOD相比减小≥30% bool
SODPercentBigger30 = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SODPercent).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= (decimal)0.3, SODPercentBigger30 = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SODPercent).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= (decimal)0.3,
@ -959,7 +962,7 @@ namespace IRaCIS.Core.Application.Service
result = TargetAssessment.NE; result = TargetAssessment.NE;
} }
else if (!resultData.ExixtsNETargetLesion) else if (!resultData.ExixtsNETargetLesion&& resultData.SumOfDiameter==0&& resultData.SODPercent == 0)
{ {
result = TargetAssessment.ND; result = TargetAssessment.ND;
} }

View File

@ -2011,13 +2011,27 @@ namespace IRaCIS.Application.Services
throw new BusinessValidationFailedException($"相同问题传入两次!"); throw new BusinessValidationFailedException($"相同问题传入两次!");
} }
var questions = await _readingTableQuestionTrialRepository.Where(x => tableQuestionIds.Contains(x.Id) && x.MaxRowCount != null && x.MaxRowCount != 0).ToListAsync(); var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
if (questionInfo.MaxQuestionCount!=null)
{
if (questionInfo.MaxQuestionCount <
(
(await _readingTableAnswerRowInfoRepository.Where(x => x.RowIndex != inDto.RowIndex && ((x.RowIndex % 1) == 0) && x.VisitTaskId == inDto.VisitTaskId
&& x.QuestionId == inDto.QuestionId
).CountAsync()) + 1))
{
throw new BusinessValidationFailedException($"当前提交问题最大问题数为{questionInfo.MaxQuestionCount}");
}
}
foreach (var item in questions)
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => tableQuestionIds.Contains(x.Id) && x.MaxRowCount != null && x.MaxRowCount != 0).ToListAsync();
foreach (var item in tableQuestions)
{ {
var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault(); var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault();
var rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync(); var 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) if (rowCount > item.MaxRowCount.Value - 1)
{ {