Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eee9f9562374
Choose a base ref
...
head repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0c238a4490c6
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Mar 10, 2014

  1. This add a new class called OrderContext which has it's attributes wi…

    …th getters and setters
    akshika47 authored and wluyima committed Mar 10, 2014
    Copy the full SHA
    357d109 View commit details
  2. Follow up to TRUNK-4271

    wluyima committed Mar 10, 2014
    Copy the full SHA
    0c238a4 View commit details
Showing with 80 additions and 0 deletions.
  1. +80 −0 api/src/main/java/org/openmrs/OrderContext.java
80 changes: 80 additions & 0 deletions api/src/main/java/org/openmrs/OrderContext.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* The contents of this file are subject to the OpenMRS Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs;

import java.util.HashMap;
import java.util.Map;

/**
* Contains contextual information like the OrderType, CareSetting and any other custom attributes
* that are passed to the service layer when placing a new Order E.g you could add a user defined
* order number from a form that can be looked up from the context and returned by a custom
* OrderNumberGenerator
*
* @since 1.10
*/
public class OrderContext {

private OrderType orderType;

private CareSetting careSetting;

private Map<String, Object> contextAttributes;

/**
* @return the orderType
*/
public OrderType getOrderType() {
return orderType;
}

/**
* @param orderType the OrderType to set
*/
public void setOrderType(OrderType orderType) {
this.orderType = orderType;
}

/**
* @return the careSetting
*/
public CareSetting getCareSetting() {
return careSetting;
}

/**
* @param careSetting the CareSetting to set
*/
public void setCareSetting(CareSetting careSetting) {
this.careSetting = careSetting;
}

/**
* @return the contextAttributes
*/
public Map<String, Object> getContextAttributes() {
if (contextAttributes == null) {
return contextAttributes = new HashMap<String, Object>();
}
return contextAttributes;
}

/**
* @param contextAttributes the context attributes to set
*/
public void setContextAttributes(Map<String, Object> contextAttributes) {
this.contextAttributes = contextAttributes;
}

}