This commit is contained in:
fuenmao
2026-10-09 16:46:30 +08:00
parent 4a634ef4c2
commit e6b90a06ab
63 changed files with 4170 additions and 1518 deletions
@@ -0,0 +1,22 @@
namespace Evergreen.Health.Application.Health.Policies;
/// <summary>Demo 起点,可由用户手动修改,不是医学或人体工学判断。</summary>
public static class BmiFirmnessPolicy
{
public static decimal? Calculate(decimal? heightCm, decimal? weightKg)
{
if (heightCm is null or <= 0 || weightKg is null or <= 0) return null;
try
{
var height = heightCm.Value / 100m;
return Math.Round(weightKg.Value / (height * height), 1);
}
catch (ArithmeticException) { return null; }
}
public static string? Firmness(decimal? bmi) => bmi switch
{
< 18.5m => "很软", < 24m => "稍软", < 28m => "稍硬",
< 32m => "很硬", >= 32m => "最硬", _ => null
};
}