View Source Glific.Clients.ArogyaWorld (Glific v5.1.6)

Custom code extenison for ArogyaWorld

Link to this section Summary

Functions

add data that needs to be sent to the database

adds the weekly dynamic data loaded from the sheet based on current week

Clean static weekly data from the CSV file.

Clean week data from the CSV file.

Get the messages based on flow label

Return the question id based on the label

Return the response of the question for a contact

Return the response score based on the body

Get response message based on day and week

Hourly task jobs for the ArogyaWorld

Run this function on the initial load

load participant files from gcs

message mapping to HSM UUID

question mapping to HSM UUID

response to score mapping

creates the static data map that needs to be sent to users

get template form EEx without variables

get template form EEx based on variables

Conditionally execute the trigger based on: ID, Week, Day.

Create a file in GCS bucket for candidate response

Webhook functions for the ArogyaWorld

Link to this section Functions

Link to this function

add_data_from_csv(key, file_url, cleanup_func, org_id)

View Source
@spec add_data_from_csv(String.t(), String.t(), any(), non_neg_integer()) ::
  {:ok, any()} | {:error, Ecto.Changeset.t()}

add data that needs to be sent to the database

Link to this function

add_weekly_dynamic_data(key, file_url, org_id)

View Source
@spec add_weekly_dynamic_data(String.t(), String.t(), non_neg_integer()) ::
  {:ok, any()} | {:error, Ecto.Changeset.t()}

adds the weekly dynamic data loaded from the sheet based on current week

Link to this function

cleanup_static_data(acc, data)

View Source
@spec cleanup_static_data(map(), map()) :: map()

Clean static weekly data from the CSV file.

Link to this function

cleanup_week_data(acc, data)

View Source
@spec cleanup_week_data(map(), map()) :: map()

Clean week data from the CSV file.

Link to this function

get_messages_by_flow_label(label)

View Source
@spec get_messages_by_flow_label(String.t()) :: any()

Get the messages based on flow label

@spec get_question_id(String.t()) :: any()

Return the question id based on the label

Link to this function

get_response(list, contact_id)

View Source
@spec get_response(list(), String.t()) :: String.t() | nil

Return the response of the question for a contact

Link to this function

get_response_score(response, q_id, org_id)

View Source
@spec get_response_score(String.t(), String.t(), non_neg_integer()) :: any()

Return the response score based on the body

Link to this function

get_responses_by_week_and_day(org_id, week, day)

View Source
@spec get_responses_by_week_and_day(non_neg_integer(), non_neg_integer(), String.t()) ::
  any()

Get response message based on day and week

@spec hourly_tasks(non_neg_integer()) :: any()

Hourly task jobs for the ArogyaWorld

@spec initial_load(non_neg_integer()) :: any()

Run this function on the initial load

Link to this function

load_participant_file(org_id, week_number)

View Source
@spec load_participant_file(non_neg_integer(), non_neg_integer()) :: any()

load participant files from gcs

Link to this function

message_hsm_mapping(file_url, org_id)

View Source
@spec message_hsm_mapping(String.t(), non_neg_integer()) ::
  {:ok, any()} | {:error, Ecto.Changeset.t()}

message mapping to HSM UUID

Link to this function

question_hsm_mapping(file_url, org_id)

View Source
@spec question_hsm_mapping(String.t(), non_neg_integer()) ::
  {:ok, any()} | {:error, Ecto.Changeset.t()}

question mapping to HSM UUID

Link to this function

response_score_mapping(file_url, org_id)

View Source
@spec response_score_mapping(String.t(), non_neg_integer()) ::
  {:ok, any()} | {:error, Ecto.Changeset.t()}

response to score mapping

Link to this function

static_message_schedule_map(file_url, org_id)

View Source
@spec static_message_schedule_map(String.t(), non_neg_integer()) ::
  {:ok, any()} | {:error, Ecto.Changeset.t()}

creates the static data map that needs to be sent to users

@spec template(integer()) :: binary()

get template form EEx without variables

Link to this function

template(template_uuid, variables)

View Source
@spec template(integer(), String.t()) :: binary()

get template form EEx based on variables

Link to this function

trigger_condition(trigger)

View Source
@spec trigger_condition(Glific.Triggers.Trigger.t()) :: boolean()

Conditionally execute the trigger based on: ID, Week, Day.

Link to this function

upload_participant_responses(org_id, week)

View Source
@spec upload_participant_responses(non_neg_integer(), non_neg_integer()) :: any()

Create a file in GCS bucket for candidate response

@spec webhook(String.t(), map()) :: map()

Webhook functions for the ArogyaWorld