Skip to content

HTML-878: Order Tag should support placing orders for the same drug a…#330

Merged
mogoodrich merged 1 commit into
masterfrom
HTML-878
Mar 9, 2026
Merged

HTML-878: Order Tag should support placing orders for the same drug a…#330
mogoodrich merged 1 commit into
masterfrom
HTML-878

Conversation

@mogoodrich
Copy link
Copy Markdown
Member

…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 --amend

  • I 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 --amend

  • I ran mvn clean package right before creating this pull request and
    added 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

…t an earlier date if the expiry date doesn't overlap
Copy link
Copy Markdown
Member Author

@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.

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?

@mogoodrich mogoodrich requested a review from mseaton March 6, 2026 22:39
}


// attempt to estimate the stop date based on the auto-expire date
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

See my overall comment

}

private boolean checkScheduleOverlap(FormEntryContext ctx, Order newOrder, Order existingOrder) {
private boolean checkScheduleOverlap(FormEntryContext ctx, DrugOrder newOrder, Order existingOrder) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a private method, so as long as things work, no need to jump through hoops

Copy link
Copy Markdown
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.

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) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a private method, so as long as things work, no need to jump through hoops

@mogoodrich mogoodrich merged commit 879f079 into master Mar 9, 2026
1 check passed
@mogoodrich mogoodrich deleted the HTML-878 branch March 9, 2026 14:26
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.

2 participants