Document toolboxDocument toolbox

mPower Visualization

Nightly Precompute Job

Owner: Chris Bare

JIRA: BRIDGE-1112 - Getting issue details... STATUS

  • Nightly job to read the data from Synapse and pre-compute the visualization data for all PD users (non-control, on meds).
  • This job should run nightly after Bridge-EX. Bridge-EX runs at 10am UTC (2am PDT, 3am PST) and takes about 15 minutes. This job should run after that.
  • The data will be written to Bridge. See next section for Bridge API and data format.
    • Bridge should be called with yesterday's date. (For example, if you're running the nightly job in the morning of 2016-02-10, you're processing 2016-02-09's data, so you should call Bridge with date 2016-02-09.)

OPEN QUESTION: We don't have an R or Python client for Bridge Server. Will the Precompute Job call the REST API directly? Or should we write the Precompute Job in Java so we can use the Java SDK? Or should we take a different approach to writing visualization data to Bridge?

Bridge API

Owner: Dwayne Jeng

JIRA(s):

BRIDGE-1113 - Getting issue details... STATUS - write

BRIDGE-1114 - Getting issue details... STATUS - read

Write mPower Visualization Data

URL: POST /parkinson/visualization

Body:

{

  "healthCode":"d9c31718-481f-4d75-b7d8-49154653504a",

  "date":"2016-02-09",

  "visualization":{

    "standingPreMedication":0.8,

    "standingPostMedication":0.9,

    "tappingPreMedication":0.4,

    "tappingPostMedication":0.6,

    "voicePreMedication":0.7,

    "voicePostMedication":0.8,

    "walkingPreMedication":0.5,

    "walkingPostMedication":0.8

  }

}

(NOTE: The above healthCode is a spoof healthCode and the data is randomly generated data. It does not correspond to any real user.)

Response: 201 CREATED

Notes: This will be called with a Bridge worker account that the Precompute Job has credentials to. Note that this will require adding a new type of account to Bridge.

Read mPower Visualization Data

URL: GET /parkinson/visualization?startDate=2016-02-06&endDate=2016-02-08

Response:

{

  "2016-02-06":{

    "standingPreMedication":0.8,

    "standingPostMedication":0.9,

    "tappingPreMedication":0.4,

    "tappingPostMedication":0.6,

    "voicePreMedication":0.7,

    "voicePostMedication":0.8,

    "walkingPreMedication":0.5,

    "walkingPostMedication":0.8

  },

  "2016-02-07":{

    "standingPreMedication":0.4,

    "standingPostMedication":0.9,

    "tappingPreMedication":0.6,

    "tappingPostMedication":0.7,

    "voicePreMedication":0.5,

    "voicePostMedication":0.9,

    "walkingPreMedication":0.4,

    "walkingPostMedication":0.5

  },

  "2016-02-06":{

    "standingPreMedication":0.6,

    "standingPostMedication":0.9,

    "tappingPreMedication":0.1,

    "tappingPostMedication":1.0,

    "voicePreMedication":0.2,

    "voicePostMedication":0.8,

    "walkingPreMedication":0.4,

    "walkingPostMedication":1.0

  }

}

Notes:

This API is called using the user's account and credentials. It returns the user's visualization data for the specified dates.

If the start and end dates aren't specified, this API defaults to returning yesterday's visualization data.

The dates must be within 45 days of each other, or the server will throw a 400 Bad Request.

OPEN QUESTION: Should this return as a map or a list? Joshua notes that some JSON libraries don't preserve the order of JSON keys. ALX: It's trivial to sort the object's keys, which are date strings.

Map example:

{

  "2016-02-07":{

    // stuff

  },

  "2016-02-08":{

    // stuff

  },

  "2016-02-09":{

    // stuff

  }

}

List example:

[

  {

    "date":"2016-02-07",

    "visualization":{

      // stuff

    }

  },

  {

    "date":"2016-02-08",

    "visualization":{

      // stuff

    }

  },

  {

    "date":"2016-02-09",

    "visualization":{

      // stuff

    }

  }

]

HTML Report

Owner(s): Chris Bare / Alx Dark

JIRA: BRIDGE-1115 - Getting issue details... STATUS

  • HTML page that lives in Bridge (in S3).
  • Apps will fetch this page and pass in Bridge-Session header, which this page will forward to Bridge. This page calls Bridge Server's get visualization API to populate the page.
  • Contains disclaimer, instructions, and 2 views.

App Changes

Owner(s): Shannon Young / Erin Mounts

JIRA: BRIDGE-1116 - Getting issue details... STATUS

  • mPower app to download the HTML page and immediately save it as a PDF.
  • mPower to pass in the Bridge-Session header to the HTML page so the HTML page has access to the user's data.
  • User can share the PDF as needed.

Misc

JIRA: BRIDGE-1117 - Getting issue details... STATUS - end-to-end validation