Skip to content

Commit

Permalink
Renamed OrderService.getOrderSubtypes to getSubtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
wluyima committed Mar 21, 2014
1 parent f00b9f0 commit df704f6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api/src/main/java/org/openmrs/api/OrderService.java
Expand Up @@ -555,5 +555,5 @@ public Order discontinueOrder(Order orderToDiscontinue, String reasonNonCoded, D
*
*/
@Authorized(PrivilegeConstants.MANAGE_ORDER_TYPES)
public List<OrderType> getOrderSubtypes(OrderType orderType, boolean includeRetired);
public List<OrderType> getSubtypes(OrderType orderType, boolean includeRetired);
}
2 changes: 1 addition & 1 deletion api/src/main/java/org/openmrs/api/db/OrderDAO.java
Expand Up @@ -215,7 +215,7 @@ public List<OrderFrequency> getOrderFrequencies(String searchPhrase, Locale loca
public void purgeOrderType(OrderType orderType);

/**
* @see org.openmrs.api.OrderService#getOrderSubtypes(org.openmrs.OrderType, boolean)
* @see org.openmrs.api.OrderService#getSubtypes(org.openmrs.OrderType, boolean)
*/
public List<OrderType> getOrderSubtypes(OrderType orderType, boolean includeRetired);

Expand Down
Expand Up @@ -498,7 +498,7 @@ public void purgeOrderType(OrderType orderType) {
}

/**
* @see org.openmrs.api.OrderService#getOrderSubtypes(org.openmrs.OrderType, boolean)
* @see org.openmrs.api.OrderService#getSubtypes(org.openmrs.OrderType, boolean)
*/
public List<OrderType> getOrderSubtypes(OrderType orderType, boolean includeRetired) {
Criteria criteria = sessionFactory.getCurrentSession().createCriteria(OrderType.class);
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/org/openmrs/api/impl/OrderServiceImpl.java
Expand Up @@ -661,11 +661,11 @@ public OrderType unretireOrderType(OrderType orderType) {
}

/**
* @see org.openmrs.api.OrderService#getOrderSubtypes(org.openmrs.OrderType, boolean)
* @see org.openmrs.api.OrderService#getSubtypes(org.openmrs.OrderType, boolean)
*/
@Override
@Transactional(readOnly = true)
public List<OrderType> getOrderSubtypes(OrderType orderType, boolean includeRetired) {
public List<OrderType> getSubtypes(OrderType orderType, boolean includeRetired) {
List<OrderType> allSubtypes = new ArrayList<OrderType>();
List<OrderType> immediateAncestors = dao.getOrderSubtypes(orderType, includeRetired);
while (!immediateAncestors.isEmpty()) {
Expand Down
8 changes: 4 additions & 4 deletions api/src/test/java/org/openmrs/api/OrderServiceTest.java
Expand Up @@ -1538,24 +1538,24 @@ public void unretireOrderType_shouldUnretireTheGivenUnretiredOrderType() {
}

/**
* @see {@link OrderService#getOrderSubtypes(org.openmrs.OrderType, boolean)}
* @see {@link OrderService#getSubtypes(org.openmrs.OrderType, boolean)}
*/
@Test
@Verifies(value = "shoud return all order subtypes of given order type", method = "getOrderSubtypes(org.openmrs.OrderType, boolean)")
public void getOrderSubTypes_shouldGetAllSubOrderTypesWithRetiredOrderTypes() {
OrderService orderService = Context.getOrderService();
List<OrderType> orderTypeList = orderService.getOrderSubtypes(orderService.getOrderType(2), true);
List<OrderType> orderTypeList = orderService.getSubtypes(orderService.getOrderType(2), true);
assertEquals(7, orderTypeList.size());
}

/**
* @see {@link OrderService#getOrderSubtypes(org.openmrs.OrderType, boolean)}
* @see {@link OrderService#getSubtypes(org.openmrs.OrderType, boolean)}
*/
@Test
@Verifies(value = "shoud return unretired order subtypes of given order type", method = "getOrderSubtypes(org.openmrs.OrderType, boolean)")
public void getOrderSubTypes_shouldGetAllSubOrderTypesWithoutRetiredOrderTypes() {
OrderService orderService = Context.getOrderService();
List<OrderType> orderTypeList = orderService.getOrderSubtypes(orderService.getOrderType(2), false);
List<OrderType> orderTypeList = orderService.getSubtypes(orderService.getOrderType(2), false);
assertEquals(6, orderTypeList.size());
}
}

0 comments on commit df704f6

Please sign in to comment.