From b926519424590c3d19e0def3f96e75d9b3d1eb19 Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Tue, 17 Oct 2023 14:11:38 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../LuganoCalculateService.cs | 86 ++++++++++++++++++-
1 file changed, 83 insertions(+), 3 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs
index 95b9ad554..a94df81aa 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs
@@ -1707,6 +1707,83 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
#endregion
+ #region 获取脾脏状态
+
+ ///
+ /// 获取脾脏状态
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetSplenicState(Guid visitTaskId,decimal spleenLength)
+ {
+
+ ReadingCalculateDto inDto = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
+
+ if (inDto.IsBaseLine)
+ {
+ return SpleenAssessment.Stabilization.GetEnumInt();
+ }
+
+ var result = SpleenAssessment.Stabilization;
+
+
+ var presentSpd = spleenLength;
+ var baseLineSpleenLength = await GetBaseLineSpleenLength(inDto);
+
+ var baseLineTaskId = await GetBaseLineTaskId(inDto);
+ var baseLineState = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstOrDefaultAsync();
+
+
+ var differenceValue = presentSpd - baseLineSpleenLength;
+ decimal percentage = 0;
+ if (baseLineSpleenLength != 0)
+ {
+ percentage = differenceValue * 100 / baseLineSpleenLength;
+ }
+
+ // 1、基线 垂直径> 130 mm
+ //2、与基线相比脾垂直径变化值≥10 mm
+ //与基线相比脾肿大增加的百分比 > 50%
+ if (baseLineSpleenLength > 130 && differenceValue >= 10 && percentage > 50)
+ {
+ result = SpleenAssessment.Increase;
+ }
+ //1、基线垂直径≤130mm
+ //2、与基线相比脾垂直径变化值≥20 mm
+ //当前垂直径 > 130 mm
+ else if (baseLineSpleenLength <= 130 && differenceValue >= 20 && presentSpd > 130)
+ {
+ result = SpleenAssessment.Increase;
+ }
+ //1、基线 垂直径> 130 mm
+ //2、当前访视的前面访视中 存在垂直径≤130mm
+ //3、与最低点相比脾脏垂直径的增加值≥20 mm
+ //4、当前垂直径 > 130 mm
+ else if (baseLineSpleenLength > 130 && presentSpd <= 130 && differenceValue >= 20 && presentSpd > 130)
+ {
+ result = SpleenAssessment.Increase;
+ }
+ // 基线垂直径≤130mm
+ else if (baseLineSpleenLength <= 130)
+ {
+ result = SpleenAssessment.Normal;
+ }
+ //1、基线期 状态为“肿大”
+ //与基线相比脾肿大增加的百分比 > 50%
+ else if (baseLineState.EqEnum(SpleenState.Swelling) && percentage > 50)
+ {
+ result = SpleenAssessment.Remission;
+ }
+ else
+ {
+ result = SpleenAssessment.Remission;
+ }
+ return result.GetEnumInt();
+ }
+ #endregion
+
#region 获取脾脏评估
///
@@ -1717,7 +1794,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
public async Task GetSplenicEvaluation(ReadingCalculateDto inDto)
{
- return inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstIsNullReturnEmpty();
+ return inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstIsNullReturnEmpty();
//if (inDto.IsBaseLine)
//{
@@ -1731,14 +1808,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
//var baseLineSpleenLength = await GetBaseLineSpleenLength(inDto);
//var baseLineTaskId = await GetBaseLineTaskId(inDto);
- //var baseLineState= await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstOrDefaultAsync();
+ //var baseLineState = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstOrDefaultAsync();
//var differenceValue = presentSpd - baseLineSpleenLength;
//decimal percentage = 0;
//if (baseLineSpleenLength != 0)
//{
- // percentage = differenceValue*100 / baseLineSpleenLength;
+ // percentage = differenceValue * 100 / baseLineSpleenLength;
//}
//// 1、基线 垂直径> 130 mm
@@ -1779,9 +1856,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// result = SpleenAssessment.Remission;
//}
//return result.GetEnumInt();
+
+
}
#endregion
+
#region PET 5PS
///