diff --git a/lib/growth/growth.ex b/lib/growth/growth.ex index 73b627c..d5c60f0 100644 --- a/lib/growth/growth.ex +++ b/lib/growth/growth.ex @@ -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 ->