Unable to search patient appointments using patient id in the list view.


  1. When user search appointments with patient id in appointment list view, they are not able to see the appointments. The appointments are visible in the list view before searching with a specific patient id.
  2. This issue is not happening with all the patients.
  3. This issue is not happening in all server timezones.

Cause: When the server in a timezone where day light saving is followed and the date of the birth of a patient falls exactly on the starting of the day of the day light saving we are seeing this issue.


  1. When the appointments are searched with the patient id, a hibernate query is generated to retrieve the patient appointments
  2. The hibernate query generated to fetch appointments uses some patient attributes like date of birth, gender etc.
  3. For a patient whose date of birth is falling on the start of day light saving, the value of date of birth field in the hibernate generated query is something like patient1_1_.birthdate=‘2009-03-27 01:00:00’ the ideal value should be patient1_1_.birthdate=‘2009-03-27 00:00:00’.
  4. This is happening because the patient’s date of birthday (i.e 2009-03-27) is starting day of day of light saving in the country where the server is.

Looking forward for any suggestions on a possible approach for fix. @tarunshettygari @buvaneswariarun @binduak @sivareddy @angshuonline @gsluthra @n0man @muhima08 @thomasrod @ramuachala


ideally you should never consider time when checking on birthday. When someone mentions and records dob, usually timezones are never really associated … it does not matter if you are seeing the information from a different geography, your birthday is going to be recorded same whether you are in Australia or America! for time, its usually recorded in a different field. So my reco would be strip of the time part while querying …

1 Like

Proposed solution: Excluding patient attributes from the hibernate generated query

  • In the hibernate generated query, we are including patient attributes like birthdate, deathdate, gender which ideally are not required to retrieve a patient’s appointments.

  • We can exclude these attributes while generating the query which will eventually solve the above issue.

agree! Although I can imagine that nobody will probably search/filter by birthday, would there be a case that someone may want to filter by gender? I am ok even if you remove all that, and we will introduce so, when need comes up.
@icrc.psousa do you have any such req in your project?