Skip to content

Commit

Permalink
fixed which AppointmentStatuses are considered "cancelled"
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoodrich committed Apr 1, 2014
1 parent f97b876 commit b831062
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ public enum AppointmentStatus {
private final String name;

/**
* Whether or not an appointment with this status should be considered "cancelled"
* Cancelled statuses: CANCELLED, CANCELLED_AND_NEEDS_RESCHEDULE
* Whether or not an appointment with this status should be considered "cancelled" Cancelled
* statuses: CANCELLED, CANCELLED_AND_NEEDS_RESCHEDULE
*/
private Boolean cancelled;

/**
* Whether or not an appointment with this status is an "active" appointment, where active=patient
* checked-in and present within the health facility
* Active statuses: WALKIN, WAITING, INCONSULTATION
* Whether or not an appointment with this status is an "active" appointment, where
* active=patient checked-in and present within the health facility Active statuses: WALKIN,
* WAITING, INCONSULTATION
*/
private Boolean active;

Expand Down Expand Up @@ -92,14 +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() {
@Override
public boolean evaluate(Object o) {
return !((AppointmentStatus) o).isCancelled();
}
};

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import static org.junit.Assert.assertTrue;

/**
* Tests Time Slot methods in the {@link AppointmentService} .
* Tests Time Slot methods in the {@link AppointmentService} .
*/
public class TimeSlotServiceTest extends BaseModuleContextSensitiveTest {

Expand Down Expand Up @@ -398,12 +398,12 @@ public void shouldGetOnlyAvailableTimeSlotsByConstraintsSortedByStartDate() thro
List<TimeSlot> result = service.getTimeSlotsByConstraints(type, fromDate, null, null, null);
assertNotNull(result);
assertEquals(4, result.size());

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(4, result.get(1).getTimeSlotId().intValue());
assertEquals(8, result.get(2).getTimeSlotId().intValue());
assertEquals(9, result.get(3).getTimeSlotId().intValue());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,10 @@ public void shouldFindTimeSlotBasedOnAppointmentTypeAndFromDateAndLocationExclud
handle(req);

List<Map<String, String>> timeSlots = (List<Map<String, String>>) deserialize(handle(req)).get("results");
Assert.assertEquals(2, timeSlots.size());
Assert.assertEquals(1, timeSlots.size());

// note that the first time slot is full, so it is not returned here
Assert.assertEquals("c0c579b0-8e59-401d-8a4a-976a0b183605", timeSlots.get(0).get("uuid"));
Assert.assertEquals("c0c579b0-8e59-401d-8a4a-976a0b183607", timeSlots.get(1).get("uuid"));
// note that the first two time slots are full, so it is not returned here
Assert.assertEquals("c0c579b0-8e59-401d-8a4a-976a0b183607", timeSlots.get(0).get("uuid"));

}

Expand Down

0 comments on commit b831062

Please sign in to comment.