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.
Please note the following user permissions:
• Manufacturer/Organization Admins: Cannot access PHI (Protected Health Information).
• Caregivers: Can only access data associated with their organization.
• Patients: Have no access to data.It is the query creator’s responsibility to ensure that the appropriate permissions are respected when viewing PHI details.
Updated about 1 month ago