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

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

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

Order.setDateActivated介绍

暂无

代码示例

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

/**
 * @see Order#isDiscontinued(Date)
 */
@Test
public void isDiscontinued_shouldNotDiscontinueBeforeActivationDate() throws Exception {
  o.setDateActivated(ymd.parse("2007-01-01"));
  assertFalse("shouldn't be discontinued before date activated", o.isDiscontinued(ymd.parse("2006-10-26")));
}

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

/**
 * @see Order#isDiscontinued(Date)
 */
@Test
public void isDiscontinued_shouldNotDiscontinueActivatedOrderBeforeAutoExpireDate() throws Exception {
  o.setDateActivated(ymd.parse("2007-01-01"));
  o.setAutoExpireDate(ymd.parse("2007-12-31"));
  assertFalse("shouldn't be discontinued before autoExpireDate", o.isDiscontinued(ymd.parse("2007-10-26")));
}

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

/**
 * @see Order#isDiscontinued(Date)
 */
@Test
public void isDiscontinued_shouldDiscontinueActivatedOrderAfterDateStopped() throws Exception {
  o.setDateActivated(ymd.parse("2007-01-01"));
  o.setAutoExpireDate(ymd.parse("2007-12-31"));
  OrderUtilTest.setDateStopped(o, ymd.parse("2007-11-01"));
  assertTrue("should be discontinued after dateStopped", o.isDiscontinued(ymd.parse("2007-11-26")));
}

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

/**
 * @see Order#isActive()
 */
@Test
public void isActive_shouldBeCurrentAfterDateActivated() throws Exception {
  //assertTrue("dateActivated==null && no end date should always be current", o.isActive(ymd.parse("2007-10-26")));
  o.setDateActivated(ymd.parse("2007-01-01"));
  assertFalse("shouldn't be current before dateActivated", o.isActive(ymd.parse("2006-10-26")));
  assertTrue("should be current after dateActivated", o.isActive(ymd.parse("2007-10-26")));
}

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

/**
 * @see Order#isActive()
 */
@Test
public void isActive_shouldBeCurrentBetweenDateActivatedAndAutoExpireDate() throws Exception {
  o.setDateActivated(ymd.parse("2007-01-01"));
  o.setAutoExpireDate(ymd.parse("2007-12-31"));
  assertFalse("shouldn't be current before dateActivated", o.isActive(ymd.parse("2006-10-26")));
  assertTrue("should be current between dateActivated and autoExpireDate", o.isActive(ymd.parse("2007-10-26")));
  assertFalse("shouldn't be current after autoExpireDate", o.isActive(ymd.parse("2008-10-26")));
}

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

/**
 * @see Order#isStarted(java.util.Date)
 */
@Test
public void isStarted_shouldReturnFalseIfTheOrderIsNotYetActivatedAsOfTheCheckDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  assertFalse(order.isStarted(DateUtils.parseDate("2014-11-01 11:11:09", DATE_FORMAT)));
}

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

/**
 * @see Order#isFuture(java.util.Date)
 */
@Test
public void isFuture_shouldReturnFalseForAVoidedOrder() throws Exception {
  Order order = new Order();
  order.setVoided(true);
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  assertFalse(order.isStarted(DateUtils.parseDate("2014-11-01 11:11:09", DATE_FORMAT)));
}

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

/**
 * @see Order#isActive(java.util.Date)
 */
@Test
public void isActive_shouldReturnTrueIfAnOrderWasDiscontinuedOnTheCheckDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  Date dateStopped = DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT);
  OrderUtilTest.setDateStopped(order, dateStopped);
  assertTrue(order.isActive(dateStopped));
}

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

/**
 * @see Order#isDiscontinued(java.util.Date)
 */
@Test
public void isDiscontinued_shouldReturnFalseIfDateActivatedIsAfterCheckDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT));
  OrderUtilTest.setDateStopped(order, DateUtils.parseDate("2014-11-01 11:11:13", DATE_FORMAT));
  assertFalse(order.isDiscontinued(DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT)));
}

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

/**
 * @see Order#isActive(java.util.Date)
 */
@Test
public void isActive_shouldReturnTrueIfAnOrderExpiredOnTheCheckDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  Date checkDate = DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT);
  order.setAutoExpireDate(checkDate);
  assertNull(order.getDateStopped());
  assertTrue(order.isActive(checkDate));
}

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

