use of org.openmrs.api.OrderContext in project openmrs-module-mirebalais by PIH.
the class RadiologyOrderNumberGeneratorTest method shouldReturnStandardOrderNumberForNonRadiologyOrder.
@Test
public void shouldReturnStandardOrderNumberForNonRadiologyOrder() {
OrderContext context = new OrderContext();
context.setOrderType(otherOrderType);
assertThat(generator.getNewOrderNumber(context), is("ORD-15"));
}
use of org.openmrs.api.OrderContext in project openmrs-module-mirebalais by PIH.
the class RadiologyOrderNumberGeneratorComponentTest method shouldGenerateStandardOrderNumber.
@Test
public void shouldGenerateStandardOrderNumber() {
// new test order
Order order = new TestOrder();
order.setEncounter(encounterService.getEncounter(6));
order.setPatient(patientService.getPatient(7));
order.setConcept(conceptService.getConcept(5497));
order.setOrderer(providerService.getProvider(1));
order.setCareSetting(orderService.getCareSetting(1));
order.setOrderType(orderService.getOrderType(2));
order.setEncounter(encounterService.getEncounter(3));
order.setDateActivated(new Date());
OrderContext orderContext = new OrderContext();
order = orderService.saveOrder(order, orderContext);
// the GP "order.nextOrderNumberSeed" is set to 1 in the standard test dataset
assertThat(order.getOrderNumber(), is("ORD-1"));
}
use of org.openmrs.api.OrderContext in project openmrs-module-mirebalais by PIH.
the class RadiologyOrderNumberGeneratorComponentTest method shouldGenerateRadiologyOrderNumber.
@Test
public void shouldGenerateRadiologyOrderNumber() {
// new test order
Order order = new RadiologyOrder();
order.setEncounter(encounterService.getEncounter(6));
order.setPatient(patientService.getPatient(7));
order.setConcept(conceptService.getConcept(5497));
order.setOrderer(providerService.getProvider(1));
order.setCareSetting(orderService.getCareSetting(1));
order.setOrderType(orderService.getOrderType(1001));
order.setEncounter(encounterService.getEncounter(3));
order.setDateActivated(new Date());
OrderContext orderContext = new OrderContext();
orderContext.setOrderType(orderService.getOrderType(1001));
order = orderService.saveOrder(order, orderContext);
assertThat(order.getOrderNumber(), is("0000000125"));
}
use of org.openmrs.api.OrderContext in project openmrs-module-mirebalais by PIH.
the class RadiologyOrderNumberGeneratorTest method shouldReturnRadiologyOrderNumberForRadiologyOrder.
@Test
public void shouldReturnRadiologyOrderNumberForRadiologyOrder() {
OrderContext context = new OrderContext();
context.setOrderType(radiologyOrderType);
assertThat(generator.getNewOrderNumber(context), is("0000000109"));
}
Aggregations