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

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

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

Order.getUuid介绍

暂无

代码示例

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

firstOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(0).getUuid());
  secondOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(1).getUuid());
assertThat("The first order has a lower sortWeight than the second", savedOrderGroup.getOrders().get(0)
    .getSortWeight().compareTo(savedOrderGroup.getOrders().get(1).getSortWeight()), is(-1));
  firstOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(0).getUuid());
  secondOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(1).getUuid());
  secondSavedOrderGroup.getOrders().get(2).getUuid(), newOrderWithoutAnyPosition.getUuid());

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

/**
 * @see BaseOpenmrsObject#equals(Object)
 */
@Test
public void equals_shouldReturnTrueIfGivenObjectIsSubclassOfSuperOrExtendingClass() {
  Order order = new Order(21);
  DrugOrder type = new DrugOrder(21);
  type.setUuid(order.getUuid());
  Assert.assertTrue(type.equals(order));
  Assert.assertTrue(order.equals(type));
}

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

/**
 * @see BaseOpenmrsObject#equals(Object)
 */
@Test
public void equals_shouldReturnFalseIfGivenObjectIsNotSubclassOfSuperOrExtendingClass() {
  Order order = new Order(21);
  OrderFrequency type = new OrderFrequency();
  type.setUuid(order.getUuid());
  Assert.assertFalse(type.equals(order));
  Assert.assertFalse(order.equals(type));
}

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

firstOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(0).getUuid());
  secondOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(1).getUuid());
assertThat("The first order has a lower sortWeight than the second", savedOrderGroup.getOrders().get(0)
    .getSortWeight().compareTo(savedOrderGroup.getOrders().get(1).getSortWeight()), is(-1));
  newOrderAtPosition1.getUuid(), secondSavedOrderGroup.getOrders().get(0).getUuid());
  newOrderAtPosition2.getUuid(), secondSavedOrderGroup.getOrders().get(1).getUuid());
  firstOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(2).getUuid());
  secondOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(3).getUuid());

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

if (!parallelOrders.contains(activeOrder.getUuid())
    && areDrugOrdersOfSameOrderableAndOverlappingSchedule(order, activeOrder)) {
  throw new AmbiguousOrderException("Order.cannot.have.more.than.one");

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

Order savedOrder = Context.getOrderService().getOrderByUuid(orderWithoutOrderGroup.getUuid());
  firstOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(0).getUuid());
  secondOrderWithOrderGroup.getUuid(), savedOrderGroup.getOrders().get(1).getUuid());
