[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 7e041ae6c9 - Show all commits

View File

@ -28,7 +28,7 @@ defmodule Growth.Score.Scorer do
{precision, scores(indicator, growth, l, m, s)}
end)
%{growth | results: [Map.new([{indicator.measure_name(), result}]) | growth.results]}
%{growth | results: Keyword.put(growth.results, indicator.measure_name(), result)}
end
@spec lms(Growth.t(), module()) :: [{String.t(), {number(), number(), number()}}]
@ -42,9 +42,9 @@ defmodule Growth.Score.Scorer do
"""
def lms(growth, indicator) do
[
{growth.gender, "day", growth.age_in_days},
{growth.gender, "week", growth.age_in_weeks},
{growth.gender, "month", growth.age_in_months}
{growth.gender, :day, growth.age_in_days},
{growth.gender, :week, growth.age_in_weeks},
{growth.gender, :month, growth.age_in_months}
]
|> Enum.map(fn {_, precision, _} = key ->
case :ets.lookup(indicator, key) do