Reporting Module Examples

Ideas and notes on real examples of reports built with the Reporting module.

Examples

Program enrollment outcome (PIH Malawi)

Program enrollments together with Workflows can indicate the current status of a patient for a specific medical problem like HIV or TB. Using this information to provide regular feedback to the medical staff can help improve medical care. The following example is rendered by Excel:

This report can be created using the UI of the Reporting Module 0.4.1.9+.

Note: To simplify its setup, testing, and running, the creation of all report elements was done via a Java script (Source in SVN).

Missed appointments (PIH Malawi)

If OpenMRS is used to keep track of patient appointments, a status overview of missed appointments is useful:

This report can be created using the UI of the Reporting Module 0.4.1.9+.

Note: To simplify its setup, testing, and running, the creation of all report elements was done via a Java script (Source in SVN ).

Best practices

Scripting Setup of Reports

The Reporting module already provides a generic UI to define and view reports. Even though this is conducive to an adhoc approach, it is also "click-intensive". These reports are also bound to a specific OpenMRS database installation (unless clever ways of myqldump and -load are used). If reports need to be

  • version controlled,
  • shared between different installation (like test and production env), or
  • adopted for slightly different use cases while maintaining the general structure,

then it might make sense to externalize the creation of the various report elements. Besides the UI, everything is accessible through the Java-API. With some Java knowledge, the creation of Cohort queries, Indicators, and Report Definitions can be scripted.

The running of reports can be done in two different ways:

  1. Through a module, which provides the Administration feature to set up (and remove) report elements (good for production systems).
  2. Through a (misused) Junit testcase, which can easily be invoked from the local development environment (good for development and testing).

An example can be found in the PIH Malawi module (Source in SVN). Please note that this is tailored to the needs of PIH Malawi, but it can serve as a blueprint for other installations.