~umgeher/utos-usr-local-hcs-exam-ecg

2de5f90f0b66ffc2ea246c6161c9847abe94b093 — Umgeher Torgersen 4 months ago 5f7b80c
removing flux module
1 files changed, 0 insertions(+), 43 deletions(-)

D src/utos_usr_local_hcs_exam_ecg_flux_setup.erl
D src/utos_usr_local_hcs_exam_ecg_flux_setup.erl => src/utos_usr_local_hcs_exam_ecg_flux_setup.erl +0 -43
@@ 1,43 0,0 @@
-module(utos_usr_local_hcs_exam_ecg_flux_setup).

-export([main/0]).

-define(OP, <<"utos">>).

main() ->
    spawn(utos_usr_local_hcs_exam_ecg_influx, flux_set, ecg_corelead_get()),
    spawn(utos_usr_local_hcs_exam_ecg_influx, flux_set, ecg_corelead_scan()),
    spawn(utos_usr_local_hcs_exam_ecg_influx, flux_set, ecg_corelead_seek()),
    spawn(utos_usr_local_hcs_exam_ecg_influx, flux_set, ecg_corelead_ts_first()),
    spawn(utos_usr_local_hcs_exam_ecg_influx, flux_set, ecg_corelead_ts_last()),
    spawn(utos_usr_local_hcs_exam_ecg_influx, flux_set, ecg_ts_first()),
    spawn(utos_usr_local_hcs_exam_ecg_influx, flux_set, ecg_ts_last()),
    ok.

ecg_corelead_get() ->
    Q = <<"from(bucket: \"{bucket}\") |> range(start: {t0}) |> filter(fn: (r) => r[\"_measurement\"] == \"{corelead}\") |> group(columns: []) |> group(columns: []) |> limit(n: 1000) |> keep(columns: [\"_time\", \"label\", \"_value\"]) |> sort(columns: [\"_time\"])">>,
    [?OP, <<"ecg-corelead-get">>, Q].

ecg_corelead_scan() ->
    Q = <<"from(bucket: \"{bucket}\") |> range(start: {t0}) |> filter(fn: (r) => r[\"_measurement\"] == \"{golden}\" and r[\"_field\"] == \"rr_interval\" and r[\"lead\"] == \"{lead}\") |> group(columns: []) |> limit(n: 100) |> keep(columns: [\"_time\", \"cluster\" \"label\", \"lead\"]) |> sort(columns: [\"_time\"])">>,
    [?OP, <<"ecg-corelead-scan">>, Q].

ecg_corelead_seek() ->
    Q = <<"from(bucket: \"{bucket}\") |> range(start: {t0}, stop: {t1}) |> filter(fn: (r) => r[\"_measurement\"] == \"{golden}\" and r[\"lead\"] != \"{lead}\" and r[\"_field\"] == \"rr_interval\") |> group(columns: [\"lead\"]) |> limit(n: 1) |> keep(columns: [\"_time\", \"lead\", \"label\", \"cluster\"]) |> sort(columns: [\"_time\"])">>,
    [?OP, <<"ecg-corelead-seek">>, Q].

ecg_corelead_ts_first() ->
    Q = <<"from(bucket: \"{bucket}\") |> range(start: -300d) |> filter(fn: (r) => r._measurement == \"{corelead}\") |> first() \> keep(columns: [\"_time\", \"_value\"])">>,
    [?OP, <<"ecg-corelead-ts-first">>, Q].

ecg_corelead_ts_last() ->
    Q = <<"from(bucket: \"{bucket}\") |> range(start: -300d) |> filter(fn: (r) => r._measurement == \"{corelead}\") |> last() \> keep(columns: [\"_time\", \"_value\"])">>,
    [?OP, <<"ecg-corelead-ts-last">>, Q].

ecg_ts_first() ->
    Q = <<"from(bucket: \"{bucket}\") |> range(start: -300d) |> filter(fn: (r) => r._measurement == \"{ecg}\" and r.lead == \"2\") |> first()">>,
    [?OP, <<"ecg-ts-first">>, Q].

ecg_ts_last() ->
    Q = <<"from(bucket: \"{bucket}\") |> range(start: -300d) |> filter(fn: (r) => r._measurement == \"{ecg}\" and r.lead == \"2\") |> last() |> keep(columns: [\"_time\", \"_value\"]) |> yield(name: \"ecg-ts-last\")">>,
    [?OP, <<"ecg-ts-last">>, Q].