Skip to content

Commit

Permalink
Doing some file formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dkayiwa committed Feb 28, 2014
1 parent f75f426 commit 1ee551c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/org/openmrs/DrugOrder.java
Expand Up @@ -434,8 +434,8 @@ public Order cloneForDiscontinuing() {
newOrder.setPreviousOrder(this);
newOrder.setPatient(this.getPatient());
newOrder.setDrug(this.getDrug());
newOrder.setStartDate(this.getStartDate());

newOrder.setStartDate(this.getStartDate());
return newOrder;
}

Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/org/openmrs/Order.java
Expand Up @@ -545,8 +545,8 @@ public Order cloneForDiscontinuing() {
newOrder.setAction(Action.DISCONTINUE);
newOrder.setPreviousOrder(this);
newOrder.setPatient(this.getPatient());
newOrder.setStartDate(this.getStartDate());

newOrder.setStartDate(this.getStartDate());
return newOrder;
}

Expand Down
26 changes: 14 additions & 12 deletions api/src/main/java/org/openmrs/api/OrderService.java
Expand Up @@ -359,11 +359,11 @@ public List<OrderFrequency> getOrderFrequencies(String searchPhrase, Locale loca
* Discontinues an order. Creates a new order that discontinues the orderToDiscontinue
*
*
* @param orderToDiscontinue
* @param reasonCoded
* @param discontinueDate
* @param orderer
* @return the new order that discontinued orderToDiscontinue
* @param orderToDiscontinue
* @param reasonCoded
* @param discontinueDate
* @param orderer
* @return the new order that discontinued orderToDiscontinue
* @throws APIException if the <code>action</code> of orderToDiscontinue is
* <code>Order.Action.DISCONTINUE</code>
* @since 1.10
Expand All @@ -375,17 +375,18 @@ public List<OrderFrequency> getOrderFrequencies(String searchPhrase, Locale loca
* @should fail for a discontinuation order
*/
@Authorized(PrivilegeConstants.ADD_ORDERS)
public Order discontinueOrder(Order orderToDiscontinue, Concept reasonCoded, Date discontinueDate, Provider orderer) throws Exception;
public Order discontinueOrder(Order orderToDiscontinue, Concept reasonCoded, Date discontinueDate, Provider orderer)
throws Exception;

/**
* Discontinues an order. Creates a new order that discontinues the orderToDiscontinue.
*
*
* @param orderToDiscontinue
* @param reasonNonCoded
* @param discontinueDate
* @param orderer
* @return the new order that discontinued orderToDiscontinue
* @param orderToDiscontinue
* @param reasonNonCoded
* @param discontinueDate
* @param orderer
* @return the new order that discontinued orderToDiscontinue
* @throws APIException if the <code>action</code> of orderToDiscontinue is
* <code>Order.Action.DISCONTINUE</code>
* @since 1.10
Expand All @@ -395,7 +396,8 @@ public List<OrderFrequency> getOrderFrequencies(String searchPhrase, Locale loca
* @should fail for a voided order
*/
@Authorized(PrivilegeConstants.ADD_ORDERS)
public Order discontinueOrder(Order orderToDiscontinue, String reasonNonCoded, Date discontinueDate, Provider orderer) throws Exception;
public Order discontinueOrder(Order orderToDiscontinue, String reasonNonCoded, Date discontinueDate, Provider orderer)
throws Exception;

/**
* Creates or updates the given order frequency in the database
Expand Down
8 changes: 5 additions & 3 deletions api/src/main/java/org/openmrs/api/impl/OrderServiceImpl.java
Expand Up @@ -404,11 +404,12 @@ public List<OrderFrequency> getOrderFrequencies(String searchPhrase, Locale loca
* @see org.openmrs.api.OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date, org.openmrs.Provider)
*/
@Override
public Order discontinueOrder(Order orderToDiscontinue, Concept reasonCoded, Date discontinueDate, Provider orderer) throws Exception {
public Order discontinueOrder(Order orderToDiscontinue, Concept reasonCoded, Date discontinueDate, Provider orderer)
throws Exception {
stopOrder(orderToDiscontinue, discontinueDate);
Order newOrder = orderToDiscontinue.cloneForDiscontinuing();
newOrder.setOrderReason(reasonCoded);
newOrder.setOrderer(orderer);
newOrder.setOrderer(orderer);

return saveOrderInternal(newOrder);
}
Expand All @@ -417,7 +418,8 @@ public Order discontinueOrder(Order orderToDiscontinue, Concept reasonCoded, Dat
* @see org.openmrs.api.OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date, org.openmrs.Provider)
*/
@Override
public Order discontinueOrder(Order orderToDiscontinue, String reasonNonCoded, Date discontinueDate, Provider orderer) throws Exception {
public Order discontinueOrder(Order orderToDiscontinue, String reasonNonCoded, Date discontinueDate, Provider orderer)
throws Exception {
stopOrder(orderToDiscontinue, discontinueDate);
Order newOrder = orderToDiscontinue.cloneForDiscontinuing();
newOrder.setOrderReasonNonCoded(reasonNonCoded);
Expand Down
Expand Up @@ -492,7 +492,7 @@ public void saveEncounter_shouldNotOverwriteObsAndOrdersCreatorOrDateCreated() t
Order order = new Order();
order.setConcept(new Concept(1));
order.setPatient(new Patient(2));
order.setStartDate(new Date());
order.setStartDate(new Date());
Field field = Order.class.getDeclaredField("orderNumber");
field.setAccessible(true);
field.set(order, "ORD-1");
Expand Down

0 comments on commit 1ee551c

Please sign in to comment.