Skip to content
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

Merged
merged 5 commits into from
Mar 22, 2024

Conversation

chibongho
Copy link
Contributor

…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 and queue-entry/undo-transition, hence the breaking change.

Copy link
Member

@mogoodrich mogoodrich left a 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!

Copy link
Member

@mseaton mseaton left a 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/pom.xml Outdated Show resolved Hide resolved
integration-tests/pom.xml Outdated Show resolved Hide resolved
omod/pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@chibongho chibongho changed the title (BREAKING) add endpoint for un-doing transition of queue entries; ren… (BREAKING) O3-2748 add endpoint for un-doing transition of queue entries; ren… Mar 21, 2024

/**
* 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.
Copy link
Member

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.

Copy link
Member

@mseaton mseaton left a 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...

Copy link
Member

@mseaton mseaton left a 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()));
Copy link
Member

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.

@chibongho chibongho requested a review from mseaton March 22, 2024 17:13
criteria.setPatient(queueEntry.getPatient());
criteria.setVisit(queueEntry.getVisit());
criteria.setEndedOn(queueEntry.getStartedAt());
criteria.setQueues(queueComingFrom == null ? Arrays.asList() : Arrays.asList(queueComingFrom));
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment.

@chibongho chibongho requested a review from mseaton March 22, 2024 17:41
@mseaton mseaton merged commit 21c98ae into main Mar 22, 2024
1 check passed
@mseaton mseaton deleted the undo-transition branch March 22, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants