Skip to content

Commit

Permalink
Version 2.x initial updates
Browse files Browse the repository at this point in the history
* Update main branch to 2.0.0-SNAPSHOT
* Remove VisitQueueEntry in favor of optional visit on QueueEntry (https://issues.openmrs.org/browse/O3-2540)
* Queue module should validate parameters in REST and pass validated objects to services (https://issues.openmrs.org/browse/O3-2441)
* Queue Module - expand search capabilities across domain objects (https://issues.openmrs.org/browse/O3-2541)
* Improvements to follow coding conventions (https://issues.openmrs.org/browse/O3-2447)
* Overall expansion of unit test coverage, code reorganization, and refactoring
  • Loading branch information
mseaton authored Nov 1, 2023
1 parent d6f8977 commit 80ed840
Show file tree
Hide file tree
Showing 88 changed files with 3,318 additions and 3,070 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

import javax.validation.constraints.NotNull;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.openmrs.Location;
import org.openmrs.Visit;
import org.openmrs.VisitAttributeType;
import org.openmrs.api.APIException;
import org.openmrs.module.queue.api.search.QueueEntrySearchCriteria;
import org.openmrs.module.queue.model.Queue;
import org.openmrs.module.queue.model.QueueEntry;

Expand Down Expand Up @@ -45,15 +46,15 @@ public interface QueueEntryService {
* @param queueEntry the queue entry to be saved
* @return saved {@link org.openmrs.module.queue.model.QueueEntry}
*/
QueueEntry createQueueEntry(@NotNull QueueEntry queueEntry);
QueueEntry saveQueueEntry(@NotNull QueueEntry queueEntry);

/**
* Voids a queue entry
*
* @param queueEntryUuid uuid of the queue entry to be voided
* @param queueEntry the queue entry to be voided
* @param voidReason the reason for voiding the queue entry
*/
void voidQueueEntry(@NotNull String queueEntryUuid, String voidReason);
void voidQueueEntry(@NotNull QueueEntry queueEntry, String voidReason);

/**
* Completely remove a queue entry from the database
Expand All @@ -64,21 +65,15 @@ public interface QueueEntryService {
void purgeQueueEntry(@NotNull QueueEntry queueEntry) throws APIException;

/**
* Search for queue entries by conceptStatus
*
* @param conceptStatus queue entry conceptStatus
* @param includeVoided include/exclude voided queue entries
* @return {@link java.util.Collection} of queue entries with the specified statuses
* @return {@link List} of queue entries that match the given %{@link QueueEntrySearchCriteria}
*/
Collection<QueueEntry> searchQueueEntriesByConceptStatus(@NotNull String conceptStatus, boolean includeVoided);
List<QueueEntry> getQueueEntries(@NotNull QueueEntrySearchCriteria searchCriteria);

/**
* Gets count of queue entries by status
*
* @param status the queue entry status
* @return {@link java.lang.Long} count of queue entries by specified status
* @return {@link Long} count of queue entries that match the given
* %{@link QueueEntrySearchCriteria}
*/
Long getQueueEntriesCountByStatus(@NotNull String status);
Long getCountOfQueueEntries(@NotNull QueueEntrySearchCriteria searchCriteria);

/**
* @param location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
import java.util.List;
import java.util.Optional;

import org.openmrs.Location;
import org.openmrs.api.APIException;
import org.openmrs.module.queue.model.Queue;
import org.openmrs.module.queue.api.search.QueueRoomSearchCriteria;
import org.openmrs.module.queue.model.QueueRoom;

public interface QueueRoomService {
Expand All @@ -25,11 +24,13 @@ public interface QueueRoomService {

Optional<QueueRoom> getQueueRoomById(@NotNull int id);

QueueRoom createQueueRoom(@NotNull QueueRoom queueRoom);
List<QueueRoom> getAllQueueRooms();

List<QueueRoom> getQueueRoomsByServiceAndLocation(Queue queue, Location location);
QueueRoom saveQueueRoom(@NotNull QueueRoom queueRoom);

void voidQueueRoom(@NotNull String queueRoomUuid, String voidReason);
List<QueueRoom> getQueueRooms(QueueRoomSearchCriteria searchCriteria);

void purgeQueueRoom(QueueRoom queueRoom) throws APIException;
void retireQueueRoom(@NotNull QueueRoom queueRoom, String voidReason);

void purgeQueueRoom(@NotNull QueueRoom queueRoom) throws APIException;
}
32 changes: 9 additions & 23 deletions api/src/main/java/org/openmrs/module/queue/api/QueueService.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@

import javax.validation.constraints.NotNull;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.openmrs.Concept;
import org.openmrs.api.APIException;
import org.openmrs.module.queue.api.search.QueueSearchCriteria;
import org.openmrs.module.queue.model.Queue;

/**
Expand Down Expand Up @@ -46,30 +45,25 @@ public interface QueueService {
* @param queue the queue to be saved
* @return saved {@link org.openmrs.module.queue.model.Queue}
*/
Queue createQueue(@NotNull Queue queue);
Queue saveQueue(@NotNull Queue queue);

/**
* Gets all queues related to a specified location.
*
* @param locationUuid UUID of the location being queried.
* @return {@link java.util.List} of {@link org.openmrs.module.queue.model.Queue}
* @return all queues
*/
List<Queue> getAllQueuesByLocation(@NotNull String locationUuid);
List<Queue> getAllQueues();

/**
* Gets all queues
*
* @return all queues
* @return {@link List} of queues that match the given %{@link QueueSearchCriteria}
*/
Collection<Queue> getAllQueues();
List<Queue> getQueues(@NotNull QueueSearchCriteria searchCriteria);

/**
* Voids a queue
*
* @param queueUuid uuid of the queue to be voided
* @param voidReason the reason for voiding the queue
* @param queue the queue to retire
* @param retireReason the reason for voiding the queue
*/
void voidQueue(@NotNull String queueUuid, String voidReason);
void retireQueue(@NotNull Queue queue, String retireReason);

/**
* Completely remove a queue from the database
Expand All @@ -78,12 +72,4 @@ public interface QueueService {
* @throws APIException <strong>Should</strong> delete the given queue from the database
*/
void purgeQueue(@NotNull Queue queue) throws APIException;

/**
* Returns average weight time for patients in a queue
*
* @param queue
* @return
*/
Double getQueueAverageWaitTime(@NotNull Queue queue, Concept status);
}
Loading

0 comments on commit 80ed840

Please sign in to comment.