Working on your dashboard
Writing queries to interact with Analytics DB
When creating a new dashboard, you'll begin with an empty panel, as shown below:
Step 1: Deciding between "Builder" and "Code" Mode
To start writing queries, you can select between:
- Builder Mode: Use when you want a quick and easy way to set up basic queries or configurations without needing to know the query language in detail.
- Code Mode: Use when you need to customize your query beyond what the Builder allows or when you want to fine-tune specific elements that require more precise control.
The Builder mode provides a graphical interface for constructing queries or designing dashboards.
It is a user-friendly option with drop-down menus, input fields, and visual representations to help users build complex queries or configurations without having to write raw code.
Builder mode is great for those who prefer a more visual approach or are less experienced with query languages or coding.
For example:
You cannot edit the query, for that you need to use "Code" mode.
The Code mode is for directly editing the underlying code or query associated with a panel or dashboard.
In this mode, you have direct access to the query language syntax (In our case postgras), and you can type out the full query manually.
Code mode offers more flexibility and control, allowing you to write more complex queries or custom configurations that may not be achievable through the Builder mode.
For this reason, we recommend using Code mode in order to take advantage of BioT's full capabilities.
Step 2: Writing Queries
Once you're in the "Code" tab, you can write SQL queries to pull data from the Analytics DB.
For example, to retrieve all device IDs, use the following query:
SELECT "_id"
FROM "AnalyticsDB"."DeviceType1_device"
Executing this query will display results like the screenshot below:
You can find more details on how to interact with the Analytics DB, here.
Access Control Rules
Viewing data in Grafana is controlled by the user’s access token.
Permissions are granted based on the organization:
• Organization users: Can only view data from their own organization,excluding PHI.
• Caregivers: Have access to all data within their organization, including PHI.
• Manufacturer organization users: Can view all data across all organizations, excluding PHI.
• Developer users: Have access to all data, including PHI.
• Patients: Access is denied.
Please refer to the table below for a detailed list of permissions.
Updated 10 days ago