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 running
Details
continuous-integration/drone/push Build is running
Details
commit
532d7d155b
|
@ -640,7 +640,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
else
|
||||
{
|
||||
return eEMLumenSum/ eEMSum * 100+100;
|
||||
return eEMLumenSum / eEMSum * 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -441,6 +441,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自动计算
|
||||
/// </summary>
|
||||
|
@ -456,56 +457,30 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||
{
|
||||
////靶病灶径线之和(SOD)
|
||||
//new ReadingCalculateData (){QuestionType=QuestionType.SOD,GetDecimalNullFun=GetSODData},
|
||||
// 匹配动脉段最小FCT
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.MinFCT,GetDecimalNullFun=GetAllMinFCT},
|
||||
|
||||
// 平均最小FCT
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.AverageMinFCT,GetDecimalNullFun=GetAvgMinFCT},
|
||||
|
||||
// 脂质角度平均值
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.AvgLipidAngle,GetDecimalNullFun=GetAvgMinLipidAngle},
|
||||
|
||||
// 脂质角度最大值
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.MaxLipidAngle,GetDecimalNullFun=GetAllMaxLipidAngle},
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 没有靶病灶只计算最后几个
|
||||
if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).Sum(x => x.TableRowInfoList.Count()) == 0)
|
||||
{
|
||||
|
||||
List<QuestionType> questionTypes = new List<QuestionType>()
|
||||
{
|
||||
QuestionType.TargetLesion,
|
||||
QuestionType.NoTargetLesion,
|
||||
QuestionType.NewLesions,
|
||||
QuestionType.Tumor,
|
||||
QuestionType.ExistDisease,
|
||||
};
|
||||
|
||||
// 没有靶病灶就删除其他几个答案的值
|
||||
var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList();
|
||||
|
||||
|
||||
var isNeedDeleteIds = inDto.QuestionInfo.Where(x => x.QuestionType != null && isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList();
|
||||
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && isNeedDeleteIds.Contains(x.ReadingQuestionTrialId), x => new ReadingTaskQuestionAnswer
|
||||
{
|
||||
Answer = string.Empty
|
||||
});
|
||||
|
||||
|
||||
|
||||
calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (calculateType != null)
|
||||
{
|
||||
calculateList = calculateList.Where(x => calculateType.Contains(x.QuestionType)).ToList();
|
||||
}
|
||||
|
||||
var typeNAList = new List<QuestionType>
|
||||
{
|
||||
QuestionType.SODChange,
|
||||
QuestionType.SODPercent,
|
||||
QuestionType.LowestIncrease,
|
||||
QuestionType.LowPercent,
|
||||
};
|
||||
|
||||
|
||||
foreach (var calculate in calculateList)
|
||||
{
|
||||
|
@ -514,87 +489,56 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
if (item != null)
|
||||
{
|
||||
//计算答案
|
||||
if (inDto.IsOnlyChangeAllTask == false)
|
||||
|
||||
|
||||
#region 计算答案
|
||||
if (calculate.GetDecimalFun != null)
|
||||
{
|
||||
item.Answer = (await calculate.GetDecimalFun(inDto)).ToString();
|
||||
|
||||
#region 计算答案
|
||||
if (calculate.GetDecimalFun != null)
|
||||
{
|
||||
item.Answer = (await calculate.GetDecimalFun(inDto)).ToString();
|
||||
}
|
||||
else if (calculate.GetDecimalNullFun != null)
|
||||
{
|
||||
var value = await calculate.GetDecimalNullFun(inDto);
|
||||
item.Answer = value == null ? string.Empty : value.Value.ToString();
|
||||
}
|
||||
else if (calculate.GetStringFun != null)
|
||||
{
|
||||
item.Answer = await calculate.GetStringFun(inDto);
|
||||
}
|
||||
#endregion
|
||||
// 修改修约小数位数
|
||||
|
||||
}
|
||||
else if (calculate.GetDecimalNullFun != null)
|
||||
{
|
||||
var value = await calculate.GetDecimalNullFun(inDto);
|
||||
if (value == null)
|
||||
{
|
||||
if (typeNAList.Contains(item.QuestionType ?? QuestionType.SOD))
|
||||
{
|
||||
item.Answer = nameof(YesOrNoOrNa.NA);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Answer = this.nAString;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
item.Answer = value == null ? string.Empty : value.Value.ToString();
|
||||
}
|
||||
}
|
||||
else if (calculate.GetStringFun != null)
|
||||
{
|
||||
item.Answer = await calculate.GetStringFun(inDto);
|
||||
}
|
||||
#endregion
|
||||
// 修改修约小数位数
|
||||
|
||||
List<ValueOfType?> valueOfTypes = new List<ValueOfType?>() {
|
||||
List<ValueOfType?> valueOfTypes = new List<ValueOfType?>() {
|
||||
|
||||
ValueOfType.Decimals,
|
||||
ValueOfType.Percentage
|
||||
};
|
||||
|
||||
if (inDto.DigitPlaces != -1)
|
||||
if (inDto.DigitPlaces != -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
|
||||
if (valueOfTypes.Contains(item.ValueType))
|
||||
{
|
||||
|
||||
if (valueOfTypes.Contains(item.ValueType))
|
||||
{
|
||||
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
|
||||
item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
catch (Exception)
|
||||
{
|
||||
Answer = item.Answer,
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 修改全局
|
||||
if (inDto.IsChangeOtherTask && calculate.ChangeAllTaskFun != null)
|
||||
|
||||
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
await calculate.ChangeAllTaskFun(new ChangeAllTaskDto()
|
||||
{
|
||||
calculateDto = inDto,
|
||||
QuestionId = item.QuestionId,
|
||||
});
|
||||
}
|
||||
|
||||
Answer = item.Answer,
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -668,6 +612,39 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度最大值
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetAllMaxLipidAngle(ReadingCalculateDto inDto)
|
||||
{
|
||||
|
||||
var maxLipidAngle = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.LipidAngle).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Answer.IsNullOrEmptyReturn0()).Max();
|
||||
if (maxLipidAngle == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return maxLipidAngle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度平均值
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetAvgMinLipidAngle(ReadingCalculateDto inDto)
|
||||
{
|
||||
var avgMinLipidAngle = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.LipidAngle).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Answer.IsNullOrEmptyReturn0()).Average();
|
||||
if (avgMinLipidAngle == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return avgMinLipidAngle;
|
||||
}
|
||||
|
||||
#region 将上一次的访视病灶添加到这一次
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1784,6 +1784,11 @@ public enum SUVChangeVSBaseline
|
|||
/// </summary>
|
||||
MatchValues = 102,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度
|
||||
/// </summary>
|
||||
LipidAngle = 103,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2084,6 +2089,11 @@ public enum SUVChangeVSBaseline
|
|||
/// </summary>
|
||||
AvgMin=1015,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度
|
||||
/// </summary>
|
||||
LipidAngle = 1016,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2489,6 +2499,22 @@ public enum SUVChangeVSBaseline
|
|||
/// 平均最小FCT
|
||||
/// </summary>
|
||||
AverageMinFCT = 1011,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度
|
||||
/// </summary>
|
||||
LipidAngle = 1012,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度平均值
|
||||
/// </summary>
|
||||
AvgLipidAngle = 1013,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度最大值
|
||||
/// </summary>
|
||||
MaxLipidAngle = 1014,
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue