本文整理了Java中org.openmrs.Order.<init>()
方法的一些代码示例,展示了Order.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.<init>()
方法的具体详情如下:
包路径:org.openmrs.Order
类名称:Order
方法名:<init>
[英]default constructor
[中]默认构造函数
代码示例来源:origin: openmrs/openmrs-core
/**
* @see Order#getEffectiveStopDate()
*/
@Test
public void getEffectiveStopDate_shouldReturnDateStoppedIfDateStoppedIsNotNull() throws Exception {
Order order = new Order();
Date dateStopped = DateUtils.addDays(new Date(), 4);
OrderUtilTest.setDateStopped(order, dateStopped);
order.setAutoExpireDate(new Date());
assertEquals(dateStopped, order.getEffectiveStopDate());
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see Encounter#addOrder(Order)
*/
@Test
public void addOrder_shouldSetEncounterAttribute() {
Encounter encounter = new Encounter();
Order order = new Order();
encounter.addOrder(order);
assertTrue(order.getEncounter().equals(encounter));
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
*/
@Test
public void saveOrder_shouldNotSaveOrderIfOrderDoesntValidate() {
Order order = new Order();
order.setPatient(null);
order.setOrderer(null);
expectedException.expect(APIException.class);
expectedException.expectMessage("failed to validate with reason:");
orderService.saveOrder(order, null);
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see Order#isStarted(java.util.Date)
*/
@Test
public void isStarted_shouldReturnFalseIfDateActivatedIsNull() throws Exception {
Order order = new Order();
assertNull(order.getDateActivated());
assertFalse(order.isStarted(DateUtils.parseDate("2014-11-01 11:11:11", 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 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
/**
* @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_shouldReturnFalseForAnExpiredOrder() 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:11", DATE_FORMAT));
assertFalse(order.isActive(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT)));
}
代码示例来源: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#isStarted(java.util.Date)
*/
@Test
public void isStarted_shouldReturnFalseIfTheOrderWasScheduledToStartAfterTheCheckDate() throws Exception {
Order order = new Order();
order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
order.setUrgency(Order.Urgency.ON_SCHEDULED_DATE);
order.setScheduledDate(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT));
assertFalse(order.isStarted(DateUtils.parseDate("2014-11-01 11:11:11", DATE_FORMAT)));
}
代码示例来源: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)));
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see Order#isActive(java.util.Date)
*/
@Test
public void isActive_shouldReturnFalseForAnOrderActivatedAfterTheCheckDate() 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.isActive(DateUtils.parseDate("2014-11-01 11:11:09", DATE_FORMAT)));
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see Order#isExpired(java.util.Date)
*/
@Test
public void isExpired_shouldReturnFalseIfDateActivatedIsAfterCheckDate() throws Exception {
Order order = new Order();
order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT));
order.setAutoExpireDate(DateUtils.parseDate("2014-11-01 11:11:13", 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_shouldReturnTrueIfDateStoppedIsNullAndAutoExpireDateIsBeforeCheckDate() 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:11", DATE_FORMAT));
assertNull(order.getDateStopped());
assertTrue(order.isExpired(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT)));
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see Order#isExpired(java.util.Date)
*/
@Test
public void isExpired_shouldReturnFalseForAVoidedOrder() throws Exception {
Order order = new Order();
order.setVoided(true);
order.setDateActivated(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
order.setAutoExpireDate(DateUtils.parseDate("2014-11-01 11:11:10", DATE_FORMAT));
assertNull(order.getDateStopped());
assertFalse(order.isExpired(DateUtils.parseDate("2014-11-01 11:11:12", DATE_FORMAT)));
}
内容来源于网络,如有侵权,请联系作者删除!