Generic reports/exports

I was scanning through some of the ‘canned reports’. Some of them seem already very specific and could be used as a blueprint for us to come up with new ones.

I know that reporting in general can be a difficult topic, but in my experience is also often a moving target. It is hard to think of and define all the reports upfront; additions/changes are almost inevitable.

We’ve had some success with providing a few different flavours of generic data exports. These exports could then be further processed outside of the OpenMRS world. E.g. by filtering and aggregating data in Excel.

At a glance I couldn’t spot an obvious generic report and I just want to check if I could avoid this. Do you already have kind of generic reports implemented somewhere?

Hi @cine,

We do have ways to provide custom (generic?) reports using custom SQLs. Right now it is very basic, in the sense that it will only show data which a SQL query can output.

For e.g. please take a look at “genericOutpatientMorbidity” in https://github.com/Bhamni/default-config/blob/master/openmrs/apps/reports/reports.json

Thanks,

It is difficult to explain this over email, but let me try.

Our goal is to provide two types of reports for each important entity Obs, Patient, Drug Order, Diagnosis, etc. They are count and actual data. I agree that some of the data ones, became quite specific because of the presentation used.

There is going to small change in our approach here. Bahmni reports would just provide raw data and the custom excel (macro, formula) would be used for presentation - which would be driven by implementation specific excel files.

Is this in any way using the openmrs reporting module under the hood? :slight_smile:

It uses DynamicReports http://www.dynamicreports.org/, JasperReports and Plain SQL.

What is the recommended way to add a custom report (so that it also shows up in the list of all reports)?

Adding this block to reports.json doesn’t work for me:

"genericWbaRegister":{
    "name": "Patient Register",
    "type": "MRSGeneric",
    "config": {
        "sqlPath": "/Users/xian/projects/pih-sierraleone/wellbody-config/openmrs/apps/reports/sql/wba_register.sql"
    }
},

Hi @cine,

This seems like a correct block. This should have worked.

Looking at https://github.com/PIH/wellbody-config/blob/master/openmrs/apps/reports/reports.json , does “Generic Outpatient Morbidity” shows in reports list?

Yes, the Generic Outpatient Morbidity report shows up. And when I plug my SQL report into it, it also works.

But I was hoping to have a new/additional report showing up in the list of available reports; in my example a ‘Patient Register’ (I didn’t commit this yet).