137 Commits

Author SHA1 Message Date
5c044e69d9
fix(growth): use centile and percentile correctly
1. The calculation made in `Grownth.Calc.Centile.compute/4` converts a
   given z-score into the expected measurement value.
   This can be used to get specific values for key z-scores, such as,
   -3, -2, 2 and 3.
2. To calculate the percentile of a given z-score the system uses the
   cumulative distribution function.
2024-08-28 13:03:45 +00:00
824a70452f
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
2024-08-13 14:17:32 +00:00
4d545074f5 chore(deps): update postgres docker tag to v16.4 (#90)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| postgres | minor | `16.3-alpine` -> `16.4-alpine` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Reviewed-on: #90
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-08-13 14:09:16 +00:00
b696cc129d
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
Conflicts:
    mix.exs
    mix.lock
2024-08-12 20:19:36 +00:00
4195fc615f feat: upgrade application dependencies (#93)
All checks were successful
continuous-integration/drone/push Build is passing
[Upgrade deps][0]:

* `absinthe` from 1.7.7 to 1.7.8
* `ecto` from 3.11.2 to 3.12.0
* `ecto_sql` from 3.11.3 to 3.12.0
* `gettext` from 0.24.0 to 0.25.0
* `jason` from 1.4.3 to 1.4.4
* `mix_audit` from 2.1.3 to 2.1.4
* `postgrex` from 0.18.0 to 0.19.0
* `prom_ex` from 1.9.0 to 1.10.0
* `telemetry_metrics` from 0.6.2 to 1.0.0

Install transient deps:

* `peep` to 3.2.0

Reviewed-on: #93

[0]: https://diff.hex.pm/diffs?diffs[]=absinthe:1.7.7:1.7.8&diffs[]=ecto:3.11.2:3.12.0&diffs[]=ecto_sql:3.11.3:3.12.0&diffs[]=gettext:0.24.0:0.25.0&diffs[]=jason:1.4.3:1.4.4&diffs[]=mix_audit:2.1.3:2.1.4&diffs[]=postgrex:0.18.0:0.19.0&diffs[]=prom_ex:1.9.0:1.10.0&diffs[]=telemetry_metrics:0.6.2:1.0.0
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-08-12 20:08:18 +00:00
c923b2efb7
test(growth): work on age calculation
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-12 11:18:40 +00:00
8e9907a3e8
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-12 11:15:30 +00:00
39fd238ed8 feat: upgrade erlang and deps (#87)
All checks were successful
continuous-integration/drone/push Build is passing
* Upgrade erlang to 27.0.1
* Upgrade abisnthe to 1.7.7

Reviewed-on: #87
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-07-12 11:12:50 +00:00
3914bd5240
merge: updates from upstream
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-08 21:55:02 +00:00
2fa1a773f2 feat(ci): improve dependency graph (#84)
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #84
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-07-08 21:54:20 +00:00
8dffb86d01
chore(deps): update deps of deps
All checks were successful
continuous-integration/drone/pr Build is passing
2024-07-08 21:36:37 +00:00
866730238e
feat(deps): upgrade req from 0.5.0 to 0.5.2 2024-07-08 21:28:35 +00:00
eeb6964348
merge: updates from upstream
Conflicts:
    mix.lock
2024-07-08 21:25:21 +00:00
3f83808335 feat: upgrade elixir and erlang runtimes, and deps (#83)
All checks were successful
continuous-integration/drone/push Build is passing
Upgrade runtimes:

* [erlang from 26.2.5 to 27.0][0]
* [elixir from 1.16.3 to 1.17.1][1]

Upgrade dependencies:

* `castore` [from 1.0.6 to 1.0.8](https://diff.hex.pm/diff/castore/1.0.6..1.0.8)
* `cowboy` [from 2.10.0 to 2.12.0](https://diff.hex.pm/diff/cowboy/2.10.0..2.12.0)
* `cowlib` [from 2.12.1 to 2.13.0](https://diff.hex.pm/diff/cowlib/2.12.1..2.13.0)
* `credo` [from 1.7.6 to 1.7.7](https://diff.hex.pm/diff/credo/1.7.6..1.7.7)
* `db_connection` [from 2.6.0 to 2.7.0](https://diff.hex.pm/diff/db_connection/2.6.0..2.7.0)
* `ecto_sql` [from 3.11.2 to 3.11.3](https://diff.hex.pm/diff/ecto_sql/3.11.2..3.11.3)
* `erlex` [from 0.2.6 to 0.2.7](https://diff.hex.pm/diff/erlex/0.2.6..0.2.7)
* `hpax` [from 0.1.2 to 1.0.0](https://diff.hex.pm/diff/hpax/0.1.2..1.0.0)
* `jason` [from 1.4.1 to 1.4.3](https://diff.hex.pm/diff/jason/1.4.1..1.4.3)
* `mime` [from 2.0.5 to 2.0.6](https://diff.hex.pm/diff/mime/2.0.5..2.0.6)
* `mint` [from 1.5.2 to 1.6.2](https://diff.hex.pm/diff/mint/1.5.2..1.6.2)
* `nimble_options` [from 1.1.0 to 1.1.1](https://diff.hex.pm/diff/nimble_options/1.1.0..1.1.1)
* `nimble_pool` [from 1.0.0 to 1.1.0](https://diff.hex.pm/diff/nimble_pool/1.0.0..1.1.0)
* `phoenix` [from 1.7.12 to 1.7.14](https://diff.hex.pm/diff/phoenix/1.7.12..1.7.14)
* `phoenix_ecto` [from 4.6.1 to 4.6.2](https://diff.hex.pm/diff/phoenix_ecto/4.6.1..4.6.2)
* `phoenix_live_dashboard` [from 0.8.3 to 0.8.4](https://diff.hex.pm/diff/phoenix_live_dashboard/0.8.3..0.8.4)
* `phoenix_live_view` [from 0.20.14 to 0.20.17](https://diff.hex.pm/diff/phoenix_live_view/0.20.14..0.20.17)
* `phoenix_view` [from 2.0.3 to 2.0.4](https://diff.hex.pm/diff/phoenix_view/2.0.3..2.0.4)
* `plug` [from 1.15.3 to 1.16.1](https://diff.hex.pm/diff/plug/1.15.3..1.16.1)
* `plug_crypto` [from 2.0.0 to 2.1.0](https://diff.hex.pm/diff/plug_crypto/2.0.0..2.1.0)
* `telemetry_metrics_prometheus_core` [from 1.2.0 to 1.2.1](https://diff.hex.pm/diff/telemetry_metrics_prometheus_core/1.2.0..1.2.1)
* `websock_adapter` [from 0.5.5 to 0.5.6](https://diff.hex.pm/diff/websock_adapter/0.5.5..0.5.6)
* `yaml_elixir` [from 2.9.0 to 2.11.0](https://diff.hex.pm/diff/yaml_elixir/2.9.0..2.11.0)

To make `graphql` work with the newer `erlang` and `elixir`, the `absinthe` is installed directly from github:

* [`absinthe`](358e273a26)
* [`absinthe_plug`](3a984cc341)

Finally, the `ci` routine was simplified, so test + lint is executed in parallel, and more core is reused.

[0]: https://www.erlang.org/news/170
[1]: https://github.com/elixir-lang/elixir/releases/tag/v1.17.1

Reviewed-on: #83
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-07-08 21:04:26 +00:00
0d7a4cc9c3
chore(growth): move nil logic to scorer behaviour
All checks were successful
continuous-integration/drone/pr Build is passing
Handle `nil` measurement in `Growth.Score.Scorer`.
2024-06-11 14:53:19 +00:00
7fab746ea8
feat: add ex_doc to generate documentation
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-11 12:18:18 +00:00
c81e4fda67
chore(growth): add log in loader
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-11 12:02:14 +00:00
bc9c2124f1
chore(growth): add example for Growth.new/4 2024-06-11 12:01:50 +00:00
c14a26a184
fix(growth): measure for subscapular skinfold 2024-06-11 12:01:25 +00:00
79aec9f7e5
feat(growth): calculate z-score/centile for all indicators
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-11 11:42:57 +00:00
2545a796c3
chore(growth): return nil when measure isn't set 2024-06-11 11:42:17 +00:00
88b8e811a8
chore(growth): apply scorer behaviour in indicators 2024-06-11 11:41:31 +00:00
fa022b9592
feat(growth): calculate z-score/centile for all indicators
The `Growth.Score.Scorer` behaviour implements the methods needed to
calculate z-score and centile for any indicator.
2024-06-11 11:38:18 +00:00
0ac434c61d
fix(growth): ignore enum result explicitly
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-10 19:24:41 +00:00
06b35cbceb
wip(growth): implement results for bmi
Some checks failed
continuous-integration/drone/pr Build is failing
This implementation should be made generic for all other scores.
2024-06-10 19:09:35 +00:00
28f0546bcb
chore(growth): add default value for results 2024-06-10 18:35:12 +00:00
c175c3edfd
fix(growth): typespec and doc for centile calc 2024-06-10 18:34:24 +00:00
4234b2e917
chore(growth): load is independent from task
Some checks failed
continuous-integration/drone/pr Build is failing
Ensure that `Growth.Indicators.Load.all/0` can be run independently from
the task.

So, the `ets` table is create based on the filename processed.
2024-06-10 13:01:44 +00:00
04fff60541
wip(growth): add score module
Some checks failed
continuous-integration/drone/pr Build is failing
This module is responsible for calculate the z score/centile for each
measurement.
2024-06-10 12:15:16 +00:00
b415b38184
feat(growth): load data on application start
To make this possible, the following changes were made:

* Use `Task` to start the load process
* Create `ets` table before start the async task
  * This is needed to keep the tables alive after the task process exits
* Adjust the application to start the `Growth.Indicators.Load` task
2024-06-10 12:11:18 +00:00
412250d7ef
feat(growth): add struct to represent measurement
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-09 20:00:49 +00:00
d3c1aa9b6b
chore(growth): improve age documentation and typing 2024-06-09 19:59:33 +00:00
025ab1537d
chore(growth): name ets tables with score modules 2024-06-09 19:58:34 +00:00
52c1d0c028
feat(growth): load csv indicators into ets tables
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-07 13:28:13 +00:00
902a22c947
chore(growth): fetch extended data for indicators
All checks were successful
continuous-integration/drone/pr Build is passing
Also, improve module doc.
2024-06-06 22:49:52 +00:00
a8466f0c1d
chore(growth): add documentation and examples
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-06 20:39:10 +00:00
Joao P Dubas
bb79aa2f3a fix(growth): alias z-score and use if
Some checks failed
continuous-integration/drone/pr Build is failing
2024-06-06 11:34:02 +00:00
500d0e89bb
wip(growth): calculate key metrics for growth
Some checks failed
continuous-integration/drone/pr Build is failing
1. calculate age in days, weeks, and months
2. calculate body mass index for metric and english unities
3. calculate z-score for a given measurement and box-cox parameters (l,
   m, s)
4. calculate centile score for a given measurement and box-cox
   parameters
2024-06-06 01:36:11 +00:00
8be9fa38bb
wip(growth): add fix note on convert/3 method
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-04 23:56:27 +00:00
9c8e1d20ee
wip(growth): improve data parsing
1. Fetch common data for all indicators
2. Remove headers during merge

Also, re-generate files.
2024-06-04 23:55:03 +00:00
2fedb4ecf0
wip(growth): change from with to case
All checks were successful
continuous-integration/drone/pr Build is passing
2024-06-04 14:36:20 +00:00
58f14c0346
wip(growth): fetch|extract|save indicators from WHO
Initial implementation to fetch growth indicators from WHO.

For now, the system merges the measurements for each gender and age
group in a single `csv` file.

The final solution should do this, saving a `dets` file.
2024-06-04 13:57:32 +00:00
ece17e3cf9 feat: upgrade elixir runtimes and dependencies (#78)
All checks were successful
continuous-integration/drone/push Build is passing
Upgrade [elixir][0] runtime from [1.16.2 to 1.16.3][1].

Also, [upgrade application dependencies][2]:

* `ecto_sql` from 3.11.1 to 3.11.2
* `phoenix_ecto` from 4.6.0 to 4.6.1
* `postgrex` from 0.17.5 to 0.18.0

Reviewed-on: #78

[0]: https://github.com/elixir-lang/elixir/releases/tag/v1.16.3
[1]: https://github.com/elixir-lang/elixir/compare/v1.16.2...v1.16.3
[2]: https://diff.hex.pm/diffs?diffs[]=ecto_sql:3.11.1:3.11.2&diffs[]=phoenix_ecto:4.6.0:4.6.1&diffs[]=postgrex:0.17.5:0.18.0
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-05-28 14:27:49 +00:00
e616d01e63 chore(ci): upgrade database and erlang runtime on pipelines (#74)
All checks were successful
continuous-integration/drone/push Build is passing
The following upgrades were made:

* Bump [`postgres` from 16.0 to 16.3][postgres-release].
* Bump [`erlang`][erlang-release] from [26.2.3 to 26.2.5][erlang-diffs].

Also, use the same `elixir` image/tag on both pipelines.

[postgres-release]: https://www.postgresql.org/docs/release/16.3/
[erlang-release]: https://www.erlang.org/patches/otp-26.2.5
[erlang-diffs]: https://github.com/erlang/otp/compare/OTP-26.2.3...OTP-26.2.5

Reviewed-on: #74
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-05-16 19:15:12 +00:00
9aeaaabc35 chore(deps): upgrade erlang runtime and application dependencies (#73)
All checks were successful
continuous-integration/drone/push Build is passing
Bump [application dependencies][app-diffs]:

* [`credo` from 1.7.5 to 1.7.6][credo-diffs]
* [`phoenix_ecto` from 4.5.1. to 4.6.0][phoenix_ecto-diffs]

Bump [`erlang`][erlang-release] from [26.2.3 to 26.2.5][erlang-diffs].

[app-diffs]: https://diff.hex.pm/diffs?diffs[]=credo:1.7.5:1.7.6&diffs[]=phoenix_ecto:4.5.1:4.6.0
[credo-diffs]: https://diff.hex.pm/diff/credo/1.7.5..1.7.6
[phoenix_ecto-diffs]: https://diff.hex.pm/diff/phoenix_ecto/4.5.1..4.6.0
[erlang-release]: https://www.erlang.org/patches/otp-26.2.5
[erlang-diffs]: https://github.com/erlang/otp/compare/OTP-26.2.3...OTP-26.2.5

Reviewed-on: #73
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-05-16 18:46:25 +00:00
de9fa663c9 chore(deps): update postgres docker tag to v16.3 (#71)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| postgres | minor | `16.2-alpine` -> `16.3-alpine` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNjIuMSIsInVwZGF0ZWRJblZlciI6IjM3LjE2Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Reviewed-on: #71
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-05-10 13:53:46 +00:00
037f4d7504 feat(deps): bump application dependencies (#70)
All checks were successful
continuous-integration/drone/push Build is passing
[Bump dependencies][0]:

1. junit_formatter from 3.3.1 to 3.4.0
2. phoenix from 1.7.11 to 1.7.12
3. plug_cowboy from 2.7.0 to 2.7.1
4. telemetry_poller from 1.0.0 to 1.1.0

[0]: https://diff.hex.pm/diffs?diffs%5B%5D=junit_formatter:3.3.1:3.4.0&diffs%5B%5D=phoenix:1.7.11:1.7.12&diffs%5B%5D=plug_cowboy:2.7.0:2.7.1&diffs%5B%5D=telemetry_poller:1.0.0:1.1.0

Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Reviewed-on: #70
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-04-15 14:18:49 +00:00
9bd41ba3b8 chore(deps): bump erlang runtime and deps (#67)
All checks were successful
continuous-integration/drone/push Build is passing
Update runtime:

* Bump [`erlang` from 26.2.2 to 26.2.3][0]

Update [dependencies][1]:

* credo from 1.7.4 to 1.7.5
* mix_audit from 2.1.2 to 2.1.3
* phoenix_ecto from 4.4.3 to 4.5.1
* postgrex from 0.17.4 to 0.17.5

[0]: https://www.erlang.org/patches/otp-26.2.3
[1]: https://diff.hex.pm/diffs?diffs[]=credo:1.7.4:1.7.5&diffs[]=mix_audit:2.1.2:2.1.3&diffs[]=phoenix_ecto:4.4.5:4.5.1&diffs[]=postgrex:0.17.4:0.17.5

Reviewed-on: #67
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-03-19 16:23:27 +00:00
dbce23e51a chore(deps): update hexpm/elixir docker tag to v1.16.2 (#65)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| hexpm/elixir | final | patch | `1.16.1-erlang-26.2.2-debian-bookworm-20240130-slim` -> `1.16.2-erlang-26.2.2-debian-bookworm-20240130-slim` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNjIuMSIsInVwZGF0ZWRJblZlciI6IjM3LjE2Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Reviewed-on: #65
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-03-19 12:48:38 +00:00
2fca7bc67d chore(deps): update dependency elixir to v1.16.2 (#64)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [elixir](https://elixir-lang.org/) ([source](https://github.com/elixir-lang/elixir)) | patch | `1.16.1` -> `1.16.2` |

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNjIuMSIsInVwZGF0ZWRJblZlciI6IjM3LjE2Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Reviewed-on: #64
Co-authored-by: renovate-bot <renovate-bot@dubas.dev>
Co-committed-by: renovate-bot <renovate-bot@dubas.dev>
2024-03-19 11:52:41 +00:00