assertNull("The order which doesn't belong to an orderGroup has no sortWeight", savedOrder.getSortWeight());
assertThat("The first order has a lower sortWeight than the second", savedOrderGroup.getOrders().get(0)

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

assertEquals(3, secondSavedOrderGroup.getOrders().size());
assertEquals("The new order gets added at the last position", newOrderWithNegativePosition.getUuid(),
  secondSavedOrderGroup.getOrders().get(2).getUuid());

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldGetTheActiveOrdersForAPatient() throws Exception {
  String[] expectedOrderUuids = { orderService.getOrder(3).getUuid(), orderService.getOrder(5).getUuid(),
      orderService.getOrder(7).getUuid(), orderService.getOrder(222).getUuid(),
      orderService.getOrder(444).getUuid() };
  SimpleObject results = deserialize(handle(newGetRequest(getURI(), new Parameter("patient",
      "da7f524f-27ce-4bb2-86d6-6d1d05312bd5"), new Parameter("sort", "desc"), new Parameter("status", "active"))));
  assertEquals(expectedOrderUuids.length, Util.getResultsSize(results));
  List<Object> resultList = Util.getResultsList(results);
  List<String> uuids = Arrays.asList(new String[] { PropertyUtils.getProperty(resultList.get(0), "uuid").toString(),
      PropertyUtils.getProperty(resultList.get(1), "uuid").toString(),
      PropertyUtils.getProperty(resultList.get(2), "uuid").toString(),
      PropertyUtils.getProperty(resultList.get(3), "uuid").toString(),
      PropertyUtils.getProperty(resultList.get(4), "uuid").toString() });
  assertThat(
    uuids,
    contains(orderService.getOrder(7).getUuid(), orderService.getOrder(5).getUuid(), orderService.getOrder(444)
        .getUuid(), orderService.getOrder(3).getUuid(), orderService.getOrder(222).getUuid()));
}

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldGetTheActiveDrugOrdersForAPatient() throws Exception {
  String[] expectedOrderUuids = { orderService.getOrder(3).getUuid(), orderService.getOrder(5).getUuid(),
      orderService.getOrder(222).getUuid(), orderService.getOrder(444).getUuid() };
  SimpleObject results = deserialize(handle(newGetRequest(getURI(), new Parameter(
      RestConstants.REQUEST_PROPERTY_FOR_TYPE, "drugorder"), new Parameter("patient",
      "da7f524f-27ce-4bb2-86d6-6d1d05312bd5"), new Parameter("sort", "asc"), new Parameter("status", "active"))));
  assertEquals(expectedOrderUuids.length, Util.getResultsSize(results));
  List<Object> resultList = Util.getResultsList(results);
  List<String> uuids = Arrays.asList(new String[] { PropertyUtils.getProperty(resultList.get(0), "uuid").toString(),
      PropertyUtils.getProperty(resultList.get(1), "uuid").toString(),
      PropertyUtils.getProperty(resultList.get(2), "uuid").toString(),
      PropertyUtils.getProperty(resultList.get(3), "uuid").toString(), });
  assertThat(
    uuids,
    contains(orderService.getOrder(222).getUuid(), orderService.getOrder(3).getUuid(), orderService.getOrder(444)
        .getUuid(), orderService.getOrder(5).getUuid()));
}

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

protected void enterStandardRegimen(FormEntrySession session, HttpServletRequest submission, String regCode, Date startDate,
    Date discontinuedDate, String discontinuedReasonStr) {
  RegimenSuggestion rs = RegimenUtil.getStandardRegimenByCode(possibleRegimens, regCode);
  //create new drugOrders
  Set<Order> ords = RegimenUtil.standardRegimenToDrugOrders(rs, startDate, session.getPatient());    
  for (Order o: ords){
    if (o.getDateCreated() == null)
      o.setDateCreated(new Date());
    if (o.getCreator() == null)
      o.setCreator(Context.getAuthenticatedUser());
    if (o.getUuid() == null)
      o.setUuid(UUID.randomUUID().toString());
    if (!StringUtils.isEmpty(discontinuedReasonStr))
      o.setDiscontinuedReason(HtmlFormEntryUtil.getConcept(discontinuedReasonStr));
    if (discontinuedDate != null){
      o.setDiscontinuedDate(discontinuedDate);
      o.setDiscontinued(true);
      o.setDiscontinuedBy(Context.getAuthenticatedUser());
    }    
    session.getSubmissionActions().getCurrentEncounter().addOrder(o);
  }
}

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

if (o.getCreator() == null)
  o.setCreator(Context.getAuthenticatedUser());
if (o.getUuid() == null)
  o.setUuid(UUID.randomUUID().toString());
Order discontinuationOrder = null;

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldGetTheActiveTestOrdersForAPatient() throws Exception {
  String expectedOrderUuid = orderService.getOrder(7).getUuid();
  SimpleObject results = deserialize(handle(newGetRequest(getURI(), new Parameter(
      RestConstants.REQUEST_PROPERTY_FOR_TYPE, "testorder"), new Parameter("patient",
      "da7f524f-27ce-4bb2-86d6-6d1d05312bd5"))));
  assertEquals(1, Util.getResultsSize(results));
  assertEquals(expectedOrderUuid, PropertyUtils.getProperty(Util.getResultsList(results).get(0), "uuid"));
}

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldGetTheActiveOrdersForAPatientInTheSpecifiedCareSetting() throws Exception {
  String expectedOrderUuid = orderService.getOrder(222).getUuid();
  SimpleObject results = deserialize(handle(newGetRequest(getURI(), new Parameter("patient",
      "da7f524f-27ce-4bb2-86d6-6d1d05312bd5"),
    new Parameter("careSetting", "c365e560-c3ec-11e3-9c1a-0800200c9a66"))));
  assertEquals(1, Util.getResultsSize(results));
  assertEquals(expectedOrderUuid, PropertyUtils.getProperty(Util.getResultsList(results).get(0), "uuid"));
}

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

if (o.getCreator() == null)
  o.setCreator(Context.getAuthenticatedUser());
if (o.getUuid() == null)
  o.setUuid(UUID.randomUUID().toString());
if (o.getOrderer() == null) {

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

dcOrder.add("concept", orderToDiscontinue.getConcept().getUuid());
dcOrder.add("careSetting", orderToDiscontinue.getCareSetting().getUuid());
dcOrder.add("previousOrder", orderToDiscontinue.getUuid());
dcOrder.add("encounter", Context.getEncounterService().getEncounter(6).getUuid());
dcOrder.add("orderer", "c2299800-cca9-11e0-9572-0800200c9a66");

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

revisedOrder.add("type", "testorder");
revisedOrder.add("action", "REVISE");
revisedOrder.add("previousOrder", orderToRevise.getUuid());
revisedOrder.add("patient", patient.getUuid());
revisedOrder.add("careSetting", orderToRevise.getCareSetting().getUuid());

相关文章