Reporting module - new Data Set Definition

1 view
Skip to first unread message

Anies Padda

unread,
Apr 22, 2014, 4:08:59 PM4/22/14
to d...@openmrs.org
I am interested in experimenting with a new data set definition in the reporting module. I have seen some of the existing conversations within the group on this topic but I am nonetheless struggling with how one would implement a new definition. The lack of documentation is making this somewhat difficult as I am having difficulty inferring the functionality of the methods.

Perhaps somebody could provide me with a basic explanation of the Row-Per-Patient Definition? Or, alternatively, given the functionality of the Row-Per-Patient definition it might be more helpful instead to have someone provide a (high level) explanation of how this would be changed for something like a Row-Per-Diagnosis or similar concept class definition or similar.

Darius Jazayeri

unread,
Apr 24, 2014, 8:58:56 PM4/24/14
to dev
Hi Anies,

Very briefly, assuming that you are doing this is code, you would do:

dsd = new PatientDataSetDefinition()

If you want to limit to a specific subset of patients, you would do something like

females = new GenderCohortDefinition();
females.setFemaleIncluded(true);

dsd.addRowFilter(females, null);

Then you need to add a "patient data definition" for each column that you want included in the dataset. Like:

dsd.addColumn("internal patient_id", new PatientIdDataDefinition(), null);

Here is an actual example:



There are implementations in the reporting module for row-per-patient, -encounter, and -obs (if I remember off the top of my head). Looking at the encounter or obs ones should show a pattern that can be copied to other domain objects.

If you specifically want row-per-diagnosis, I would assume the right thing to do is row-per-obs, where the rowFilter specifies the concept for your diagnosis concept set. An analogous example (for dispensing, where each dispensed med is an obsgroup) is here: https://github.com/PIH/openmrs-module-mirebalaisreports/blob/master/api/src/main/java/org/openmrs/module/mirebalaisreports/definitions/FullDataExportReportManager.java#L256

-Darius


On Wed, Apr 23, 2014 at 5:08 AM, Anies Padda <paddasp...@gmail.com> wrote:
I am interested in experimenting with a new data set definition in the reporting module. I have seen some of the existing conversations within the group on this topic but I am nonetheless struggling with how one would implement a new definition. The lack of documentation is making this somewhat difficult as I am having difficulty inferring the functionality of the methods.

Perhaps somebody could provide me with a basic explanation of the Row-Per-Patient Definition? Or, alternatively, given the functionality of the Row-Per-Patient definition it might be more helpful instead to have someone provide a (high level) explanation of how this would be changed for something like a Row-Per-Diagnosis or similar concept class definition or similar.

--
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/

Reply all
Reply to author
Forward
0 new messages