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

2fcf4d155486f5435ecd1ab14b598ca10e288c72 — Umgeher Torgersen 4 months ago 2de5f90
removing influx fns
2 files changed, 1 insertions(+), 26 deletions(-)

M src/utos_usr_local_hcs_exam_ecg.erl
M src/utos_usr_local_hcs_exam_ecg_settings.erl
M src/utos_usr_local_hcs_exam_ecg.erl => src/utos_usr_local_hcs_exam_ecg.erl +0 -20
@@ 4,9 4,7 @@
-include_lib("utos_usr_local_tsk_include/src/utos_usr_local_tsk_include.hrl").

-export([
         corelead_drop/1,
         corelead_etu_uid/1,
         corelead_process/1,
         corelead_uid/1,
         flux_context/1,
         flux_context/2,


@@ 20,24 18,12 @@
         settings_ecg_pause/0,
         settings_ecg_pause_min/0,
         settings_ecg_pause_max/0,
         settings_influx_db/0,
         uid/1
        ]).

corelead_drop(Exam) when is_binary(Exam) ->
    {ok, UID} = uid(Exam),
    {ok, DB} = settings_influx_db(),
    {ok, Pid} = influx(),
    _ = utos_usr_db_influx:drop_measurement(Pid, DB, erlang:binary_to_list(UID) ++ "_golden_l0"),
    {ok, drop}.

corelead_etu_uid(Exam) ->
    utos_usr_local_hcs_exam_ecg_corelead_etu:uid(Exam).

corelead_process(<<Exam/binary>>) ->
    {ok, #{<<"golden">> := G, <<"corelead">> := C}} = flux_context(Exam),
    utos_usr_local_hcs_exam_ecg_corelead_generator:run(G, C).

corelead_uid(<<Exam/binary>>) ->
    utos_crypto:sha256({hex, ["HCS-EXAM-ECG-CORELEAD:", Exam]}).



@@ 60,9 46,6 @@ flux_context(<<Exam/binary>>, Append) ->
    {ok, C} = flux_context(Exam),
    {ok, maps:merge(Append, C)}.

influx() ->
    utos_usr_local_hcs_exam_ecg_influx:connection().

notify_bus(Msg) ->
    utos_usr_local_bus:notify({hcs, {exam, ecg}, Msg}).



@@ 94,8 77,5 @@ settings_ecg_pause_min() ->
settings_ecg_pause_max() ->
    {ok, 2000000000}.

settings_influx_db() ->
    utos_usr_local_hcs_exam_ecg_settings:influx_db().

uid(Exam) ->
    utos_crypto:sha256({hex, ["HCS-EXAM-ECG:", Exam]}).

M src/utos_usr_local_hcs_exam_ecg_settings.erl => src/utos_usr_local_hcs_exam_ecg_settings.erl +1 -6
@@ 1,8 1,3 @@
-module(utos_usr_local_hcs_exam_ecg_settings).

-export([
         influx_db/0
        ]).

influx_db() ->
    utos_etc:read(<<"utos-usr-local-hcs-exam-ecg-influx-db">>, "ecg").
-export([]).