Skip to content

Commit

Permalink
refactor if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
chibongho committed Mar 22, 2024
1 parent 49d9486 commit 68d608c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,14 @@ private void endQueueEntry(@NotNull QueueEntry queueEntry) {
@Transactional(readOnly = true)
public QueueEntry getPreviousQueueEntry(@NotNull QueueEntry queueEntry) {
Queue queueComingFrom = queueEntry.getQueueComingFrom();
if(queueComingFrom == null) {
return null;
}
QueueEntrySearchCriteria criteria = new QueueEntrySearchCriteria();
criteria.setPatient(queueEntry.getPatient());
criteria.setVisit(queueEntry.getVisit());
criteria.setEndedOn(queueEntry.getStartedAt());
criteria.setQueues(queueComingFrom == null ? Arrays.asList() : Arrays.asList(queueComingFrom));
criteria.setQueues(Arrays.asList(queueComingFrom));
List<QueueEntry> prevQueueEntries = dao.getQueueEntries(criteria);
if (prevQueueEntries.size() == 1) {
return prevQueueEntries.get(0);
Expand Down

0 comments on commit 68d608c

Please sign in to comment.