diff --git a/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java b/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java index a8a89dd4..d180d8a5 100644 --- a/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java +++ b/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java @@ -92,6 +92,14 @@ public boolean evaluate(Object o) { return ((AppointmentStatus) o).isCancelled(); } }; + + public static Predicate notCancelledPredicate = new Predicate() { + + @Override + public boolean evaluate(Object o) { + return !((AppointmentStatus) o).isCancelled(); + } + }; public static Predicate notCancelledPredicate = new Predicate() { diff --git a/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java b/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java index 5cf7c4b7..cec2c1f7 100644 --- a/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java +++ b/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java @@ -37,7 +37,11 @@ import static org.junit.Assert.assertTrue; /** +<<<<<<< HEAD * Tests Time Slot methods in the {@link AppointmentService} . +======= + * Tests Time Slot methods in the {@link AppointmentService} . +>>>>>>> f97b876... fixed which AppointmentStatuses are considered "cancelled" */ public class TimeSlotServiceTest extends BaseModuleContextSensitiveTest { @@ -398,12 +402,21 @@ public void shouldGetOnlyAvailableTimeSlotsByConstraintsSortedByStartDate() thro List result = service.getTimeSlotsByConstraints(type, fromDate, null, null, null); assertNotNull(result); assertEquals(4, result.size()); +<<<<<<< HEAD assertEquals(5, result.get(0).getTimeSlotId().intValue()); assertEquals(4, result.get(1).getTimeSlotId().intValue()); assertEquals(8, result.get(2).getTimeSlotId().intValue()); assertEquals(9, result.get(3).getTimeSlotId().intValue()); +======= + + assertEquals(5, result.get(0).getTimeSlotId().intValue()); + assertEquals(4, result.get(1).getTimeSlotId().intValue()); + assertEquals(8, result.get(2).getTimeSlotId().intValue()); + assertEquals(9, result.get(3).getTimeSlotId().intValue()); + +>>>>>>> f97b876... fixed which AppointmentStatuses are considered "cancelled" } }