Skip to content

Commit

Permalink
UHM-1172 Make sure to get appointments by date and location with all …
Browse files Browse the repository at this point in the history
…statuses
  • Loading branch information
pamcdm committed Apr 2, 2014
1 parent 17685a1 commit f727734
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
*/
package org.openmrs.module.appointmentscheduling;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.codehaus.jackson.map.annotate.JsonSerialize;
Expand All @@ -28,6 +23,11 @@
import org.openmrs.Visit;
import org.openmrs.module.appointmentscheduling.serialize.AppointmentStatusSerializer;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
* It is a model class. It should extend either {@link BaseOpenmrsObject} or
* {@link BaseOpenmrsMetadata}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ public List<Appointment> getAppointmentsByAppointmentBlockAndAppointmentTypes(Ap

if (appointmentTypes != null)
criteria.add(Restrictions.in("appointmentType", appointmentTypes));
// skip cancelled and missed appointment blocks
criteria.add(Restrictions.and(Restrictions.ne("status", CANCELLED), Restrictions.ne("status", MISSED)));
criteria.add(Restrictions.eq("voided", false));

return criteria.list();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public void shouldGetDailyAppointments() throws Exception {

ScheduledAppointmentBlock scheduledAppointmentBlock = scheduledAppointmentBlockList.get(0);

assertEquals(scheduledAppointmentBlock.getAppointments().size(), 3);
assertEquals(scheduledAppointmentBlock.getAppointments().size(), 4);
assertEquals(format.parse("2014-01-02 00:00:00.0"), scheduledAppointmentBlock.getStartDate());
assertEquals(format.parse("2014-01-02 12:00:00.0"), scheduledAppointmentBlock.getEndDate());
assertEquals(provider, scheduledAppointmentBlock.getProvider());
Expand All @@ -477,7 +477,7 @@ public void shouldGetDailyAppointments() throws Exception {
assertEquals("Initial HIV Clinic Appointment", appointment.getAppointmentType().getName());

appointment = appointmentList.get(1);
assertEquals(2, appointment.getPatient().getId().intValue());
assertEquals(1, appointment.getPatient().getId().intValue());
assertEquals("Initial HIV Clinic Appointment", appointment.getAppointmentType().getName());
}

Expand Down

0 comments on commit f727734

Please sign in to comment.