onnela-lab / beiwe-backend

Beiwe is a smartphone-based digital phenotyping research platform. This is the Beiwe backend code
https://www.beiwe.org/
BSD 3-Clause "New" or "Revised" License
62 stars 43 forks source link

Merge Data Access API and Tableau API credentials #365

Open biblicabeebli opened 4 months ago

biblicabeebli commented 4 months ago

These credentials are virtually identical, it was a mistake to separate them in the first place.

(Where did the original issue for this go? I remember making it.)

biblicabeebli commented 1 month ago

Update - I did this yesterday. The easiest way to do this was:

I've updated the manage credentials page accordingly, removed former access api management endpoints.

I'm currently doing cleanup and The Great Tableau Terminology Purge (some stuff still is referred to as tableau credentials).

biblicabeebli commented 1 month ago

Last week saw some cleanup, this is effectively finished, but we need to update documentation (I believe there are screenshots to be updated).

hydawo commented 1 month ago

@biblicabeebli since this is live on staging only, let's keep it there for now.

At our next RA meeting, I'll have an RA update screenshots/instructions in our various manuals.

IMPORTANT: we also need to update our Forest scripts keyring.py file which asks for both sets of credentials. I'm unsure the implications to that code with the merging of these credentials...

TLDR: do not launch on other servers besides staging until I confirm we are ready. Moving this to Hassan's sprint

biblicabeebli commented 1 month ago

(This work and current state on staging is not considered production-ready.)

Old credentials will (should, if not that is a bug so please report it) continue to work, your old credentials will all still work.

We can also update the Keyring interface thing that Mano uses

biblicabeebli commented 1 month ago

This change seems to be working fine under all known circumstances, the remaining work is updated integration with Mano.

biblicabeebli commented 1 month ago

The tableau endpoint has been replicated (shared code and taking the exact same extensive filtering options) as a data api endpoint. The only difference between ...

I don't see this documented any where, so here is some official documentation for the endpoint (both of them):

The list of extra parameters available to both versions of this endpoint are:

The following is a comprehensive (subject to change as updates are made for forest and the Beiwe Backend) list of all fields available for response data filtering and sorting:

# study_id is required detail of your query, and though the endpoint may also accept it as a sorting field, such sorting behavior is undefined.
# timezone is not recommended as a sorting field

# Basic fields
date
study_id
participant_id
timezone

# data quantity metrics
beiwe_accelerometer_bytes
beiwe_ambient_audio_bytes
beiwe_app_log_bytes
beiwe_bluetooth_bytes
beiwe_calls_bytes
beiwe_devicemotion_bytes
beiwe_gps_bytes
beiwe_gyro_bytes
beiwe_identifiers_bytes
beiwe_ios_log_bytes
beiwe_magnetometer_bytes
beiwe_power_state_bytes
beiwe_proximity_bytes
beiwe_reachability_bytes
beiwe_survey_answers_bytes
beiwe_survey_timings_bytes
beiwe_texts_bytes
beiwe_audio_recordings_bytes
beiwe_wifi_bytes

# Forest Jasmine Tree output
jasmine_distance_diameter
jasmine_distance_from_home
jasmine_distance_traveled
jasmine_flight_distance_average
jasmine_flight_distance_stddev
jasmine_flight_duration_average
jasmine_flight_duration_stddev
jasmine_gps_data_missing_duration
jasmine_home_duration
jasmine_gyration_radius
jasmine_significant_location_count
jasmine_significant_location_entropy
jasmine_pause_time
jasmine_obs_duration
jasmine_obs_day
jasmine_obs_night
jasmine_total_flight_time
jasmine_av_pause_duration
jasmine_sd_pause_duration

# Forest Willow Tree output
willow_incoming_text_count
willow_incoming_text_degree
willow_incoming_text_length
willow_outgoing_text_count
willow_outgoing_text_degree
willow_outgoing_text_length
willow_incoming_text_reciprocity
willow_outgoing_text_reciprocity
willow_outgoing_MMS_count
willow_incoming_MMS_count
willow_incoming_call_count
willow_incoming_call_degree
willow_incoming_call_duration
willow_outgoing_call_count
willow_outgoing_call_degree
willow_outgoing_call_duration
willow_missed_call_count
willow_missed_callers
willow_uniq_individual_call_or_text_count

# Forest Sycamore Tree output
sycamore_total_surveys
sycamore_total_completed_surveys
sycamore_total_opened_surveys
sycamore_average_time_to_submit
sycamore_average_time_to_open
sycamore_average_duration

# Forest Oak Tree output
oak_walking_time
oak_steps
oak_cadence
biblicabeebli commented 1 month ago

@hydawo you might want the above comment