Help with Implementation Configured dataset definitions

Application Name: Reference Application Version Number: 2.4 System Config: Tomcat7, Java 7 Ubuntu 14.04

Hi Everyone,

I’m working on documenting the new feature that allows us to dynamically load the .sql dataset definitions in the OpenMRS reporting module v10.1 as per REPORT-761. SQL data set definitions aren’t loading into the reporting module.


  • Added the folders to the OpenMRS APP_DATA directory (/usr/share/tomcat7/.OpenMRS/) – Resulting in the following folder: /usr/share/tomcat7/.OpenMRS/configuration/reporting/definitionlibraries/dataset
  • Added a file named patientId.sql with code “select patient_id from patient;”
  • Changed ownership on all folders with sudo chown -R tomcat7:tomcat7 /usr/share/tomcat7/.OpenMRS/
  • Started OpenMRS using sudo service tomcat7 start
  • Looked for the Data Set Definitions under the Reporting Module UI and nothing shows up.


  • Am I doing the right thing?
  • Is it correct to assume that each SQL file should show up as a SQL DataSet on this page?

@darius @mseaton @jamesfeshner

@craigappl I peeked at some of the underlying code and I have a guess at what the problem might be.

To test it out, can you try doing this process to create a Cohort Definition (instead of a Data Set Definition) and see if that shows up in the UI?

Also, you can check your logs for the output of this line.

Hi @darius

I’m not able to get it to work. I tested this on Reference App 2.5 with .sql and .groovy files in both the dataset and cohort configuration folders. I don’t see the log line about pulling in the data and I don’t see anything in the UI.

Can you point me in a good direction for a next step?

Thanks, Craig

Hmm, 23 days ago I had a guess at the problem, but I can’t remember what it was anymore. (Reading what I wrote, I must have suspected that they are being properly loaded for cohort definitions, but not for data set definitions.)

But since your logs never show that file being loaded, the error must be earlier in the process.

Any chance you can run this under a debugger with the reporting module code checked out, put a breakpoint at this line, and see what directory it’s expecting?

(If not, make sure that the level of debugging output for the reporting module is at least INFO level to be sure we’re not just missing the message for that reason.)