diff --git a/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java b/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java index cb36f69..3eb1426 100644 --- a/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java @@ -176,7 +176,7 @@ public String generateVisitQueueNumber(Location location, Queue queue, Visit vis Date onOrAfter = Date.from(LocalDateTime.now().with(LocalTime.MIN).atZone(ZoneId.systemDefault()).toInstant()); criteria.setStartedOnOrAfter(onOrAfter); Date onOrBefore = Date.from(LocalDateTime.now().with(LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant()); - criteria.setStartedOnOrAfter(onOrBefore); + criteria.setStartedOnOrBefore(onOrBefore); Long nextQueueNumber = getCountOfQueueEntries(criteria) + 1; String paddedString = StringUtils.leftPad(String.valueOf(nextQueueNumber), 3, "0"); String serviceName = queue.getName().toUpperCase();