Reporting Module - Adding new data set definition

0 views
Skip to first unread message

Myles Barros

unread,
Apr 15, 2014, 10:39:39 AM4/15/14
to d...@openmrs.org
I'm currently investigating the possibility of adding a new data set definition. I have walked through the codebase available on GitHub and have identified three classes that must be in place for each data set definition in the module: an Evaluator class, a Data Set Definition class, and an Indicator Result class. I am experiencing difficulties, however, in that I have been unable to determine where these classes are actually employed within the codebase, as they don't appear to be instantiated anywhere. In fact, I haven't even been able to find situations where they are used as instance variables, and so they are not being autowired.

My question, then, is what is the connection between the data set definitions in the Reporting module and the actual code on the ground?

Darius Jazayeri

unread,
Apr 15, 2014, 11:35:18 AM4/15/14
to dev
Hi Myles,

The general idea is that the Reporting module provides a framework, but implementations create their actual report definitions via the UI or in code, and the CohortDefinitions, DSDs, etc, are instantiated in code via reflection, etc. That's why you won't see usage of those classes from the reporting module codebase.

Here's an example of how this are used in code in an implementation:

-Darius


On Tue, Apr 15, 2014 at 7:39 AM, Myles Barros <barro...@gmail.com> wrote:
I'm currently investigating the possibility of adding a new data set definition. I have walked through the codebase available on GitHub and have identified three classes that must be in place for each data set definition in the module: an Evaluator class, a Data Set Definition class, and an Indicator Result class. I am experiencing difficulties, however, in that I have been unable to determine where these classes are actually employed within the codebase, as they don't appear to be instantiated anywhere. In fact, I haven't even been able to find situations where they are used as instance variables, and so they are not being autowired.

My question, then, is what is the connection between the data set definitions in the Reporting module and the actual code on the ground?

--
OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/

Myles Barros

unread,
Apr 15, 2014, 11:52:02 AM4/15/14
to d...@openmrs.org
Hi Darius, thanks for the response.

I'm somewhat confused - I built the Reporting module using the code available on the module's GitHub page and, once loaded into an OpenMRS instance, it included the set of stock DSDs. How would that then be possible without auxiliary resources that I did not employ or having definitions for these DSDs within the module's codebase?

The answer should probably be self-evident but this seems to involve concepts foreign to me.

Darius Jazayeri

unread,
Apr 15, 2014, 12:05:59 PM4/15/14
to dev
Hi Myles,

Are you' referring to the fact that on this page there are already things listed in the left column?

The reporting module is aware of every class that implements DataSetDefinition, using reflection. So in the UI it shows them as possible things you could create, but no specific instances of them have been created. (In the link I sent, you'll see that there is a number 0 next to each of the types.)

-Darius

Myles Barros

unread,
Apr 15, 2014, 1:09:05 PM4/15/14
to d...@openmrs.org
Ah, thank you Darius, I understand now. A clever approach.

I appreciate your patience in explaining the process to me.


On Tuesday, April 15, 2014 12:05:59 PM UTC-4, Darius Jazayeri wrote:
Hi Myles,

Reply all
Reply to author
Forward
0 new messages