[WIP] Implement growth assessment using WHO indicators #80

Draft
joao.dubas wants to merge 76 commits from jpd-feat-add-bmi-module-with-live-view into main
Showing only changes of commit bb79aa2f3a - Show all commits

View File

@ -9,17 +9,17 @@ defmodule Growth.Calc.Centile do
Enum.map(measures, &apply(Growth.Calc.Centile, :compute, &1))
"""
alias Growth.Calc.ZScore
# TODO: (jpd) add documentation and typespecs
def compute(y, l, m, s) do
zscore = Growth.Calc.ZScore.raw(y, l, m, s)
zscore = ZScore.raw(y, l, m, s)
cond do
-3 <= zscore and zscore <= 3 ->
m * :math.pow(1 + l * s * zscore, 1 / l)
true ->
:na
if -3 <= zscore and zscore <= 3 do
m * :math.pow(1 + l * s * zscore, 1 / l)
else
:na
end
end
end