use of org.openmrs.CareSetting in project openmrs-core by openmrs.
the class OrderServiceTest method getCareSettingByName_shouldReturnTheCareSettingWithTheSpecifiedName.
/**
* @see OrderService#getCareSettingByName(String)
*/
@Test
public void getCareSettingByName_shouldReturnTheCareSettingWithTheSpecifiedName() {
CareSetting cs = orderService.getCareSettingByName("INPATIENT");
assertEquals(2, cs.getId().intValue());
// should also be case insensitive
cs = orderService.getCareSettingByName("inpatient");
assertEquals(2, cs.getId().intValue());
}
use of org.openmrs.CareSetting in project openmrs-core by openmrs.
the class OrderServiceTest method getOrders_shouldIncludeVoidedMatchesIfIncludeVoidedIsSetToTrue.
/**
* @see OrderService#getOrders(org.openmrs.Patient, org.openmrs.CareSetting,
* org.openmrs.OrderType, boolean)
*/
@Test
public void getOrders_shouldIncludeVoidedMatchesIfIncludeVoidedIsSetToTrue() {
Patient patient = patientService.getPatient(2);
CareSetting outPatient = orderService.getCareSetting(1);
OrderType testOrderType = orderService.getOrderType(2);
assertEquals(4, orderService.getOrders(patient, outPatient, testOrderType, true).size());
}
use of org.openmrs.CareSetting in project openmrs-core by openmrs.
the class OrderServiceTest method getCareSettingByUuid_shouldReturnTheCareSettingWithTheSpecifiedUuid.
/**
* @see OrderService#getCareSettingByUuid(String)
*/
@Test
public void getCareSettingByUuid_shouldReturnTheCareSettingWithTheSpecifiedUuid() {
CareSetting cs = orderService.getCareSettingByUuid("6f0c9a92-6f24-11e3-af88-005056821db0");
assertEquals(1, cs.getId().intValue());
}
use of org.openmrs.CareSetting in project openmrs-core by openmrs.
the class OrderServiceTest method getOrders_shouldIncludeOrdersForSubTypesIfOrderTypeIsSpecified.
/**
* @see OrderService#getOrders(org.openmrs.Patient, org.openmrs.CareSetting,
* org.openmrs.OrderType, boolean)
*/
@Test
public void getOrders_shouldIncludeOrdersForSubTypesIfOrderTypeIsSpecified() {
executeDataSet("org/openmrs/api/include/OrderServiceTest-otherOrders.xml");
Patient patient = patientService.getPatient(2);
OrderType testOrderType = orderService.getOrderType(2);
CareSetting outPatient = orderService.getCareSetting(1);
List<Order> orders = orderService.getOrders(patient, outPatient, testOrderType, false);
assertEquals(7, orders.size());
Order[] expectedOrder1 = { orderService.getOrder(6), orderService.getOrder(7), orderService.getOrder(9), orderService.getOrder(101), orderService.getOrder(102), orderService.getOrder(103), orderService.getOrder(104) };
assertThat(orders, hasItems(expectedOrder1));
OrderType labTestOrderType = orderService.getOrderType(7);
orders = orderService.getOrders(patient, outPatient, labTestOrderType, false);
assertEquals(3, orderService.getOrders(patient, outPatient, labTestOrderType, false).size());
Order[] expectedOrder2 = { orderService.getOrder(101), orderService.getOrder(103), orderService.getOrder(104) };
assertThat(orders, hasItems(expectedOrder2));
}
use of org.openmrs.CareSetting in project openmrs-core by openmrs.
the class OrderServiceTest method getActiveOrders_shouldReturnAllActiveOrdersForTheSpecifiedPatientAndCareSetting.
/**
* @see OrderService#getActiveOrders(org.openmrs.Patient, org.openmrs.OrderType,
* org.openmrs.CareSetting, java.util.Date)
*/
@Test
public void getActiveOrders_shouldReturnAllActiveOrdersForTheSpecifiedPatientAndCareSetting() {
Patient patient = patientService.getPatient(2);
CareSetting careSetting = orderService.getCareSetting(1);
List<Order> orders = orderService.getActiveOrders(patient, null, careSetting, null);
assertEquals(4, orders.size());
Order[] expectedOrders = { orderService.getOrder(3), orderService.getOrder(444), orderService.getOrder(5), orderService.getOrder(7) };
assertThat(orders, hasItems(expectedOrders));
}
Aggregations