Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4532

Revised order does not check for overlapping active order

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: Platform 1.10.0
    • Fix Version/s: Platform 1.10.1
    • Component/s: None
    • Labels:
      None

      Description

      The code in OrderServiceImpl#saveOrder ignores revised orders while checking for overlapping active orders. Hence allows to create multiple active orders for same oderable.

      OrderServiceImpl.java
      // OrderServiceImpl#saveOrder
      if (!isDiscontinueOrReviseOrder(order)) {
      	List<Order> activeOrders = getActiveOrders(...);
      	for (Order activeOrder : activeOrders) {
      		if (order.hasSameOrderableAs(activeOrder) && OrderUtil.checkScheduleOverlap(order, activeOrder)) {
      			throw new APIException("Cannot have more than one active order...");
      		}
      	}
      }
      
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                endeepak Deepak N
                Reporter:
                endeepak Deepak N
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 4 hours
                    4h
                    Remaining:
                    Remaining Estimate - 4 hours
                    4h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified