use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method getOrders_shouldGetAllUnvoidedMatchesIfIncludeVoidedIsSetToFalse.
/**
* @see OrderService#getOrders(org.openmrs.Patient, org.openmrs.CareSetting,
* org.openmrs.OrderType, boolean)
*/
@Test
public void getOrders_shouldGetAllUnvoidedMatchesIfIncludeVoidedIsSetToFalse() {
Patient patient = patientService.getPatient(2);
CareSetting outPatient = orderService.getCareSetting(1);
OrderType testOrderType = orderService.getOrderType(2);
assertEquals(3, orderService.getOrders(patient, outPatient, testOrderType, false).size());
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method purgeOrderType_shouldNotAllowDeletingAnOrderTypeThatIsInUse.
/**
* @see OrderService#purgeOrderType(org.openmrs.OrderType)
*/
@Test
public void purgeOrderType_shouldNotAllowDeletingAnOrderTypeThatIsInUse() {
OrderType orderType = orderService.getOrderType(1);
assertNotNull(orderType);
expectedException.expect(CannotDeleteObjectInUseException.class);
expectedException.expectMessage(mss.getMessage("Order.type.cannot.delete"));
orderService.purgeOrderType(orderType);
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method purgeOrderType_shouldDeleteOrderTypeIfNotInUse.
/**
* @see OrderService#purgeOrderType(org.openmrs.OrderType)
*/
@Test
public void purgeOrderType_shouldDeleteOrderTypeIfNotInUse() {
final Integer id = 13;
OrderType orderType = orderService.getOrderType(id);
assertNotNull(orderType);
orderService.purgeOrderType(orderType);
assertNull(orderService.getOrderType(id));
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method retireOrderType_shouldNotRetireIndependentField.
/**
* @see OrderService#retireOrderType(org.openmrs.OrderType, String)
*/
@Test
public void retireOrderType_shouldNotRetireIndependentField() {
OrderType orderType = orderService.getOrderType(2);
ConceptClass conceptClass = conceptService.getConceptClass(1);
Assert.assertFalse(conceptClass.getRetired());
orderType.addConceptClass(conceptClass);
orderService.retireOrderType(orderType, "test retire reason");
Assert.assertFalse(conceptClass.getRetired());
}
use of org.openmrs.OrderType in project openmrs-core by openmrs.
the class OrderServiceTest method getOrderTypeByConcept_shouldGetOrderTypeMappedToTheGivenConcept.
/**
* @see OrderService#getOrderTypeByConcept(Concept)
*/
@Test
public void getOrderTypeByConcept_shouldGetOrderTypeMappedToTheGivenConcept() {
OrderType orderType = orderService.getOrderTypeByConcept(Context.getConceptService().getConcept(5089));
Assert.assertNotNull(orderType);
Assert.assertEquals(2, orderType.getOrderTypeId().intValue());
}
Aggregations