feat(growth): calculate z-score/centile for all indicators
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
João Paulo Dubas 2024-06-11 11:42:57 +00:00
parent 2545a796c3
commit 79aec9f7e5
Signed by: joao.dubas
SSH Key Fingerprint: SHA256:V1mixgOGRc/YMhGx/DNkOSmJxgA2vHNrDZEk3wt/kOA

View File

@ -13,6 +13,7 @@ defmodule Growth do
alias __MODULE__.Calc.Age
alias __MODULE__.Calc.BMI
alias __MODULE__.Score
@type gender :: :male | :female
@ -107,6 +108,7 @@ defmodule Growth do
|> with_age_in_weeks()
|> with_age_in_months()
|> with_bmi()
|> with_results()
end
for precision <- [:day, :week, :month] do
@ -143,6 +145,18 @@ defmodule Growth do
growth
end
def with_results(growth) do
Score.Scorer.results(growth, [
Score.BMI,
Score.Height,
Score.Weight,
Score.TricepsSkinfold,
Score.SubscapularSkinfold,
Score.ArmCircumference,
Score.HeadCircumference
])
end
defp default_opts do
Enum.map(@valid_measures, fn
:date_of_measurement = key ->