UI-Defined Reports
Note on UI-Defined Reports
UI-Defined Reports are deprecated and no longer actively supported.
They may continue to work in some environments, but they are not recommended for new development and are used at your own risk.
Future enhancements, bug fixes, and documentation focus will be on the programmatic and configuration-based approaches.
This guide provides complete, hands-on tutorials for building the most common types of reports in OpenMRS using the UI.
Learn report building through three practical tutorials that cover the essential report types you'll need: a simple row-per-patient report for detailed patient lists, a period indicator report for monthly statistics and performance monitoring, and a custom cohort indicator report for flexible data analysis. Each tutorial walks you through every step from initial planning to testing the final report, giving you real-world experience with the complete report building process.
Tutorial 1: Simple Row-Per-Patient Report
This tutorial creates a report listing patients with basic demographic information.
Goal
Create a report showing: Patient ID, Name, Age, Gender, and Last Visit Date for patients from a specific location.
Step 1: Create Data Set Definition
Navigate: Report Administration → Data Set Definitions
Add New: Click "+" next to "Simple Patient Data Set"
Configure:
Name:
Basic Patient DemographicsDescription:
Patient list with demographics and last visit
Add Patient Properties:
Expand the dropdown next to “Person/Patient Properties”
Select “Fixed Value”
Add these properties one by one (Click "+" to add next):
patientId- Patient identifiergivenName- First namefamilyName- Last namegender- Genderbirthdate- Birth dateage- Current age
Save the data set definition
Step 2: Create Report Definition
Navigate: Reports Administration → Report Definitions
Add New: Click "Custom Report (Advanced)"
Configure:
Name:
Patient Demographics ReportDescription:
Basic patient information for specified location and date rangeClick “Save” (You have to go back to the Report Administration page to see the created report)
Step 3: Add Parameters
Go back to Report Administration and click on the edit icon
Add Location Parameter:
Click "+" next to Parameters
Type: Single → Location
Name:
locationLabel:
Facility Location
Step 4: Link Data Set to Report
Add Data Set:
Click "+" next to Data Set Definitions
Key:
demographicsData Set Definition: Select
Basic Patient DemographicsParameters: Map location and date parameters as needed
Save the report
Step 5: Test Your Report
Navigate: Reporting → Run a Report
Select: Your new
Patient Demographics ReportSet Parameters: Choose location
Run: Select Excel output format
Verify: Check that results match expectations
Tutorial 2: Period Indicator Report
This step-by-step tutorial will guide the user in making indicator reports, using a period indicator report as an example.
Goal
Create a report that only includes patients in the Heart Failure Program. The first question will be:
Percentage of men whose main job is farming
Step 1: Create Cohort Queries
Cohort 1: Male Patients
Navigate: Report Administration → Cohort Queries
Add: Click "+" next to "Gender Query"
Configure:
Name:
Male CohortDescription:
All male patients in the systemProperties:
Male = True (fixed value)
Female = False (fixed value)
Unknown = False (fixed value)
Save the cohort
Test: Click "Preview" and "Run" to verify patients exist
Cohort 2: Farmers
Navigate: Back to Cohort Queries page
Add: Click "+" next to "Coded Observation Query"
Configure:
Name:
Farmer CohortDescription:
Patients whose main occupation is farmingProperties:
Which Observation:
Fixed valueLast(to get latest occupation)observations with this question:
Fixed value:MAIN ACTIVITY(This is a fixed value, as you do not want to change the observation each time you run the report.)
Constraint:
Comparison:
IN(fixed value)Value:
Farmer(fixed value)
Save the cohort
Note: Leave 'When' and 'Other' blank - dates and location will be set by report parameters
This sets the observation of 'Main activity' to the value 'Farmer.' All of these fields are fixed values because we do not want the choice of changing what the cohort contains each time the report is run. We will leave the 'When' and 'Other' categories blank because the dates of observation and location will be set by the report parameters, which will be described in a later step.
Cohort 3: Heart Failure Program Patients
Navigate: Back to Cohort Queries page
Add: Click "+" next to "In Program Query"
Configure:
Name:
In Heart Failure ProgramDescription:
Patients enrolled in Heart Failure ProgramProperties:
Programs:
Heart Failure Program(fixed value)
Or Specifically:
Property: Parameter
Label:
effectiveDate
Save the cohort
Step 2: Create Indicators
We will now build the 'Farmers Indicator', which will return the percent of farmers in the Heart Failure Program at the report 'End Date' and in a specific location.
Farmers Indicator
Navigate: Administration → Indicator Definitions
Add: Click "Create Cohort Indicator"
Configure Basic Properties:
Name:
Farmers IndicatorDescription:
Percent of farmers in Heart Failure ProgramType:
Fraction(for percentage calculation)Standard Parameters: Check all three:
✓
startDate✓
endDate✓
location
Configure Location Filter:
Click "Edit mappings" for Location Filter
Set to:
Health Center LocationType: Parameter
Parameter Type:
Location
Configure Numerator:
Click "Edit mappings" for Numerator
CohortDefinition:
Farmer Cohort
Configure Denominator:
Click "Edit mappings" for Denominator
CohortDefinition:
In Heart Failure ProgrameffectiveDate: Parameter →
End dateNote: The numerator is automatically constrained by the denominator
Step 3: Create Dimensions
We will now create a dimension to restrict the Farmers Indicators to only males.
Gender Dimension
Navigate: Administration → Dimension Definitions
Add: Click "+" next to "Dimension"
Configure:
Name:
Gender DimensionDimension Option:
Key:
Males CohortCohortDefinition:
Male Cohort
Step 4: Create Period Indicator Report
Navigate: Report Administration
Add: Click "Period Indicator Report"
Configure:
Name:
Heart Failure ReportDescription:
Heart Failure Program performance indicatorsClick "Submit"
Add Dimensions:
Click "Add Dimension"
Key:
GenderCohortDefinitionDimension:
Gender Dimension
Add Filter:
Click "Edit mappings" under Filter
CohortDefinition:
In Heart Failure ProgrameffectiveDate: Parameter →
End dateThis ensures only Heart Failure Program patients appear in the report
Add Indicators:
Click "Add" under Indicators
Indicator Number:
1Label:
Percent of Male Farmers in Heart Failure ProgramIndicator:
Farmers IndicatorDimensions: Change Gender to
Males CohortClick "Save"
Step 5: Test and Refine
Run Report: Test with known data period
Verify Numbers: Cross-check with manual counts
Adjust: Modify cohort criteria if needed
Document: Add clear descriptions for users
Your Period Indicator Report is now complete!
Tutorial 3: Custom Cohort Indicator Report
This step-by-step tutorial will guide the user in the creation of a custom Indicator Report, using a Cohort Indicator with Dimensions Report as an example. This example will highlight how parameters are used in reports.
Goal
The first question in this report will be:
Number of People in the HIV Program at the endDate
Step 1: Build Cohorts
InProgramOnDate Cohort
We will now make our cohort, InProgramOnDate, which will contain patients in a specific program by the end date of our report.
Navigate: Administration → Cohort Queries (see Step 1 of Building a Period Indicator Report)
Add: Click "+" next to "In Program Query"
Configure:
Name:
InProgramOnDateDescription:
Patients in a specific program by end dateProperties:
Program: Parameter (allows choosing which program for each report run)
Or Specifically:
Label:
effectiveDateType: Parameter (allows selecting the date each time the report is run)
Save the cohort
You are now ready to create an Indicator.
Step 2: Build Indicators
In HIV Program Indicator
Navigate: Administration → Indicator Definitions
Add: Click "Create Cohort Indicator"
Configure Basic Properties:
Name:
In HIV Program IndicatorDescription:
Count of patients in HIV ProgramType:
Count(aggregate function will count the number of patients)Standard Parameters: Check
endDateClick "Submit"
Add Parameters:
Under "Parameters", click "Add"
Add the parameter
endDateso it can be passed in
Configure Cohort Definition:
Under "Cohort Definition", click "Edit Mappings"
Cohort Definition:
InProgramOnDateProgram:
Adult HIV Program(passed to InProgramOnDate program parameter)effectiveDate: Expression →
endDate - 1m(one month before the endDate)
You are now ready to build your data set definition.
Step 3: Build Data Set Definitions
HIV Data Set Definition
Navigate: Administration → Data Set Definitions
Add: Click "+" next to "Cohort Indicator with Dimensions Data Set"
Configure Basic Properties:
Name:
HIV Data Set DefinitionDescription:
Data set for HIV program indicators
Add Parameters:
Under "Parameters", click "Add"
Click the "endDate" shortcut link to automatically add it
Click "Submit"
Add Indicators:
Under "Indicators", click "Add"
Indicator Number:
#1Label:
Patients in HIV ProgramIndicator:
In HIV Program IndicatorParameter:
End DateClick "Submit"
Note: You can also add dimensions to the data set by clicking "Add" in the Dimensions box, but make sure you have built the necessary dimension before this step.
You are now ready to build your custom Indicator Report.
Step 4: Build Custom Indicator Report
HIV Report
Navigate: Administration → Report Definitions
Add: Click "Custom Report (Advanced)"
Configure Basic Properties:
Name:
HIV ReportDescription:
Custom HIV program indicator reportClick "Submit"
Add Parameters: