use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method getOrderTypeByConceptClass_shouldGetOrderTypeMappedToTheGivenConceptClass.
/**
* @see OrderService#getOrderTypeByConceptClass(ConceptClass)
*/
@Test
public void getOrderTypeByConceptClass_shouldGetOrderTypeMappedToTheGivenConceptClass() {
OrderType orderType = orderService.getOrderTypeByConceptClass(Context.getConceptService().getConceptClass(1));
Assert.assertNotNull(orderType);
Assert.assertEquals(2, orderType.getOrderTypeId().intValue());
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method getOrderType_shouldReturnNullIfNoOrderTypeObjectFoundWithGivenId.
/**
* @see OrderService#getOrderType(Integer)
*/
@Test
public void getOrderType_shouldReturnNullIfNoOrderTypeObjectFoundWithGivenId() {
OrderType orderType = orderService.getOrderType(1000);
assertNull(orderType);
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method getActiveOrders_shouldIncludeOrdersForSubTypesIfOrderTypeIsSpecified.
/**
* @see OrderService#getActiveOrders(org.openmrs.Patient, org.openmrs.OrderType,
* org.openmrs.CareSetting, java.util.Date)
*/
@Test
public void getActiveOrders_shouldIncludeOrdersForSubTypesIfOrderTypeIsSpecified() {
executeDataSet("org/openmrs/api/include/OrderServiceTest-otherOrders.xml");
Patient patient = Context.getPatientService().getPatient(2);
OrderType testOrderType = orderService.getOrderType(2);
List<Order> orders = orderService.getActiveOrders(patient, testOrderType, null, null);
assertEquals(5, orders.size());
Order[] expectedOrder1 = { orderService.getOrder(7), orderService.getOrder(101), orderService.getOrder(102), orderService.getOrder(103), orderService.getOrder(104) };
assertThat(orders, hasItems(expectedOrder1));
OrderType labTestOrderType = orderService.getOrderType(7);
orders = orderService.getActiveOrders(patient, labTestOrderType, null, null);
assertEquals(3, orders.size());
Order[] expectedOrder2 = { orderService.getOrder(101), orderService.getOrder(103), orderService.getOrder(104) };
assertThat(orders, hasItems(expectedOrder2));
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method retireOrderType_shouldRetireOrderType.
/**
* @see OrderService#retireOrderType(org.openmrs.OrderType, String)
*/
@Test
public void retireOrderType_shouldRetireOrderType() {
OrderType orderType = orderService.getOrderType(15);
assertFalse(orderType.getRetired());
assertNull(orderType.getRetiredBy());
assertNull(orderType.getRetireReason());
assertNull(orderType.getDateRetired());
orderService.retireOrderType(orderType, "Retire for testing purposes");
orderType = orderService.getOrderType(15);
assertTrue(orderType.getRetired());
assertNotNull(orderType.getRetiredBy());
assertNotNull(orderType.getRetireReason());
assertNotNull(orderType.getDateRetired());
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method getOrderTypeByUuid_shouldFindOrderTypeObjectGivenValidUuid.
/**
* @see OrderService#getOrderTypeByUuid(String)
*/
@Test
public void getOrderTypeByUuid_shouldFindOrderTypeObjectGivenValidUuid() {
OrderType orderType = orderService.getOrderTypeByUuid("131168f4-15f5-102d-96e4-000c29c2a5d7");
assertEquals("Drug order", orderType.getName());
}
Aggregations