Cohort Builder Dead Patients Bug

Hello all,

I recently have been working on the JIRA ticket CB-203. You will find in the comments that I have found the reason behind this bug is the new Cohort Builder does not return dead patients with a null death date. This is a behavior that is different from the old cohort builder which returns all dead patients, regardless of whether or not their death date is null. After looking into this, the problem stems from the diedDuringPeriod search parameters setting the date to the current date. When this is sent to the reporting module it only considers patients with death dates before the current day. My first instinct to fix this was to set the date of death to NULL instead of the current date. However, if the death date that is passed in the search parameters is passed as NULL, all patients are returned. This is not the behavior I would expect from the CohortQueryDAO implementation of getPatientsHavingDiedBetweenDates. To go about fixing this issue, I think unit tests should be added for the CohortQueryService to test the functionality of this method because there are currently none. I believe the problem either lies there or somewhere in the integration between the Builtin Library definition and the BirthAndDeathCohortDefinition.

Jasmine

Hi @jasmineboyer,

Good detective work. I agree that this seems to be a limitation of what is available in the reporting module. I have just committed a new fix that should address this. If you now use the latest reporting module in your system, and use the diedDuringPeriod search, and set the date parameters to null, this will still limit the results to those patients who have been marked as dead in the system.

Let me know how this works out.

Mike

Hi @mseaton,

Thank you so much for the quick response and change. I am now running the latest reporting module. I am still working on trying to pass this object in the Cohort Builder through the JSON search parameters with the date being null, while still having it be a valid object. However, I do think that this is work that can be done in the Cohort Builder and that everything is working in the reporting module.

Thanks so much for the help,

Jasmine