KenyaEMR Reports Development
This is a brief guide for developers who wish to develop reports for KenyaEMR. KenyaEMR relies on the Reporting Module to provide cohort and indicator reports. All reports are implemented in code and it is not expected that implementers will create their own reports through the web interface. In many cases, the Kenya Core module provides abstractions for much of the necessary functionality from the reporting module. As such, KenyaEMR report developers need to be aware of these abstractions in addition to familiarity with the underlying reporting framework. Reports may either be provided through the KenyaEMR module itself or through add-on modules.Â
Step-by-step guide (Cohort Reports)
Cohort reports are typically patient listings containing patients with similar characteristics, for example, the list of all patients who missed their last appointment. Cohort reports in KenyaEMR are implemented through Calculations. They are much simpler to implement than indicator reports since they are generally built using the same, generic report builder.Â
Steps:
Create a patient calculation for your cohort. A patient calculation is any implementation of the PatientCalculation class. You might find it useful to extend BaseCalculation or AbstractPatientCalculation. See example.
Define your report in the application context by defining a ReportDescriptor object. Make sure to configure the calculation member variable to point to the calculation defined above. See example.
Configure your report in the application context by defining a ReportConfiguration object. See example.
Include your report in the UI adding it to the page model through a controller. See example.
Step-by-step guide (Indicator Reports)
Indicator reports are lists of indicators, where the indicators are simply aggregations of cohorts. An example of an indicator could be the total number of patients who missed their appointment in a given month. Indicator reports are typically tied to a reporting period, usually one month.
Steps:
Create a cohort library. A cohort library is simply an ordinary Java class with methods that return CohortDefinitions. See example.
Create an indicator library. And indicator library is also an ordinary Java class with methods that return CohortIndicators. Indicator libraries rely on the cohorts defined in associated cohort libraries. See example.
Create a report builder. A report builder is an implementation of the ReportBuilder interface. The ReportBuilder interface has an abstract class implementation called AbstractReportBuilder and in most cases you should inherit from this rather than create a direct implementation. Report builders must be annotated with a @Builds annotation, which tells the builder which report(s) it is responsible for building. See example.
Define your report in the application context by defining a ReportDescriptor object. See example.
Configure your report in the application context by defining a ReportConfiguration object. See example.
Include your report in the UI adding it to the page model through a controller. See example.
Note:
There is no guarantee that the example links above will always work as advertised. Please let us know whenever they are broken or happen to point to irrelevant content.
Related articles
Filter by label
There are no items with the selected labels at this time.