Building custom reports
Details on how to creating your own reports using Metabase, and the reporting tables.
Metabase
Metabase is a tool that allows us to explore the data in Simple, and build reports without engineering support. If you are new to Metabase, you can start with one of our predefined templates, and explore further from there.
Alternatively, you can just click on "Ask a new Question", and choose "Custom Question". You can refer to Metabase's own documentation for a better understanding of how to use the query building interface.
Once you have generated a report, you can save it, share it with others, or even download the data to further analyse as spreadsheets or in other contexts.
Metabase is available for the following Simple environments.
Environment | URL | Purpose |
Production India | India’s IHCI program | |
Production Bangladesh | Bangladesh’s NHF hypertension control program | |
Production Ethiopia | Ethiopia's MOH hypertension control program | |
Production Sri Lanka | Sri Lanka's MOH hypertension control program | |
Sandbox | A stable playground for the Simple team to work in |
Quickstart
If you're already familiar with Simple's data model and Metabase, you can get started with this quick demo.
Getting Started
To get started, open up the custom report template. Template links are provided below.
Bangladesh: https://metabase.bd.simple.org/question/46
1. Open the template
To start writing your custom report, click on the “Show Editor” button shown below.
This will open the report editor. It will look something like this. The key features are labeled in the image below.
As is, this template generates a monthly report of cumulative hypertensive patients assigned per district in a single state over the last 24 months.
2. Filter the results
Add filters to the purple “Filter” section to limit the report to what you care about. For example, if you want a monthly cumulative report of controlled patients in this state, add the following filter:
Htn Treatment Outcome in Last 3 Months = controlled
See the Reference at the end of this document for a full list of options.
3. Group the results
You can modify the green “Summarize” section on the right to add more facets to segment the results. For example, you can break down the results by facility by adding the following grouping:
Assigned Facility Slug
See the Reference below for a full list of grouping options.
Read on further to understand the data in each of the reporting tables you can access in the questions on Metabase.
Key Reference
The following are the key properties that can be used to filter and group the report’s results in the purple “Filter” section.
Field name | Field description |
| The reporting month |
| The organization, state, district, block, or facility that the patients are assigned to. |
| The organization, state, district, block, or facility that the patients were registered in. |
| Is the patient diagnosed with hypertension? (yes/no) |
| Is the patient diagnosed with diabetes? (yes/no) |
| Is the patient under care, lost to follow-up, or dead |
| Patient’s controlled status based on the last 3 months. Possible values are:
|
| Months since the patient’s registration, as of the reporting month |
| Months since the patient’s last visit (with or without a BP), as of the reporting month |
| Months since the patient’s last BP measure, as of the reporting month |
Tips & Tricks
Registrations
To run a report on registrations, add the following filter to the purple “Filter” section.
Months since registration = 0
Multiple filters
If you want to run a report that includes multiple filters such as controlled patients, uncontrolled patients, missed visit patients, in a single report, you can use a grouping instead of a filter. Group by the appropriate property in the green “Summarize” section.
For example, to generate a report of controlled, uncontrolled, visit-but-no-bp, and missed-visit patients, add the following grouping:
Treatment Outcome In Last 3 Months
Enriching results
Sometimes, you want to run a report where results are grouped by facility, but you also want block and district information next to each facility. In order to do so, simply add block and district as additional groupings in the green “Summarize” section, and they will be shown in the results.
The results will have block and district information next to each facility.
Detailed Reference
Overview of the reporting tables
The following table is a summary of each of the reporting tables, and what they contain. Please refer to the sections below for details of the columns in each of these tables.
Table Name | Description | Contents |
| Summary of a patient’s latest blood pressure | One row per patient, per month, from the month of the patient's registration. |
| Summary of a patient's latest visit where they had a BP/Sugar recording, an appointment, or a prescription drug refilled | One row per patient, per month, from the month of the patient's registration |
| Summary of a patient's health information and computed hypertension indicators. | One row per patient, per month, from the month of the patient's registration. |
| Summary of a facility’s registrations, treatment outcomes, and patients under care | One row per facility, per month, for all months since 2018 |
| A facility’s quarterly treatment outcomes | One row per facility, per quarter, for all months since 2018 |
How the reporting tables are created
The reporting tables are building blocks that are built on top of raw data. The following diagram illustrates which raw tables they are based on, and how we build larger even building blocks from these tables.
Raw data tables: Data as recorded in the app goes into the transactional, or raw tables as seen in the first section of the diagram. These rows have all the detailed information collected as and when the nurse syncs the data via the Simple app. These tables have billions of rows, and are not well suited for querying reports.
Reporting tables: These are summarised tables created from the raw data tables for ease of creating reports. The summaries can be per-patient-per-month, or per-facility-per-month. Please refer to the above diagram for the description of each table.
Dimension tables: We can use these tables along with other reporting tables to filter and disaggregate data across time and geographical regions.
Description of the data
Detailed schema of the reporting tables
You can browse through the detailed schema on github, or on metabase.
Last updated