本文整理了Java中org.openmrs.Order.getCareSetting()
方法的一些代码示例,展示了Order.getCareSetting()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.getCareSetting()
方法的具体详情如下:
包路径:org.openmrs.Order
类名称:Order
方法名:getCareSetting
[英]Gets the careSetting
[中]获取护理设置
代码示例来源:origin: openmrs/openmrs-core
private void ensureCareSettingIsSet(Order order, OrderContext orderContext) {
if (order.getCareSetting() != null) {
return;
}
CareSetting careSetting = null;
if (orderContext != null) {
careSetting = orderContext.getCareSetting();
}
Order previousOrder = order.getPreviousOrder();
if (careSetting == null || (previousOrder != null && !careSetting.equals(previousOrder.getCareSetting()))) {
throw new OrderEntryException("Order.care.cannot.determine");
}
order.setCareSetting(careSetting);
}
代码示例来源:origin: openmrs/openmrs-core
/**
* Creates a discontinuation order for this order, sets the previousOrder and action fields,
* note that the discontinuation order needs to be saved for the discontinuation to take effect
*
* @return the newly created order
* @since 1.10
* @should set all the relevant fields
*/
public Order cloneForDiscontinuing() {
Order newOrder = new Order();
newOrder.setCareSetting(getCareSetting());
newOrder.setConcept(getConcept());
newOrder.setAction(Action.DISCONTINUE);
newOrder.setPreviousOrder(this);
newOrder.setPatient(getPatient());
newOrder.setOrderType(getOrderType());
return newOrder;
}
代码示例来源:origin: openmrs/openmrs-core
} else if (!order.getOrderType().equals(previousOrder.getOrderType())) {
throw new EditedOrderDoesNotMatchPreviousException("Order.type.doesnot.match");
} else if (!order.getCareSetting().equals(previousOrder.getCareSetting())) {
throw new EditedOrderDoesNotMatchPreviousException("Order.care.setting.doesnot.match");
} else if (!getActualType(order).equals(getActualType(previousOrder))) {
asOfDate = order.getDateActivated();
List<Order> activeOrders = getActiveOrders(order.getPatient(), null, order.getCareSetting(), asOfDate);
List<String> parallelOrders = Collections.emptyList();
if (orderContext != null && orderContext.getAttribute(PARALLEL_ORDERS) != null) {
代码示例来源:origin: openmrs/openmrs-core
asOfDate = order.getDateActivated();
List<? extends Order> orders = getActiveOrders(order.getPatient(), order.getOrderType(), order.getCareSetting(),
asOfDate);
boolean isDrugOrderAndHasADrug = isDrugOrder(order)
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
*/
@Test
public void saveOrder_shouldDefaultToCareSettingAndOrderTypeDefinedInTheOrderContextIfNull() {
Order order = new TestOrder();
order.setPatient(patientService.getPatient(7));
Concept trimune30 = conceptService.getConcept(792);
order.setConcept(trimune30);
order.setOrderer(providerService.getProvider(1));
order.setEncounter(encounterService.getEncounter(3));
order.setDateActivated(new Date());
OrderType expectedOrderType = orderService.getOrderType(2);
CareSetting expectedCareSetting = orderService.getCareSetting(1);
OrderContext orderContext = new OrderContext();
orderContext.setOrderType(expectedOrderType);
orderContext.setCareSetting(expectedCareSetting);
order = orderService.saveOrder(order, orderContext);
assertFalse(expectedOrderType.getConceptClasses().contains(trimune30.getConceptClass()));
assertEquals(expectedOrderType, order.getOrderType());
assertEquals(expectedCareSetting, order.getCareSetting());
}
代码示例来源:origin: openmrs/openmrs-core
Order.Action.DISCONTINUE);
assertEquals(anOrder.getCareSetting(), orderThatCanDiscontinueTheOrder.getCareSetting());
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
*/
@Test
public void saveOrder_shouldFailIfTheJavaTypeOfThePreviousOrderDoesNotMatch() {
Order order = orderService.getOrder(7);
assertTrue(OrderUtilTest.isActiveOrder(order, null));
Order discontinuationOrder = new SomeTestOrder();
discontinuationOrder.setCareSetting(order.getCareSetting());
discontinuationOrder.setConcept(order.getConcept());
discontinuationOrder.setAction(Action.DISCONTINUE);
discontinuationOrder.setPreviousOrder(order);
discontinuationOrder.setPatient(order.getPatient());
assertTrue(order.getOrderType().getJavaClass().isAssignableFrom(discontinuationOrder.getClass()));
discontinuationOrder.setOrderType(order.getOrderType());
discontinuationOrder.setOrderer(Context.getProviderService().getProvider(1));
discontinuationOrder.setEncounter(Context.getEncounterService().getEncounter(6));
expectedException.expect(EditedOrderDoesNotMatchPreviousException.class);
expectedException.expectMessage(mss.getMessage("Order.class.doesnot.match"));
orderService.saveOrder(discontinuationOrder, null);
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
*/
@Test
public void saveOrder_shouldFailIfTheCareSettingOfThePreviousOrderDoesNotMatch() {
Order order = orderService.getOrder(7);
assertTrue(OrderUtilTest.isActiveOrder(order, null));
Order discontinuationOrder = order.cloneForDiscontinuing();
CareSetting careSetting = orderService.getCareSetting(2);
assertNotEquals(discontinuationOrder.getCareSetting(), careSetting);
discontinuationOrder.setCareSetting(careSetting);
discontinuationOrder.setOrderer(Context.getProviderService().getProvider(1));
discontinuationOrder.setEncounter(Context.getEncounterService().getEncounter(6));
expectedException.expect(EditedOrderDoesNotMatchPreviousException.class);
expectedException.expectMessage(mss.getMessage("Order.care.setting.doesnot.match"));
orderService.saveOrder(discontinuationOrder, null);
}
代码示例来源:origin: openmrs/openmrs-core
target.setAutoExpireDate(getAutoExpireDate());
target.setCareSetting(getCareSetting());
target.setConcept(getConcept());
target.setPatient(getPatient());
代码示例来源:origin: openmrs/openmrs-core
/**
* @see TestOrder#cloneForDiscontinuing()
*/
@Test
public void cloneForDiscontinuing_shouldSetAllTheRelevantFields() {
TestOrder anOrder = new TestOrder();
anOrder.setPatient(new Patient());
anOrder.setCareSetting(new CareSetting());
anOrder.setConcept(new Concept());
anOrder.setOrderType(new OrderType());
Order orderThatCanDiscontinueTheOrder = anOrder.cloneForDiscontinuing();
assertEquals(anOrder.getPatient(), orderThatCanDiscontinueTheOrder.getPatient());
assertEquals(anOrder.getConcept(), orderThatCanDiscontinueTheOrder.getConcept());
assertEquals("should set previous order to anOrder", anOrder, orderThatCanDiscontinueTheOrder.getPreviousOrder());
assertEquals("should set new order action to new", orderThatCanDiscontinueTheOrder.getAction(),
Order.Action.DISCONTINUE);
assertEquals(anOrder.getCareSetting(), orderThatCanDiscontinueTheOrder.getCareSetting());
assertEquals(anOrder.getOrderType(), orderThatCanDiscontinueTheOrder.getOrderType());
}
代码示例来源:origin: openmrs/openmrs-core
target.action = getAction();
target.orderNumber = getOrderNumber();
target.setCareSetting(getCareSetting());
target.setChangedBy(getChangedBy());
target.setDateChanged(getDateChanged());
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
setOrderer(o, session);
if (o.getCareSetting() == null) {
CareSetting careSetting = getCareSetting(session, submission);
o.setCareSetting(careSetting);
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
setOrderer(o, session);
if (o.getCareSetting() == null) {
CareSetting careSetting = getCareSetting(session, submission);
o.setCareSetting(careSetting);
代码示例来源:origin: openmrs/openmrs-module-webservices.rest
dcOrder.add("patient", patient.getUuid());
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());
assertEquals(dcOrder.get("action"), Util.getByPath(savedDCOrder, "action"));
assertEquals(orderToDiscontinue.getPatient().getUuid(), Util.getByPath(savedDCOrder, "patient/uuid"));
assertEquals(orderToDiscontinue.getCareSetting().getUuid(), Util.getByPath(savedDCOrder, "careSetting/uuid"));
assertEquals(dcOrder.get("previousOrder"), Util.getByPath(savedDCOrder, "previousOrder/uuid"));
assertNotNull(PropertyUtils.getProperty(savedDCOrder, "dateActivated"));
代码示例来源:origin: openmrs/openmrs-module-webservices.rest
revisedOrder.add("previousOrder", orderToRevise.getUuid());
revisedOrder.add("patient", patient.getUuid());
revisedOrder.add("careSetting", orderToRevise.getCareSetting().getUuid());
revisedOrder.add("concept", orderToRevise.getConcept().getUuid());
revisedOrder.add("encounter", encounter.getUuid());
assertEquals(revisedOrder.get("action"), Util.getByPath(savedOrder, "action"));
assertEquals(patient.getUuid(), Util.getByPath(savedOrder, "patient/uuid"));
assertEquals(orderToRevise.getCareSetting().getUuid(), Util.getByPath(savedOrder, "careSetting/uuid"));
assertEquals(revisedOrder.get("previousOrder"), Util.getByPath(savedOrder, "previousOrder/uuid"));
assertEquals(revisedOrder.get("concept"), Util.getByPath(savedOrder, "concept/uuid"));
内容来源于网络,如有侵权,请联系作者删除!