/**
 * @see Order#isActivated(Date)
 */
@Test
public void isActivated_shouldReturnTrueIfAnOrderWasActivatedOnTheCheckDate() throws Exception {
  Order order = new Order();
  Date activationDate = DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT);
  order.setDateActivated(activationDate);
  assertNull(order.getDateStopped());
  assertNull(order.getAutoExpireDate());
  assertTrue(order.isActivated(activationDate));
}

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

/**
 * @see Order#isActive(java.util.Date)
 */
@Test
public void isActive_shouldReturnTrueIfAnOrderWasActivatedOnTheCheckDate() throws Exception {
  Order order = new Order();
  Date activationDate = DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT);
  order.setDateActivated(activationDate);
  assertNull(order.getDateStopped());
  assertNull(order.getAutoExpireDate());
  assertTrue(order.isActive(activationDate));
}

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

/**
 * @see Order#isDiscontinued(java.util.Date)
 */
@Test
public void isDiscontinued_shouldReturnFalseIfDateStoppedAndAutoExpireDateAreBothNull() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  assertNull(order.getDateStopped());
  assertNull(order.getAutoExpireDate());
  assertFalse(order.isDiscontinued(DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT)));
}

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

/**
 * @see Order#isExpired(java.util.Date)
 */
@Test
public void isExpired_shouldReturnFalseIfDateStoppedIsNullAndAutoExpireDateIsAfterCheckDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  order.setAutoExpireDate(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT));
  assertNull(order.getDateStopped());
  assertFalse(order.isExpired(DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT)));
}

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

/**
 * @see Order#isExpired(java.util.Date)
 */
@Test
public void isExpired_shouldReturnFalseIfCheckDateIsAfterDateStoppedButBeforeAutoExpireDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  OrderUtilTest.setDateStopped(order, DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT));
  order.setAutoExpireDate(DateUtils.parseDate("2014-11-01 11:11:13", DATE_FORMAT));
  assertFalse(order.isExpired(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT)));
}

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

/**
 * @see Order#isActivated(Date)
 */
@Test
public void isActivated_shouldReturnTrueIfAnOrderWasActivatedBeforeTheCheckDate() throws Exception {
  Order order = new Order();
  Date activationDate = DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT);
  order.setDateActivated(activationDate);
  assertNull(order.getDateStopped());
  assertNull(order.getAutoExpireDate());
  assertTrue(order.isActivated(DateUtils.addMonths(activationDate, 2)));
}

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

/**
 * @see Order#isDiscontinued(java.util.Date)
 */
@Test
public void isDiscontinued_shouldReturnTrueIfCheckDateIsAfterDateStoppedButBeforeAutoExpireDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  OrderUtilTest.setDateStopped(order, DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT));
  order.setAutoExpireDate(DateUtils.parseDate("2014-11-01 11:11:13", DATE_FORMAT));
  assertTrue(order.isDiscontinued(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT)));
}

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

/**
 * @see Order#isExpired(java.util.Date)
 */
@Test
public void isExpired_shouldReturnFalseIfCheckDateIsAfterBothDateStoppedAutoExpireDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  OrderUtilTest.setDateStopped(order, DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT));
  order.setAutoExpireDate(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT));
  assertFalse(order.isExpired(DateUtils.parseDate("2014-11-01 11:11:13", DATE_FORMAT)));
}

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

/**
 * @see Order#isDiscontinued(java.util.Date)
 */
@Test
public void isDiscontinued_shouldReturnFalseIfAutoExpireDateIsNullAndDateStoppedIsAfterCheckDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  OrderUtilTest.setDateStopped(order, DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT));
  assertNull(order.getAutoExpireDate());
  assertFalse(order.isDiscontinued(DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT)));
}

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

/**
 * @see Order#isDiscontinued(java.util.Date)
 */
@Test
public void isDiscontinued_shouldReturnTrueIfAutoExpireDateIsNullAndDateStoppedIsBeforeCheckDate() throws Exception {
  Order order = new Order();
  order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
  OrderUtilTest.setDateStopped(order, DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT));
  assertNull(order.getAutoExpireDate());
  assertTrue(order.isDiscontinued(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT)));
}

相关文章