Giter Site home page Giter Site logo

googlecloudplatform / deviceconnect Goto Github PK

View Code? Open in Web Editor NEW
24.0 17.0 29.0 4.02 MB

https://deviceconnect.readthedocs.io/

License: Apache License 2.0

Dockerfile 0.15% Shell 0.09% Python 6.41% CSS 79.41% HTML 12.02% HCL 1.93%
bigquery fitbit gcp cloudrun

deviceconnect's Introduction

youtube link

Device Connect for Fitbit uses Google Cloud and Fitbit web apis to enable developers to build clinical health applications that leverage data from users' Fitbit activity trackers. The tools provided in this repo are open source and build upon the Google Cloud services. These tools provide:

  • end-user enrollment, consent management and Fitbit device linking,
  • a data connecter that ingests data from the Fitbit web apis and pushes to Cloud BigQuery,
  • looker dashboards for visualizing participants data in specific or in aggregate.

Deploy the infrastructure to capture your patient's fitbit data in minutes using the provided terraform scripts. Simply create your GCP project, install terraform, and run terraform apply.

The infrastructure uses Cloud Run and Fire Store to manage user enrollment and consent; and Cloud BigQuery to store data from the Fitbit webapis. Once the data is in BQ, build dashboards with Looker (or other dashboarding tool), and develop ML models with AI Notebooks or Vertex AI (tutorials coming).

Dashboards

The Fitbit data provides a unique 360-degree view of the patients' lives and can be clinically valuable for physicians or health coaches. It can also be integrated with other datasets like EHR data, or other device data.

Here are some dashboard views that might be valuable:

  • the first view shows overview of stats. In this case, the patient's Fitbit data has been enriched with the date of a past surgury. It shows the percent of time she is wearing the Fitbit device, along with overall statistics.

    user steps dashboard

  • Furter details about steps can also identify potential problems to recovery.

    user steps dashboard

  • and more details about types and range of activity show more details for the clincial teams:

    user steps dashboard

  • or more details on sleep:

    user steps dashboard

Machine Learning

While the dashboards can provide valuable insights about the patient's day to day, more detailed models can be developed that provide both population-level clustering across a patient population, and more predictive models that can help clinical teams identify address problems early.

Fine Print

  • First and foremost, this is not a product! there is no support. This is provided as is, with no warrantees, as an example. Use at your own risk. post issues if you run into any, fork and develop if it is useful for your needs.
  • By default, the code uses OIDC for user identities (seperate from Fitbit identities). The deployment instructions use Google OIDC but any OIDC can be configured.
  • Data is ingested daily by default (you can configure the Cloud Scheduler component, see Terraform scripts). This is not intended for real-time use cases.

deviceconnect's People

Contributors

lila avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deviceconnect's Issues

Data not ingested when language is not English

Description

My Fitbit application was set for Portuguese (Brazil) in the "Language by region/country", so the Device Connect was trying to capture the fields in English and it returned nothing. Changing this setting and registering myself again worked fine.

Screenshots

The screenshot below shows the empty fields, even with data collected by the device and the difference when the Language setting was changed.
data_filled

To Reproduce

  • Go to the Fitbit application (mobile) of the account you are collecting data;
  • In your Account > Third-party apps > Manage third-party apps;
  • Go to Settings > Personal Info > Language by Region/Country and change it to other than English (in my case, it was Portuguese)

add terraform for deployment

This code currently requires CloudRun, Firestore, Bigquery, and CloudScheduler to be configured to run. Having terraform scripts would make it easier to deploy into GCP.

exception occured: (missing_token) Missing access token parameter.

The token exists on firestore, but the following error occurs when the weekly data cannot be retrieved. The data cannot be retrieved even after the day when it cannot be retrieved.
Please let me know how to deal with this.

error message
exception occured: (missing_token) Missing access token parameter.

data can be missed

With the current approach -- with daily ingestion of data from the previous day -- data may be missed if the data has not been synced to the fitbit backend when the processes pull the data. One problem is that in general, the data may be missing

  • because it does not exist, for example, if the battery has died no data would be generated.
  • or the data may have been generated, but until the mobile phone app syncs the data, it won't show up on the backend web apis.

Similarly, if data is ingested multiple times, does the data get overwritten, or appended only?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.