Application Name: Platform Version Number: 1.11.6
Problem Details: I’m trying to access a cohortquery in the Reporting module through the reporting REST web services module. I created a simple SQL cohort query that returns all the patients in the system (select patient_id from patient where voided = :void;) on int02.openmrs.org (cohortquery link) This query collects the ‘void’ parameter which should have a string value of ‘0’ or ‘1’. In the preview screen of the reporting module I see 2705 members of the cohort when I use the value void=0. I see 5427 results when void=1.
The next thing I do is test the reporting REST API thorough curl. The following command returns 2705 members where void=0 (matches the reporting module) curl -X GET --header ‘Accept: application/json’ ‘http://int02.openmrs.org/openmrs/ws/rest/v1/reportingrest/cohort/17df8f72-b059-4d5f-bc28-521752c34f6c?void=0’ -u admin:Admin123
The following command returns 0 members where void=1 (the reporting module returns 5427 results) curl -X GET --header ‘Accept: application/json’ ‘http://int02.openmrs.org/openmrs/ws/rest/v1/reportingrest/cohort/17df8f72-b059-4d5f-bc28-521752c34f6c?void=1’ -u admin:Admin123
I created another cohortquery that doesn’t collect a parameter and should return 8132 patients according to the reporting module, but it returns 2705.
curl -X GET --header ‘Accept: application/json’ ‘http://int02.openmrs.org/openmrs/ws/rest/v1/reportingrest/cohort/471e72be-ba82-43d3-a330-3dad33a74f20’ -u admin:Admin123
Questions: Do you have any thoughts on why the Reporting REST module is behaving this way? Is the Reporting REST module’s cohortquery returning patients where void=0 by default? Are there any limits on the number of patients returned from the Reporting REST module? Is pagination used? If so, how can I work through those?
Thanks! Craig
FYI @mseaton