Error running Cohort Queries on Reporting Modules

Hi everyone! I am using openmrs 2.2.1 and reporting module 1.21.0. I am getting the same error on my openmrs that I get on trying to run sql cohort queries in reporting module. The simple queries I have try are “Select patient_id from patient;” and “Select count(patient_id) from patient;”. This is the error I get from

Switch to the latest release of the reporting module.

I have try the latest release of reporting module I still got the same error.

Are you able to reproduce it here? OpenMRS - Home

I still get the same error running the queries on this test server OpenMRS - Home

Share a link to it on dev3

I thought that you are to get a list of patients, just like the rest of the queries, instead of a total count.

Yes for the sql "select patient_id from patient; " I am supposed to get a list of patient id instead I get total number of patients. For the sql “select count(patient_id) from patient;” I get an error from the demo openmrs and my openmrs.

So if you create this as a cohort definition, the reporting engine will run the query and get a list of patient ids, but it’s just telling you how many patients were returned from your query. To actually get data on those patients, you need to setup a dataset definition, like here. Cohort definitions exist to define the cohort of patients that a data set will be evaluated against, but you also need a data set definition to tell the reporting engine what columns you want to see.

It might be helpful to review the reporting module documentation.

Ok I can get the list on dataset definition but I thought the results were supposed to be according to the sql statement.