Skip to content

Commit 0e6e8b9

Browse files
authored
Merge pull request Bahmni#25 from palladiumkenya/came-early-filter
KHP3-4123 Clients who came early appear in both not arrived and came …
2 parents 0224fd1 + 9803818 commit 0e6e8b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api/src/main/java/org/openmrs/module/appointments/dao/impl/AppointmentDaoImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public List<Appointment> getPendingAppointments(Date forDate) {
8484
*/
8585
Session session = sessionFactory.getCurrentSession();
8686
Criteria criteria = session.createCriteria(Appointment.class);
87+
// Add a check for date_honored being null
88+
criteria.add(Restrictions.isNull("dateHonored"));
8789
Date maxDate = new Date(forDate.getTime() + TimeUnit.DAYS.toMillis(1));
8890
criteria.add(Restrictions.ge("startDateTime", forDate));
8991
criteria.add(Restrictions.lt("startDateTime", maxDate));
@@ -110,6 +112,8 @@ public List<Appointment> getHonouredAppointments(Date forDate) {
110112
*/
111113
Session session = sessionFactory.getCurrentSession();
112114
Criteria criteria = session.createCriteria(Appointment.class);
115+
// Add a check for date_honored being null
116+
criteria.add(Restrictions.isNull("dateHonored"));
113117
Date maxDate = new Date(forDate.getTime() + TimeUnit.DAYS.toMillis(1));
114118
criteria.add(Restrictions.ge("startDateTime", forDate));
115119
criteria.add(Restrictions.lt("startDateTime", maxDate));
@@ -136,6 +140,9 @@ public List<Appointment> getCameEarlyAppointments(Date forDate) {
136140
*/
137141
Session session = sessionFactory.getCurrentSession();
138142
Criteria criteria = session.createCriteria(Appointment.class);
143+
// Add a check for date_honored not being null
144+
criteria.add(Restrictions.isNotNull("dateHonored"));
145+
139146
Date maxDate = new Date(forDate.getTime() + TimeUnit.DAYS.toMillis(1));
140147
criteria.add(Restrictions.ge("startDateTime", forDate));
141148
criteria.add(Restrictions.lt("startDateTime", maxDate));

0 commit comments

Comments
 (0)