same patient appearing in multiple age dimensions in reporting module v0.9.9

Tags: #<Tag:0x00007f7909b10e98>

Dear devs,

I am looking at the query logged at openmrs-module-reporting/HibernateCohortQueryDAO.java at 0.9.9 · openmrs/openmrs-module-reporting · GitHub and it appears as if certain birthdates appear in multiple age dimensions. For example, the below logs are for age groups 35-39 and 40-44:

Executing: select t.patient_id from patient t, person p where t.patient_id = p.person_id and t.voided = false and (p.birthdate <= :maxBirthFromAge and p.birthdate >= :minBirthFromAge) with params: {minBirthFromAge=Wed Dec 31 00:00:00 GMT+03:00 1980, maxBirthFromAge=Tue Dec 31 00:00:00 GMT+03:00 1985}

Executing: select t.patient_id from patient t, person p where t.patient_id = p.person_id and t.voided = false and (p.birthdate <= :maxBirthFromAge and p.birthdate >= :minBirthFromAge) with params: {minBirthFromAge=Wed Dec 31 00:00:00 GMT+03:00 1975, maxBirthFromAge=Wed Dec 31 00:00:00 GMT+03:00 1980}

You notice that Wed Dec 31 00:00:00 GMT+03:00 1980 appear in both dimensions thus makes any person with that birthdate appear in the two age groups. Am wondering whether there exists a solution to this issue or a guide on how to go about it.

Regards,

Antony

@mseaton @dkayiwa @mogoodrich

Hi @aojwang,

It’s certainly possible that there is a bug in this method. That’s also ancient code that no longer is used inside the reporting module. The implementation of AgeCohortDefinition does not use that, as you can see here: openmrs-module-reporting/AgeCohortDefinitionEvaluator.java at master · openmrs/openmrs-module-reporting · GitHub

Presumably you have no ability to upgrade to the latest version of reporting from 0.9.9?

Mike

Thanks, Mike. I will try to use the AgeCohortDefinition for the same. Unfortunately, we can’t upgrade to the latest version of the reporting module due to other module dependencies. Thanks a lot for the guide.

Thanks @mseaton for your clarification. There was somewhat an idea of upgrading from 1.9.9 to 2.3 in this ticket in order to depend on profilers of 2.3 in pom file have shared a PR with some suggestions, kindly take a look at the pr thanks