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

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

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

Order.getOrderer介绍

暂无

代码示例

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

public DrugOrderBuilder withOrderer(Integer orderID) {
  drugOrder.setOrderer(orderService.getOrder(orderID).getOrderer());
  return this;
}

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

public OrderBuilder withOrderer(Integer orderID) {
  order.setOrderer(orderService.getOrder(orderID).getOrderer());
  return this;
}

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

/**
 * @see OrderService#getRevisionOrder(org.openmrs.Order)
 */
@Test
public void getRevisionOrder_shouldNotReturnAVoidedRevisionOrder() {
  Order order = orderService.getOrder(7);
  Order revision1 = order.cloneForRevision();
  revision1.setEncounter(order.getEncounter());
  revision1.setOrderer(order.getOrderer());
  orderService.saveOrder(revision1, null);
  assertEquals(revision1, orderService.getRevisionOrder(order));
  orderService.voidOrder(revision1, "Testing");
  assertThat(orderService.getRevisionOrder(order), is(nullValue()));
  
  //should return the new unvoided revision
  Order revision2 = order.cloneForRevision();
  revision2.setEncounter(order.getEncounter());
  revision2.setOrderer(order.getOrderer());
  orderService.saveOrder(revision2, null);
  assertEquals(revision2, orderService.getRevisionOrder(order));
}

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

@Test
public void shouldAllowRetrospectiveDataEntryOfOrders() {
  Order order = new TestOrder();
  order.setPatient(patientService.getPatient(2));
  order.setCareSetting(orderService.getCareSetting(2));
  order.setConcept(conceptService.getConcept(5089));
  order.setEncounter(encounterService.getEncounter(6));
  order.setOrderer(providerService.getProvider(1));
  Calendar cal = Calendar.getInstance();
  cal.add(Calendar.DAY_OF_WEEK, -1);
  order.setDateActivated(cal.getTime());
  orderService.saveOrder(order, null);
  
  cal.add(Calendar.HOUR_OF_DAY, -1);
  Date stopDate = cal.getTime();
  Order dcOrder = orderService.discontinueOrder(order, "Testing", stopDate, order.getOrderer(), order.getEncounter());
  Context.flushSession(); // ensures that order is flushed and that the drop milliseconds interceptor is called
  assertEquals(DateUtil.truncateToSeconds(stopDate), order.getDateStopped());
  assertEquals(DateUtil.truncateToSeconds(stopDate), dcOrder.getAutoExpireDate());
}

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

@Test
public void shouldAllowEditingADiscontinuationOrder() {
  Order originalDCOrder = orderService.getOrder(22);
  assertEquals(Order.Action.DISCONTINUE, originalDCOrder.getAction());
  List<Order> originalPatientOrders = orderService.getAllOrdersByPatient(originalDCOrder.getPatient());
  final Order previousOrder = originalDCOrder.getPreviousOrder();
  assertNotNull(previousOrder);
  final Date newStartDate = originalDCOrder.getEncounter().getEncounterDatetime();
  
  Order newDcOrder = originalDCOrder.cloneForRevision();
  newDcOrder.setEncounter(originalDCOrder.getEncounter());
  newDcOrder.setOrderer(originalDCOrder.getOrderer());
  newDcOrder.setDateActivated(newStartDate);
  orderService.voidOrder(originalDCOrder, "To be replace with a new one");
  assertNull(originalDCOrder.getDateStopped());
  orderService.saveOrder(newDcOrder, null);
  
  //We need to flush so that we ensure the interceptor is okay with all this
  Context.flushSession();
  assertTrue(originalDCOrder.getVoided());
  List<Order> newPatientOrders = orderService.getAllOrdersByPatient(originalDCOrder.getPatient());
  assertEquals(originalPatientOrders.size() + 1, newPatientOrders.size());
  Collection<Order> newOrders = CollectionUtils.disjunction(originalPatientOrders, newPatientOrders);
  assertEquals(1, newOrders.size());
  assertEquals(newOrders.iterator().next().getPreviousOrder(), previousOrder);
}

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

/**
 * This test ensures that the getter for previous order field returns objects of the actual sub
 * types for subclasses instead proxies that are instances of Order
 * 
 * @throws Exception
 */
@Test
public void shouldNotReturnAProxyForPreviousOrder() {
  Order dcOrder = orderService.getOrder(22);
  Order previousOrder = dcOrder.getPreviousOrder();
  assertNotNull(previousOrder);
  
  Order testOrder = orderService.getOrder(7);
  Order dcTestOrder = orderService.discontinueOrder(testOrder, "Testing", null, testOrder.getOrderer(), testOrder
      .getEncounter());
  Context.flushSession();
  Context.clearSession();
  dcTestOrder = orderService.getOrder(dcTestOrder.getOrderId()).getPreviousOrder();
}

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

originalOrder.setConcept(Context.getConceptService().getConcept(5497));
originalOrder.setCareSetting(orderService.getCareSetting(1));
originalOrder.setOrderer(orderService.getOrder(1).getOrderer());
originalOrder.setEncounter(encounterService.getEncounter(3));
originalOrder.setOrderType(orderService.getOrderType(17));

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

