本文整理了Java中org.openmrs.Order.getConcept()
方法的一些代码示例,展示了Order.getConcept()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.getConcept()
方法的具体详情如下:
包路径:org.openmrs.Order
类名称:Order
方法名:getConcept
暂无
代码示例来源:origin: openmrs/openmrs-core
/**
* Checks whether orderable of this order is same as other order
*
* @see org.openmrs.DrugOrder for overridden behaviour
* @since 1.10
* @param otherOrder the other order to match on
* @return true if the concept of the orders match
* @should return false if the concept of the orders do not match
* @should return false if other order is null
* @should return true if the orders have the same concept
*/
public boolean hasSameOrderableAs(Order otherOrder) {
if (otherOrder == null) {
return false;
}
return OpenmrsUtil.nullSafeEquals(this.getConcept(), otherOrder.getConcept());
}
代码示例来源:origin: openmrs/openmrs-core
private void ensureConceptIsSet(Order order) {
Concept concept = order.getConcept();
if (concept == null && isDrugOrder(order)) {
DrugOrder drugOrder = (DrugOrder) order;
if (drugOrder.getDrug() != null) {
concept = drugOrder.getDrug().getConcept();
drugOrder.setConcept(concept);
}
}
if (concept == null) {
throw new MissingRequiredPropertyException("Order.concept.required");
}
}
代码示例来源: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 (activeOrder.getConcept().equals(order.getConcept())) {
if (orderToBeDiscontinued == null) {
orderToBeDiscontinued = activeOrder;
代码示例来源:origin: openmrs/openmrs-core
private void ensureOrderTypeIsSet(Order order, OrderContext orderContext) {
if (order.getOrderType() != null) {
return;
}
OrderType orderType = null;
if (orderContext != null) {
orderType = orderContext.getOrderType();
}
if (orderType == null) {
orderType = getOrderTypeByConcept(order.getConcept());
}
if (orderType == null && order instanceof DrugOrder) {
orderType = Context.getOrderService().getOrderTypeByUuid(OrderType.DRUG_ORDER_TYPE_UUID);
}
if (orderType == null && order instanceof TestOrder) {
orderType = Context.getOrderService().getOrderTypeByUuid(OrderType.TEST_ORDER_TYPE_UUID);
}
if (orderType == null) {
throw new OrderEntryException("Order.type.cannot.determine");
}
Order previousOrder = order.getPreviousOrder();
if (previousOrder != null && !orderType.equals(previousOrder.getOrderType())) {
throw new OrderEntryException("Order.type.does.not.match");
}
order.setOrderType(orderType);
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
*/
@Test
public void saveOrder_shouldFailIfConceptInPreviousOrderDoesNotMatchThatOfTheRevisedOrder() {
Order previousOrder = orderService.getOrder(7);
Order order = previousOrder.cloneForRevision();
order.setDateActivated(new Date());
order.setOrderer(providerService.getProvider(1));
order.setEncounter(encounterService.getEncounter(6));
Concept newConcept = conceptService.getConcept(5089);
assertFalse(previousOrder.getConcept().equals(newConcept));
order.setConcept(newConcept);
expectedException.expect(EditedOrderDoesNotMatchPreviousException.class);
expectedException.expectMessage("The orderable of the previous order and the new one order don't match");
orderService.saveOrder(order, null);
}
代码示例来源:origin: openmrs/openmrs-module-webservices.rest
/**
* Display string for {@link Order}
*
* @param order
* @return ConceptName
*/
@PropertyGetter("display")
public String getDisplayString(Order order) {
if (order.getConcept() == null)
return "[No Concept]";
return order.getConcept().getName().getName();
}
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
/**
* Removes an Order of the relevant Concept from existingOrders, and returns it.
*
* @param concept - question the concept associated with the Obs to remove
* @return
*/
public Order removeExistingOrder(Concept concept) {
List<Order> list = existingOrders.get(concept);
if (list != null) {
for (Iterator<Order> iter = list.iterator(); iter.hasNext();) {
Order test = iter.next();
if (equalConcepts(concept, test.getConcept())) {
iter.remove();
if (list.size() == 0)
existingOrders.remove(concept);
return test;
}
}
}
return null;
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see OrderService#saveOrder(org.openmrs.Order, OrderContext)
*/
@Test
public void saveOrder_shouldFailIfConceptInPreviousOrderDoesNotMatchThisConcept() {
Order previousOrder = orderService.getOrder(7);
assertTrue(OrderUtilTest.isActiveOrder(previousOrder, null));
Order order = previousOrder.cloneForDiscontinuing();
order.setDateActivated(new Date());
order.setOrderReasonNonCoded("Discontinue this");
order.setEncounter(encounterService.getEncounter(6));
order.setOrderer(providerService.getProvider(1));
Concept newConcept = conceptService.getConcept(5089);
assertFalse(previousOrder.getConcept().equals(newConcept));
order.setConcept(newConcept);
expectedException.expect(EditedOrderDoesNotMatchPreviousException.class);
expectedException.expectMessage("The orderable of the previous order and the new one order don't match");
orderService.saveOrder(order, null);
}
代码示例来源:origin: openmrs/openmrs-core
assertEquals(anOrder.getConcept(), orderThatCanDiscontinueTheOrder.getConcept());
代码示例来源: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-module-htmlformentry
List<Order> list = existingOrders.get(order.getConcept());
if (list == null) {
list = new LinkedList<Order>();
existingOrders.put(order.getConcept(), list);
代码示例来源:origin: openmrs/openmrs-core
target.setConcept(getConcept());
target.setPatient(getPatient());
target.setOrderType(getOrderType());
代码示例来源: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.setPatient(getPatient());
target.setOrderType(getOrderType());
target.setConcept(getConcept());
target.setInstructions(getInstructions());
target.setDateActivated(getDateActivated());
代码示例来源:origin: openmrs/openmrs-module-webservices.rest
dcOrder.add("action", "DISCONTINUE");
dcOrder.add("patient", patient.getUuid());
dcOrder.add("concept", orderToDiscontinue.getConcept().getUuid());
dcOrder.add("careSetting", orderToDiscontinue.getCareSetting().getUuid());
dcOrder.add("previousOrder", orderToDiscontinue.getUuid());
assertEquals(dcOrder.get("previousOrder"), Util.getByPath(savedDCOrder, "previousOrder/uuid"));
assertNotNull(PropertyUtils.getProperty(savedDCOrder, "dateActivated"));
assertEquals(orderToDiscontinue.getConcept().getUuid(), Util.getByPath(savedDCOrder, "concept/uuid"));
assertEquals(dcOrder.get("encounter"), Util.getByPath(savedDCOrder, "encounter/uuid"));
assertEquals(dcOrder.get("orderer"), Util.getByPath(savedDCOrder, "orderer/uuid"));
代码示例来源:origin: openmrs/openmrs-module-webservices.rest
revisedOrder.add("patient", patient.getUuid());
revisedOrder.add("careSetting", orderToRevise.getCareSetting().getUuid());
revisedOrder.add("concept", orderToRevise.getConcept().getUuid());
revisedOrder.add("encounter", encounter.getUuid());
revisedOrder.add("orderer", "c2299800-cca9-11e0-9572-0800200c9a66");
内容来源于网络,如有侵权,请联系作者删除!