Package org.openmrs

Examples of org.openmrs.Order


        Drug drug2 = Context.getConceptService().getDrug(2);
        Drug drug3 = Context.getConceptService().getDrug(3);

        Set<Order> orders = new HashSet<Order>(editedEncounter.getOrders());
        for (Iterator<Order> it = orders.iterator(); it.hasNext();) {
          Order order = it.next();
          if (order.isVoided()) {
            it.remove();
          }
        }

        assertThat(
View Full Code Here


        regDrugOrders.add(context.removeExistingDrugOrder(dor.getDrug()));
        regWidget.setInitialValue(existingStandardRegimen.getCodeName());
        careSettingWidget.setInitialValue(dor.getCareSetting());
      }
      discontinuedDateWidget.setInitialValue(getCommonDiscontinueDate(regDrugOrders));
      Order discontinuationOrder = Context.getOrderService().getDiscontinuationOrder(regDrugOrders.get(0));
      if (discontinuedReasonWidget != null && discontinuationOrder != null)
        discontinuedReasonWidget.setInitialValue(discontinuationOrder.getOrderReason().getConceptId());
    }
  }
View Full Code Here

        o.setDateCreated(new Date());
      if (o.getCreator() == null)
        o.setCreator(Context.getAuthenticatedUser());
      if (o.getUuid() == null)
        o.setUuid(UUID.randomUUID().toString());
      Order discontinuationOrder = null;
      if (discontinuedDate != null) {
        discontinuationOrder = newDiscontinuationOrder(discontinuedDate, discontinuedReasonStr, o);
      }
      if (o.getOrderer() == null) {
        setOrderer(o, session);
View Full Code Here

      if (o.getCareSetting() == null) {
        CareSetting careSetting = getCareSetting(session, submission);
        o.setCareSetting(careSetting);
      }
     
      Order discontinuationOrder = null;
      if (discontinuedDate != null) {
        discontinuationOrder = newDiscontinuationOrder(discontinuedDate, discontinuedReasonStr, o);
      }
      session.getSubmissionActions().getCurrentEncounter().addOrder(o);
      if (discontinuationOrder != null) {
View Full Code Here

      }
    }
  }
 
  private Order newDiscontinuationOrder(Date discontinuedDate, String discontinuedReasonStr, Order o) {
    Order discontinuationOrder;
    discontinuationOrder = o.cloneForDiscontinuing();
    discontinuationOrder.setDateActivated(discontinuedDate);
    if (!StringUtils.isEmpty(discontinuedReasonStr)) {
      discontinuationOrder.setOrderReason(HtmlFormEntryUtil.getConcept(discontinuedReasonStr));
    }
    return discontinuationOrder;
  }
View Full Code Here

    Set<Order> orders = encounter.getOrders();
    if (!orders.isEmpty()) {
      ArrayList orderObjects = new ArrayList();
      Iterator<Order> orderIter = orders.iterator();
      while (orderIter.hasNext()) {
        Order currentOrder = orderIter.next();
        orderObjects.add(createObjectFromOrder(currentOrder));
      }
      obj.add("orders", orderObjects);
    }
    return obj;
View Full Code Here

           
            frequencyWidget.setInitialValue(lastRevision.getFrequency().getConcept().getId());
           
            if (!usingDurationField) {
              discontinuedDateWidget.setInitialValue(drugOrder.getDateStopped());
              Order discontinuationOrder = Context.getOrderService().getDiscontinuationOrder(drugOrder);
              if (discontinuedReasonWidget != null && discontinuationOrder != null)
                discontinuedReasonWidget.setInitialValue(discontinuationOrder.getOrderReason()
                        .getConceptId());
            }
            break;
          }
         
View Full Code Here

      }
      encNew.setObs(newObs);
     
      Set<Order> newOrders = new HashSet<Order>();
      for (Order o : source.getOrders()) {
        Order oNew = (Order) returnOrderCopy(o, replacementOrders);
        newOrders.add(oNew);
      }
      encNew.setOrders(newOrders);
      return encNew;
    }
View Full Code Here

   */
  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;
        }
View Full Code Here

        if (drug != null){
            Concept concept = drug.getConcept();
            List<Order> list = existingOrders.get(concept);
            if (list != null) {
                for (Iterator<Order> iter = list.iterator(); iter.hasNext();) {
                    Order test = iter.next();
                    if (test instanceof DrugOrder){
                        DrugOrder testDrugOrder = (DrugOrder) test;
                        if (equalDrug(testDrugOrder.getDrug(), drug)) {
                            iter.remove();
                            if (list.size() == 0)
View Full Code Here

TOP

Related Classes of org.openmrs.Order

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.