HTML-878: Order Tag should support placing orders for the same drug a…#330
Conversation
…t an earlier date if the expiry date doesn't overlap
mogoodrich
left a comment
There was a problem hiding this comment.
Thoughts @mseaton ? This basically copies the logic getAutoExpireDate from the BaseDosingInstructions... (we can't call it directly since it depends on the effective start date being set)... though thinking about it now this assumes there is no custom dosing instructions set up?
| } | ||
|
|
||
|
|
||
| // attempt to estimate the stop date based on the auto-expire date |
There was a problem hiding this comment.
See my overall comment
| } | ||
|
|
||
| private boolean checkScheduleOverlap(FormEntryContext ctx, Order newOrder, Order existingOrder) { | ||
| private boolean checkScheduleOverlap(FormEntryContext ctx, DrugOrder newOrder, Order existingOrder) { |
There was a problem hiding this comment.
This wasn't being used outside the context of a drug order, so I changed the signature, but we could switch this back to an Order and I could do some testing/casting below to DrugOrder as needed if you'd prefer that.
There was a problem hiding this comment.
It's a private method, so as long as things work, no need to jump through hoops
mseaton
left a comment
There was a problem hiding this comment.
Seems fine to me @mogoodrich . At the end of the day, it was never the intention within HFE to add stricter validation than is in place in core, it was just trying to add validation earlier in order to provide better information and messages to users. So as long as the orders save successfully, no reason why HFE should stand in the way.
| } | ||
|
|
||
| private boolean checkScheduleOverlap(FormEntryContext ctx, Order newOrder, Order existingOrder) { | ||
| private boolean checkScheduleOverlap(FormEntryContext ctx, DrugOrder newOrder, Order existingOrder) { |
There was a problem hiding this comment.
It's a private method, so as long as things work, no need to jump through hoops
…t an earlier date if the expiry date doesn't overlap
Description of what I changed
Issue I worked on
see https://issues.openmrs.org/browse/HTML-
Checklist: I completed these to help reviewers :)
My pull request only contains ONE single commit
(the number above, next to the 'Commits' tab is 1).
No? -> read here on how to squash multiple commits into one
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amendI have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amendI ran
mvn clean packageright before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master