Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
267d0494d3
|
@ -2586,34 +2586,34 @@ namespace IRaCIS.Application.Services
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#region 两小时
|
#region 两小时
|
||||||
//var cacheDate = DateTime.Parse(value.ToString());
|
var cacheDate = DateTime.Parse(value.ToString());
|
||||||
//int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||||
//if (timespanMin > 120 && timespanMin < 130)
|
if (timespanMin > 120 && timespanMin < 130)
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 20]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 10]);
|
||||||
//}
|
}
|
||||||
//else if (timespanMin > 130)
|
else if (timespanMin > 130)
|
||||||
//{
|
{
|
||||||
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 130))) * 130);
|
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 130))) * 130);
|
||||||
// _provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
_provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
// // _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
//}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 测试用的5分钟
|
#region 测试用的5分钟
|
||||||
var cacheDate = DateTime.Parse(value.ToString());
|
//var cacheDate = DateTime.Parse(value.ToString());
|
||||||
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
//int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||||
if (timespanMin >= 1 && timespanMin <= 100)
|
//if (timespanMin >= 5 && timespanMin <= 10)
|
||||||
{
|
//{
|
||||||
throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
// throw new BusinessValidationFailedException("您已连续阅片2个小时,请休息20分钟后,再继续阅片。");
|
||||||
}
|
//}
|
||||||
else if (timespanMin > 10)
|
//else if (timespanMin > 10)
|
||||||
{
|
//{
|
||||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
// cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 10))) * 10);
|
||||||
_provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
// _provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||||
|
|
||||||
}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using System.Reflection.Metadata.Ecma335;
|
using System.Reflection.Metadata.Ecma335;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
@ -1771,34 +1772,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 最低
|
var lowSpleenLength = await this.GetLowSpleenLength(taskinfo);
|
||||||
var visitTaskIds = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
|
||||||
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
|
||||||
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
|
||||||
x.DoctorUserId == taskinfo.DoctorUserId &&
|
|
||||||
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
|
||||||
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == taskinfo.ArmEnum
|
|
||||||
&& x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect
|
|
||||||
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).ToListAsync();
|
|
||||||
|
|
||||||
var questionId = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.QuestionType == QuestionType.SpleenLength).Select(x => x.Id).FirstNotNullAsync();
|
|
||||||
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)
|
|
||||||
&& x.ReadingQuestionTrialId == questionId )
|
|
||||||
.Select(x => new
|
|
||||||
{
|
|
||||||
x.Answer,
|
|
||||||
x.VisitTaskId,
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
var lowSpleenLength = answerList.Select(x => new
|
|
||||||
{
|
|
||||||
Answer = x.Answer.IsNullOrEmptyReturn0(),
|
|
||||||
x.VisitTaskId
|
|
||||||
}).OrderBy(x => x.Answer).Select(x=>x.Answer).FirstOrDefault();
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
var result = SpleenAssessment.Stabilization;
|
var result = SpleenAssessment.Stabilization;
|
||||||
|
|
||||||
|
|
||||||
var presentSpd = spleenLength;
|
var presentSpd = spleenLength;
|
||||||
|
@ -1858,14 +1835,85 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取脾脏评估
|
/// <summary>
|
||||||
|
/// 获取最低垂直径
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task<decimal> GetLowSpleenLength(VisitTask taskinfo)
|
||||||
|
{
|
||||||
|
var visitTaskIds = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||||
|
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
||||||
|
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||||
|
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||||
|
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||||
|
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == taskinfo.ArmEnum
|
||||||
|
&& x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect
|
||||||
|
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).ToListAsync();
|
||||||
|
|
||||||
|
var questionId = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.QuestionType == QuestionType.SpleenLength).Select(x => x.Id).FirstNotNullAsync();
|
||||||
|
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)
|
||||||
|
&& x.ReadingQuestionTrialId == questionId)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
x.Answer,
|
||||||
|
x.VisitTaskId,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
var lowSpleenLength = answerList.Select(x => new
|
||||||
|
{
|
||||||
|
Answer = x.Answer.IsNullOrEmptyReturn0(),
|
||||||
|
x.VisitTaskId
|
||||||
|
}).OrderBy(x => x.Answer).Select(x => x.Answer).FirstOrDefault();
|
||||||
|
|
||||||
|
return lowSpleenLength;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取脾脏评估
|
/// 获取脾脏验证
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="visitTaskId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetSplenicEvaluation(ReadingCalculateDto inDto)
|
[HttpPost]
|
||||||
|
public async Task<object> GetSplenicVerify(Guid visitTaskId)
|
||||||
|
{
|
||||||
|
|
||||||
|
ReadingCalculateDto inDto = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
|
||||||
|
|
||||||
|
// 基线垂直径
|
||||||
|
var baseLineSpleenLength = await GetBaseLineSpleenLength(inDto);
|
||||||
|
|
||||||
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var baseLineTaskId = await GetBaseLineTaskId(inDto);
|
||||||
|
|
||||||
|
// 最低垂直经
|
||||||
|
var lowSpleenLength= await this.GetLowSpleenLength(taskinfo);
|
||||||
|
|
||||||
|
// 基线状态
|
||||||
|
var baseLineState = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
|
||||||
|
//基线垂直径
|
||||||
|
BaseLineSpleenLength = baseLineSpleenLength,
|
||||||
|
// 最低垂直经
|
||||||
|
LowSpleenLength = lowSpleenLength,
|
||||||
|
// 基线状态
|
||||||
|
BaseLineState = baseLineState,
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region 获取脾脏评估
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取脾脏评估
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<string> 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();
|
||||||
|
|
Loading…
Reference in New Issue