-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(BREAKING) O3-2748 add endpoint for un-doing transition of queue entries; ren… #64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor note about updating a comment but LGTM!
api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @chibongho . See my review comments for some changes requested.
api/src/main/java/org/openmrs/module/queue/api/QueueEntryService.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java
Show resolved
Hide resolved
omod/src/main/java/org/openmrs/module/queue/web/QueueEntryTransitionRestController.java
Outdated
Show resolved
Hide resolved
omod/src/main/java/org/openmrs/module/queue/web/QueueEntryTransitionRestController.java
Show resolved
Hide resolved
774edad
to
71d283d
Compare
…ies; rename endpoints related to transitions
71d283d
to
41a9ceb
Compare
|
||
/** | ||
* Given a specified queue entry Q, return its previous queue entry P, where P has same patient and | ||
* visit as Q, and P.endedAt time is same as Q.startAt time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startAt
-> startedAt
. Also, we should check the Queue
. The queueComingFrom
associated with Q
should match the queue
associated with P
.
api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I resolved some comments that had been addressed, and added some additional @chibongho . Ping me with the "Re-review" button when you think it's ready to go...
e1dd8f4
to
c4d0006
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two quick things, and then I think this is ready.
criteria.setPatient(queueEntry.getPatient()); | ||
criteria.setVisit(queueEntry.getVisit()); | ||
criteria.setEndedOn(queueEntry.getStartedAt()); | ||
criteria.setQueues(Arrays.asList(queueEntry.getQueueComingFrom())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chibongho this needs to be able to handle the situation where the queueEntry.getQueueComingFrom()
is null.
api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java
Show resolved
Hide resolved
criteria.setPatient(queueEntry.getPatient()); | ||
criteria.setVisit(queueEntry.getVisit()); | ||
criteria.setEndedOn(queueEntry.getStartedAt()); | ||
criteria.setQueues(queueComingFrom == null ? Arrays.asList() : Arrays.asList(queueComingFrom)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly do you want to happen here? If you set this to an empty list, then the DAO will only return results in which the queue property of QueueEntry is null. Since this is not (currently) nullable, this will effectively mean that no results are returned. If that is actually what we want, then we should just do a check earlier in the method and return null without bothering to hit the DB. If it is not what we want, and we want to get all queue entries that match regardless of queue (and if there is only one then use it), then we need the if statement to be around this entire critieria inclusion call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I want it to return null if queueComingFrom is null. I'll change it to a null check earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment.
…ame endpoints related to transitions
This PR add the ability to undo queue entry transitions. Undoing a transition voids the current active queue entry and un-ends its previous queue entry.
I changed the route to REST endpoints related to queue entry transitions to be under
/queue-entry/*
, namely/queue-entry/transition
andqueue-entry/undo-transition
, hence the breaking change.