计算修改
This commit is contained in:
@@ -4246,6 +4246,13 @@
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFCalculateService.GetFattyLiverGrading(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
获取脂肪肝分级
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFCalculateService.CalculateAvg(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
计算平均值
|
||||
|
||||
@@ -498,6 +498,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
// 脂肪平均
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.TotalMeanFraction,GetStringFun=GetFatFractionAvg},
|
||||
|
||||
// 脂肪分级
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.FattyLiverGrading,GetStringFun=GetFattyLiverGrading},
|
||||
};
|
||||
|
||||
|
||||
@@ -608,6 +611,33 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取脂肪肝分级
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetFattyLiverGrading(ReadingCalculateDto inDto)
|
||||
{
|
||||
var answer = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TotalMeanFraction).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
||||
if (answer == "NE" || answer == string.Empty)
|
||||
{
|
||||
return FattyLiverClassification.NE.GetEnumInt();
|
||||
}
|
||||
|
||||
if (decimal.TryParse(answer, out var value))
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
< 5 => FattyLiverClassification.Level0.GetEnumInt(),
|
||||
< 10 => FattyLiverClassification.Level1.GetEnumInt(),
|
||||
< 25 => FattyLiverClassification.Level2.GetEnumInt(),
|
||||
_ => FattyLiverClassification.Level3.GetEnumInt()
|
||||
};
|
||||
}
|
||||
|
||||
return FattyLiverClassification.NE.GetEnumInt();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算平均值
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user