Reporter - Sage-Bionetworks/BridgeWorkerPlatform GitHub Wiki

This guide assumes you are familiar with Bridge and Synapse, and that you have already followed or are concurrently following the BridgeWorkerPlatform Getting Started guide.

Testing the Reporter

  1. Ensure the Bridge Server (and its dependencies such as Redis and MySQL) and the Worker Platform are both running.

  2. In the AWS console, go to Simple Queue Service (SQS), select the queue your Worker Platform reads from, and send the following message:

     {
       "service":"REPORTER",
       "body":{
         "scheduler":"[schedule name]",
         "scheduleType":"DAILY",
         "startDateTime":"2016-09-20T0:00-0700",
         "endDateTime":"2016-09-20T23:59:59.999-0700",
         "studyWhitelist":["api"]
       }
     }
    

    Schedule name is the unique name for this series of reports. Example names might be "Bridge-Reporter-Scheduler-prod" or "Bridge-Reporter-Scheduler-dev-daily-signups".

    Schedule type includes "DAILY" (aka daily uploads), "WEEKLY" (aka weekly uploads), or "DAILY_SIGNUPS". For more information, see the codebase.

    start- and endDateTime are the time range you want to run the report on (inclusive). Note that even though the report types are "daily" and "weekly", for testing purposes, they can be any arbitrary time range.

    The studyWhitelist is optional, but specifying it allows you to target just the study you want to export rather than exporting all studies in your local Bridge env. This is useful if you have a lot of studies.

  3. To view the report, sign in to Bridge with any authenticated user and make a GET /v3/reports/(reportId)?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD.

    • reportId is in the form (schedule name)-(suffix). The suffixes for the three report types are "daily-upload-report", "weekly-upload-report", and "daily-signups-report". For example: "Bridge-Reporter-Scheduler-prod-daily-upload-report" or "Bridge-Reporter-Scheduler-dev-daily-signups-daily-signups-report". (Note: These names are long strings of nonsense. We should fix these up. See https://sagebionetworks.jira.com/browse/BRIDGE-2088)
    • startDate and endDate are calendar dates in YYYY-MM-DD and are inclusive.