/**
 * @throws InterruptedException
 * @see OrderService#unvoidOrder(org.openmrs.Order)
 */
@Test
public void unvoidOrder_shouldFailForADiscontinuationOrderIfThePreviousOrderIsInactive() throws InterruptedException {
  Order order = orderService.getOrder(22);
  assertEquals(Action.DISCONTINUE, order.getAction());
  Order previousOrder = order.getPreviousOrder();
  assertNotNull(previousOrder.getDateStopped());
  assertFalse(order.getVoided());
  
  //void the DC order for testing purposes so we can unvoid it later
  orderService.voidOrder(order, "None");
  assertTrue(order.getVoided());
  assertNull(previousOrder.getDateStopped());
  
  //stop the order with a different DC order
  orderService.discontinueOrder(previousOrder, "Testing", null, previousOrder.getOrderer(),
    previousOrder.getEncounter());
  Thread.sleep(10);
  
  expectedException.expect(CannotUnvoidOrderException.class);
  expectedException.expectMessage(mss.getMessage("Order.action.cannot.unvoid", new Object[] { "discontinuation" },
    null));
  orderService.unvoidOrder(order);
}

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

/**
 * @throws InterruptedException
 * @see OrderService#unvoidOrder(org.openmrs.Order)
 */
@Test
public void unvoidOrder_shouldFailForAReviseOrderIfThePreviousOrderIsInactive() throws InterruptedException {
  Order order = orderService.getOrder(111);
  assertEquals(Action.REVISE, order.getAction());
  Order previousOrder = order.getPreviousOrder();
  assertNotNull(previousOrder.getDateStopped());
  assertFalse(order.getVoided());
  
  //void the DC order for testing purposes so we can unvoid it later
  orderService.voidOrder(order, "None");
  assertTrue(order.getVoided());
  assertNull(previousOrder.getDateStopped());
  
  //stop the order with a different REVISE order
  Order revise = previousOrder.cloneForRevision();
  revise.setOrderer(order.getOrderer());
  revise.setEncounter(order.getEncounter());
  orderService.saveOrder(revise, null);
  Thread.sleep(10);
  
  expectedException.expect(CannotUnvoidOrderException.class);
  expectedException.expectMessage(mss.getMessage("Order.action.cannot.unvoid", new Object[] { "revision" }, null));
  orderService.unvoidOrder(order);
}

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

@Test
public void saveOrderWithScheduledDate_shouldAddANewOrderWithScheduledDateToTheDatabase() {
  Date scheduledDate = new Date();
  Order order = new Order();
  order.setAction(Action.NEW);
  order.setPatient(Context.getPatientService().getPatient(7));
  order.setConcept(Context.getConceptService().getConcept(5497));
  order.setCareSetting(orderService.getCareSetting(1));
  order.setOrderer(orderService.getOrder(1).getOrderer());
  order.setEncounter(encounterService.getEncounter(3));
  order.setDateActivated(new Date());
  order.setScheduledDate(scheduledDate);
  order.setUrgency(Order.Urgency.ON_SCHEDULED_DATE);
  order.setEncounter(encounterService.getEncounter(3));
  order.setOrderType(orderService.getOrderType(17));
  order = orderService.saveOrder(order, null);
  Order newOrder = orderService.getOrder(order.getOrderId());
  assertNotNull(order);
  assertEquals(DateUtil.truncateToSeconds(scheduledDate), order.getScheduledDate());
  assertNotNull(newOrder);
  assertEquals(DateUtil.truncateToSeconds(scheduledDate), newOrder.getScheduledDate());
}

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

order.setConcept(Context.getConceptService().getConcept(5497));
order.setCareSetting(orderService.getCareSetting(1));
order.setOrderer(orderService.getOrder(1).getOrderer());
order.setEncounter(encounterService.getEncounter(3));
order.setEncounter(encounterService.getEncounter(3));

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

order.setConcept(Context.getConceptService().getConcept(5497));
order.setCareSetting(orderService.getCareSetting(1));
order.setOrderer(orderService.getOrder(1).getOrderer());
order.setEncounter(encounterService.getEncounter(3));
order.setEncounter(encounterService.getEncounter(3));

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

orderToDiscontinue.setConcept(Context.getConceptService().getConcept(5497));
orderToDiscontinue.setCareSetting(orderService.getCareSetting(1));
orderToDiscontinue.setOrderer(orderService.getOrder(1).getOrderer());
orderToDiscontinue.setEncounter(encounterService.getEncounter(3));
orderToDiscontinue.setDateActivated(new Date());

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

target.setAutoExpireDate(getAutoExpireDate());
target.setEncounter(getEncounter());
target.setOrderer(getOrderer());
target.setCreator(getCreator());
target.setDateCreated(getDateCreated());

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

discontinuationOrder = newDiscontinuationOrder(discontinuedDate, discontinuedReasonStr, o);
if (o.getOrderer() == null) {
  setOrderer(o, session);

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

if (o.getUuid() == null)
  o.setUuid(UUID.randomUUID().toString());
if (o.getOrderer() == null) {
  setOrderer(o, session);

相关文章