本文整理了Java中org.openmrs.Order.getId()
方法的一些代码示例,展示了Order.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.getId()
方法的具体详情如下:
包路径:org.openmrs.Order
类名称:Order
方法名:getId
暂无
代码示例来源:origin: openmrs/openmrs-core
/**
* @see org.openmrs.api.OrderService#saveOrderGroup(org.openmrs.OrderGroup)
*/
@Override
public OrderGroup saveOrderGroup(OrderGroup orderGroup) throws APIException {
if (orderGroup.getId() == null) {
dao.saveOrderGroup(orderGroup);
}
List<Order> orders = orderGroup.getOrders();
for (Order order : orders) {
if (order.getId() == null) {
saveOrder(order, null);
}
}
return orderGroup;
}
代码示例来源:origin: openmrs/openmrs-core
if (o.getId() == null) {
Context.getOrderService().saveOrder(o, null);
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date,
* org.openmrs.Provider, org.openmrs.Encounter)
*/
@Test
public void discontinueOrder_shouldSetCorrectAttributesOnTheDiscontinueAndDiscontinuedOrders() {
executeDataSet("org/openmrs/api/include/OrderServiceTest-discontinueReason.xml");
Order order = orderService.getOrderByOrderNumber("111");
Encounter encounter = encounterService.getEncounter(3);
Provider orderer = providerService.getProvider(1);
Date discontinueDate = new Date();
Concept concept = Context.getConceptService().getConcept(1);
Order discontinueOrder = orderService.discontinueOrder(order, concept, discontinueDate, orderer, encounter);
Assert.assertEquals(order.getDateStopped(), discontinueDate);
Assert.assertNotNull(discontinueOrder);
Assert.assertNotNull(discontinueOrder.getId());
Assert.assertEquals(discontinueOrder.getDateActivated(), discontinueOrder.getAutoExpireDate());
Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE);
Assert.assertEquals(discontinueOrder.getOrderReason(), concept);
Assert.assertEquals(discontinueOrder.getPreviousOrder(), order);
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date,
* org.openmrs.Provider, org.openmrs.Encounter)
*/
@Test
public void discontinueOrder_shouldPopulateCorrectAttributesOnTheDiscontinueAndDiscontinuedOrders() {
Order order = orderService.getOrderByOrderNumber("111");
Encounter encounter = encounterService.getEncounter(3);
Provider orderer = providerService.getProvider(1);
assertTrue(OrderUtilTest.isActiveOrder(order, null));
Date discontinueDate = new Date();
String discontinueReasonNonCoded = "Test if I can discontinue this";
Order discontinueOrder = orderService.discontinueOrder(order, discontinueReasonNonCoded, discontinueDate, orderer,
encounter);
Assert.assertEquals(order.getDateStopped(), discontinueDate);
Assert.assertNotNull(discontinueOrder);
Assert.assertNotNull(discontinueOrder.getId());
Assert.assertEquals(discontinueOrder.getDateActivated(), discontinueOrder.getAutoExpireDate());
Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE);
Assert.assertEquals(discontinueOrder.getOrderReasonNonCoded(), discontinueReasonNonCoded);
Assert.assertEquals(discontinueOrder.getPreviousOrder(), order);
}
代码示例来源:origin: openmrs/openmrs-core
Assert.assertNotNull(discontinueOrder.getId());
Assert.assertEquals(discontinueOrder.getDateActivated(), discontinueOrder.getAutoExpireDate());
Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE);
代码示例来源:origin: openmrs/openmrs-core
Assert.assertNotNull(discontinueOrder.getId());
Assert.assertEquals(discontinueOrder.getDateActivated(), discontinueOrder.getAutoExpireDate());
Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE);
代码示例来源:origin: openmrs/openmrs-core
@Test
public void saveOrder_shouldSetAutoExpireDateOfDrugOrderIfAutoExpireDateIsNotSet() throws ParseException {
executeDataSet("org/openmrs/api/include/OrderServiceTest-drugOrderAutoExpireDate.xml");
Drug drug = conceptService.getDrug(3000);
DrugOrder drugOrder = new DrugOrder();
Encounter encounter = encounterService.getEncounter(3);
drugOrder.setEncounter(encounter);
drugOrder.setPatient(patientService.getPatient(7));
drugOrder.setCareSetting(orderService.getCareSetting(1));
drugOrder.setOrderer(Context.getProviderService().getProvider(1));
drugOrder.setDrug(drug);
drugOrder.setDosingType(SimpleDosingInstructions.class);
drugOrder.setDose(300.0);
drugOrder.setDoseUnits(conceptService.getConcept(50));
drugOrder.setQuantity(20.0);
drugOrder.setQuantityUnits(conceptService.getConcept(51));
drugOrder.setFrequency(orderService.getOrderFrequency(3));
drugOrder.setRoute(conceptService.getConcept(22));
drugOrder.setNumRefills(0);
drugOrder.setOrderType(null);
drugOrder.setDateActivated(TestUtil.createDateTime("2014-08-03"));
drugOrder.setDuration(20);// 20 days
drugOrder.setDurationUnits(conceptService.getConcept(1001));
Order savedOrder = orderService.saveOrder(drugOrder, null);
Order loadedOrder = orderService.getOrder(savedOrder.getId());
Assert.assertEquals(TestUtil.createDateTime("2014-08-22 23:59:59"), loadedOrder.getAutoExpireDate());
}
内容来源于网络,如有侵权,请联系作者删除!