org.openmrs.Order.setInstructions()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.openmrs.Order.setInstructions()方法的一些代码示例,展示了Order.setInstructions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.setInstructions()方法的具体详情如下:
包路径:org.openmrs.Order
类名称:Order
方法名:setInstructions

Order.setInstructions介绍

暂无

代码示例

代码示例来源:origin: openmrs/openmrs-core

@Test
public void shouldFailIfAnEditedOrderIsFlushed() {
  Encounter encounter = encounterService.getEncounter(3);
  assertFalse(encounter.getOrders().isEmpty());
  encounter.getOrders().iterator().next().setInstructions("new");
  expectedException.expect(APIException.class);
  expectedException.expectMessage(Matchers.is(Context.getMessageSourceService().getMessage("editing.fields.not.allowed", new Object[] { "[instructions]", Order.class.getSimpleName() }, null)));
  encounterService.saveEncounter(encounter);
  Context.flushSession();
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
 */
@Test
public void saveOrder_shouldNotAllowRevisingAnExpiredOrder() {
  Order originalOrder = orderService.getOrder(6);
  assertNotNull(originalOrder.getAutoExpireDate());
  assertTrue(originalOrder.getAutoExpireDate().before(new Date()));
  Order revisedOrder = originalOrder.cloneForRevision();
  revisedOrder.setEncounter(encounterService.getEncounter(6));
  revisedOrder.setInstructions("Take after a meal");
  revisedOrder.setOrderer(providerService.getProvider(1));
  revisedOrder.setDateActivated(new Date());
  revisedOrder.setAutoExpireDate(new Date());
  expectedException.expect(CannotStopInactiveOrderException.class);
  expectedException.expectMessage(mss.getMessage("Order.cannot.discontinue.inactive"));
  orderService.saveOrder(revisedOrder, null);
}

代码示例来源:origin: openmrs/openmrs-core

@Test
public void shouldReviseAnOrderAndFlushSuccessfully() {
  Order originalOrder = orderService.getOrder(111);
  assertTrue(OrderUtilTest.isActiveOrder(originalOrder, null));
  final Patient patient = originalOrder.getPatient();
  List<Order> originalActiveOrders = orderService.getActiveOrders(patient, null, null, null);
  final int originalOrderCount = originalActiveOrders.size();
  assertTrue(originalActiveOrders.contains(originalOrder));
  
  Order revisedOrder = originalOrder.cloneForRevision();
  revisedOrder.setInstructions("Take after a meal");
  revisedOrder.setDateActivated(new Date());
  revisedOrder.setOrderer(providerService.getProvider(1));
  revisedOrder.setEncounter(encounterService.getEncounter(3));
  orderService.saveOrder(revisedOrder, null);
  Context.flushSession();
  
  List<Order> activeOrders = orderService.getActiveOrders(patient, null, null, null);
  assertEquals(originalOrderCount, activeOrders.size());
  assertFalse(OrderUtilTest.isActiveOrder(originalOrder, null));
}

代码示例来源:origin: openmrs/openmrs-core

@Test
public void shouldReviseAnOrder() {
  Order originalOrder = orderService.getOrder(111);
  assertTrue(OrderUtilTest.isActiveOrder(originalOrder, null));
  final Patient patient = originalOrder.getPatient();
  List<Order> originalActiveOrders = orderService.getActiveOrders(patient, null, null, null);
  final int originalOrderCount = originalActiveOrders.size();
  assertTrue(originalActiveOrders.contains(originalOrder));
  
  Order revisedOrder = originalOrder.cloneForRevision();
  revisedOrder.setInstructions("Take after a meal");
  revisedOrder.setDateActivated(new Date());
  revisedOrder.setOrderer(providerService.getProvider(1));
  revisedOrder.setEncounter(encounterService.getEncounter(3));
  orderService.saveOrder(revisedOrder, null);
  
  List<Order> activeOrders = orderService.getActiveOrders(patient, null, null, null);
  assertEquals(originalOrderCount, activeOrders.size());
  assertEquals(revisedOrder.getDateActivated(), DateUtils.addSeconds(originalOrder.getDateStopped(), 1));
  assertFalse(OrderUtilTest.isActiveOrder(originalOrder, null));
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
 */
@Test
public void saveOrder_shouldNotAllowRevisingAStoppedOrder() {
  Order originalOrder = orderService.getOrder(1);
  assertNotNull(originalOrder.getDateStopped());
  Order revisedOrder = originalOrder.cloneForRevision();
  revisedOrder.setEncounter(encounterService.getEncounter(4));
  revisedOrder.setInstructions("Take after a meal");
  revisedOrder.setOrderer(providerService.getProvider(1));
  revisedOrder.setDateActivated(new Date());
  expectedException.expect(CannotStopInactiveOrderException.class);
  expectedException.expectMessage(mss.getMessage("Order.cannot.discontinue.inactive"));
  orderService.saveOrder(revisedOrder, null);
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
 */
@Test
public void saveOrder_shouldNotAllowRevisingAVoidedOrder() {
  Order originalOrder = orderService.getOrder(8);
  assertTrue(originalOrder.getVoided());
  Order revisedOrder = originalOrder.cloneForRevision();
  revisedOrder.setEncounter(encounterService.getEncounter(6));
  revisedOrder.setInstructions("Take after a meal");
  revisedOrder.setOrderer(providerService.getProvider(1));
  revisedOrder.setDateActivated(new Date());
  expectedException.expect(CannotStopInactiveOrderException.class);
  expectedException.expectMessage(mss.getMessage("Order.cannot.discontinue.inactive"));
  orderService.saveOrder(revisedOrder, null);
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
 */
@Test
public void saveOrder_shouldSaveARevisedOrder() {
  Order originalOrder = orderService.getOrder(111);
  assertTrue(originalOrder.isActive());
  final Patient patient = originalOrder.getPatient();
  List<Order> originalActiveOrders = orderService.getActiveOrders(patient, null, null, null);
  final int originalOrderCount = originalActiveOrders.size();
  assertTrue(originalActiveOrders.contains(originalOrder));
  Order revisedOrder = originalOrder.cloneForRevision();
  revisedOrder.setEncounter(encounterService.getEncounter(5));
  revisedOrder.setInstructions("Take after a meal");
  revisedOrder.setDateActivated(new Date());
  revisedOrder.setOrderer(providerService.getProvider(1));
  revisedOrder.setEncounter(encounterService.getEncounter(3));
  orderService.saveOrder(revisedOrder, null);
  
  List<Order> activeOrders = orderService.getActiveOrders(patient, null, null, null);
  assertEquals(originalOrderCount, activeOrders.size());
  assertEquals(revisedOrder.getDateActivated(), DateUtils.addSeconds(originalOrder.getDateStopped(), 1));
  assertFalse(originalOrder.isActive());
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
 */
@Test
public void saveOrder_shouldNotAllowRevisingAnOrderWithNoPreviousOrder() {
  Order originalOrder = orderService.getOrder(111);
  assertTrue(originalOrder.isActive());
  Order revisedOrder = originalOrder.cloneForRevision();
  revisedOrder.setEncounter(encounterService.getEncounter(5));
  revisedOrder.setInstructions("Take after a meal");
  revisedOrder.setPreviousOrder(null);
  revisedOrder.setOrderer(providerService.getProvider(1));
  revisedOrder.setDateActivated(new Date());
  
  expectedException.expect(MissingRequiredPropertyException.class);
  expectedException.expectMessage(mss.getMessage("Order.previous.required"));
  orderService.saveOrder(revisedOrder, null);
}

代码示例来源:origin: openmrs/openmrs-core

revisedOrder.setInstructions("Take after a meal");
revisedOrder.setDateActivated(new Date());
revisedOrder.setOrderer(providerService.getProvider(1));

代码示例来源:origin: openmrs/openmrs-core

target.setOrderType(getOrderType());
target.setScheduledDate(getScheduledDate());
target.setInstructions(getInstructions());
target.setUrgency(getUrgency());
target.setCommentToFulfiller(getCommentToFulfiller());

代码示例来源:origin: openmrs/openmrs-core

target.setOrderType(getOrderType());
target.setConcept(getConcept());
target.setInstructions(getInstructions());
target.setDateActivated(getDateActivated());
target.setAutoExpireDate(getAutoExpireDate());

相关文章