Best Practice for Setting up Reporting in a Custom Module

@mseaton @darius @raff (Mentor) & @judeniroshan (GSOC Student) I am taking a tangent from [GSoC-2017] : Built-In Reports for Reference Application:

However I would like to use the project to show best practices for setting up and organizing reporting in a custom module. Is this the recommended way to setup reporting in a module:

  1. How are reports setup and configured

  2. How to setup and use definition libraries

  3. Renderers CSV, Excel

  4. Row Per Patient and Indicator Report

  5. Calculations - when to use these over data set definitions

  6. How do I build re-usable reports? In our case (UgandaEMR) we have two different age disegregations that need to be applied

  7. Is the legacy UI reporting setup the way into the future? How can I expose the definitions in a consistent manner

More will come along … I have colleagues who are building a brand new reporting functionality hence any answers will form part of the experiment and outcome documentation.

1 Like

@ssmusoke, I do think that module provides a reasonable set of best practices, as they currently exist. It demonstrates how to add custom definitions, how to add your own libraries, how to set up reports automatically.

Longer term, I personally would like to see us shift our focus to enabling more to be defined outside of java code, and in more configuration files. We have taken some tentative steps in this direction but it is by no means complete.

Nothing that exists in the legacy UI can really be considered the way into the future. What aspects are you referring to specifically?


@mseaton I am very interested in the move to configuration files

  1. What can be defined in configuration files?

  2. How can I use them to get to a report - I suppose row-per-patient may be easier than indicator reports

  3. How can I use existing definitions, cohorts etc to build new reports - which is what the Legacy UI does for now


  1. @darius did the initial implementation of config-file based definition libraries. Have a look at this ticket for some context. Clearly we need to improve reporting documentation.

  2. No ready-made tool for this yet. I’d love to have this in the refapp. The closest thing to being able to do this with definition libraries for Row Per Patient reports is in the Ad Hoc Analysis tool that comes with the reportingui module. Again, @darius did most of the initial work on this.

  3. Also no ready-made tool for this yet. I’d love to have this as well.