public class OrderServiceImpl extends BaseOpenmrsService implements OrderService
OrderServiceOrderService.ORDER_STATUS| Modifier and Type | Field and Description |
|---|---|
protected OrderDAO |
dao |
protected org.apache.commons.logging.Log |
log |
SHOW_ALL, SHOW_COMPLETE, SHOW_CURRENT, SHOW_CURRENT_AND_FUTURE, SHOW_NOTVOIDED| Constructor and Description |
|---|
OrderServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
createOrder(Order order)
Deprecated.
|
void |
createOrdersAndEncounter(Patient p,
Collection<Order> orders)
TODO: Refactor, generalize, or remove this method
|
void |
createOrderType(OrderType orderType)
Deprecated.
|
void |
deleteOrder(Order order)
Deprecated.
|
void |
deleteOrderType(OrderType orderType)
Deprecated.
|
void |
discontinueAllOrders(Patient patient,
Concept discontinueReason,
Date discontinueDate)
Deprecated.
|
void |
discontinueDrugSet(Patient patient,
String drugSetId,
Concept discontinueReason,
Date discontinueDate)
Deprecated.
|
Order |
discontinueOrder(Order order,
Concept discontinueReason,
Date discontinueDate)
Mark the given order as discontinued.
|
List<OrderType> |
getAllOrderTypes()
Get all order types, including retired ones
|
List<OrderType> |
getAllOrderTypes(boolean includeRetired)
Get all order types, only showing ones not marked as retired if includeRetired is true
|
DrugOrder |
getDrugOrder(Integer drugOrderId)
Deprecated.
|
List<DrugOrder> |
getDrugOrders()
Deprecated.
This is a dumb method
|
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient)
Get all orders for the given
patient |
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
int whatToShow)
Deprecated.
|
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
int whatToShow,
boolean includeVoided)
Deprecated.
|
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
OrderService.ORDER_STATUS orderStatus)
Get drug orders for a given patient, not including voided orders
|
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
OrderService.ORDER_STATUS orderStatus,
boolean includeVoided)
Get drug orders for a given patient
|
Map<String,String> |
getDrugSetHeadersByDrugSetIdList(String drugSetIds)
Deprecated.
|
Map<Concept,List<DrugOrder>> |
getDrugSetsByConcepts(List<DrugOrder> drugOrders,
List<Concept> drugSets)
Deprecated.
|
Map<String,List<DrugOrder>> |
getDrugSetsByDrugSetIdList(List<DrugOrder> orderList,
String drugSetIdList,
String delimiter)
Deprecated.
|
Order |
getOrder(Integer orderId)
Get order by internal primary key identifier
|
<o extends Order> |
getOrder(Integer orderId,
Class<o> orderClassType)
Gets the order with the associated order id
|
Order |
getOrderByUuid(String uuid)
Get Order by its UUID
|
List<Order> |
getOrders()
Deprecated.
This is a dumb method
|
<Ord extends Order> |
getOrders(Class<Ord> orderClassType,
List<Patient> patients,
List<Concept> concepts,
OrderService.ORDER_STATUS status,
List<User> orderers,
List<Encounter> encounters,
List<OrderType> orderTypes)
This searches for orders given the parameters.
|
List<Order> |
getOrdersByEncounter(Encounter encounter)
Gets all orders contained in an encounter
|
List<Order> |
getOrdersByPatient(Patient patient)
Get all orders by Patient
|
List<Order> |
getOrdersByUser(User user)
Get all orders by the User that is marked as their orderer
|
OrderType |
getOrderType(Integer orderTypeId)
Get orderType by internal identifier
|
OrderType |
getOrderTypeByUuid(String uuid)
Get OrderType by its UUID
|
List<OrderType> |
getOrderTypes()
Deprecated.
|
List<RegimenSuggestion> |
getStandardRegimens()
The standard regimens are currently stored in the application context file.
|
void |
purgeOrder(Order order)
Completely delete an order from the database.
|
void |
purgeOrder(Order order,
boolean cascade) |
void |
purgeOrderType(OrderType orderType)
Completely delete the order type from the system.
|
OrderType |
retireOrderType(OrderType orderType,
String reason)
This method essentially takes the given
orderType out of active use in OpenMRS. |
Order |
saveOrder(Order order)
Save or update the given
order in the database |
OrderType |
saveOrderType(OrderType orderType)
Save or update the given
orderType in the database |
void |
setOrderDAO(OrderDAO dao)
Setter for the Order data access object.
|
Order |
undiscontinueOrder(Order order)
Un-discontinue order record.
|
OrderType |
unretireOrderType(OrderType orderType)
This will bring back a previously decommissioned OrderType
|
Order |
unvoidOrder(Order order)
Unvoid order record.
|
void |
updateOrder(Order order)
Deprecated.
|
void |
updateOrderType(OrderType orderType)
Deprecated.
|
void |
voidDrugSet(Patient patient,
String drugSetId,
String voidReason,
int whatToVoid)
|
Order |
voidOrder(Order order,
String voidReason)
Mark an order as voided.
|
onShutdown, onStartupclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonShutdown, onStartupprotected final org.apache.commons.logging.Log log
protected OrderDAO dao
public void setOrderDAO(OrderDAO dao)
OrderServicesetOrderDAO in interface OrderServicedao - The data access object to useOrderService.setOrderDAO(org.openmrs.api.db.OrderDAO)public Order saveOrder(Order order) throws APIException
OrderServiceorder in the databasesaveOrder in interface OrderServiceorder - the Order to saveAPIExceptionOrderService.saveOrder(org.openmrs.Order)@Deprecated public void createOrder(Order order) throws APIException
createOrder in interface OrderServiceAPIExceptionOrderService.createOrder(org.openmrs.Order)@Deprecated public void updateOrder(Order order) throws APIException
updateOrder in interface OrderServiceAPIExceptionOrderService.updateOrder(org.openmrs.Order)@Deprecated public void deleteOrder(Order order) throws APIException
deleteOrder in interface OrderServiceAPIExceptionOrderService.deleteOrder(org.openmrs.Order)public void purgeOrder(Order order) throws APIException
OrderServiceOrderService.voidOrder(Order, String)purgeOrder in interface OrderServiceorder - The Order to remove from the systemAPIExceptionOrderService.purgeOrder(org.openmrs.Order)public void purgeOrder(Order order, boolean cascade) throws APIException
APIExceptionOrderService.purgeOrder(Order)public Order voidOrder(Order order, String voidReason) throws APIException
OrderServicevoidOrder in interface OrderServiceorder - Order to voidvoidReason - String reasonAPIExceptionOrderService.voidOrder(org.openmrs.Order, java.lang.String)public Order unvoidOrder(Order order) throws APIException
OrderServiceOrderService.voidOrder(Order, String)unvoidOrder in interface OrderServiceorder - order to be unvoidedAPIExceptionOrderService.unvoidOrder(org.openmrs.Order)public Order discontinueOrder(Order order, Concept discontinueReason, Date discontinueDate) throws APIException
OrderServiceOrderService.voidOrder(Order, String) method should
probably be used.discontinueOrder in interface OrderServiceorder - Order to discontinuediscontinueReason - String reason for discontinuing this orderAPIExceptionOrderService.discontinueOrder(org.openmrs.Order, org.openmrs.Concept,
java.util.Date)public Order undiscontinueOrder(Order order) throws APIException
OrderServiceOrderService.discontinueOrder(Order, Concept, Date)undiscontinueOrder in interface OrderServiceorder - order to be un-discontinuedAPIExceptionOrderService.undiscontinueOrder(org.openmrs.Order)public OrderType saveOrderType(OrderType orderType) throws APIException
OrderServiceorderType in the databasesaveOrderType in interface OrderServiceorderType - The OrderType to save in the databaseAPIExceptionOrderService.saveOrderType(org.openmrs.OrderType)@Deprecated public void createOrderType(OrderType orderType) throws APIException
createOrderType in interface OrderServiceAPIExceptionOrderService.createOrderType(org.openmrs.OrderType)@Deprecated public void updateOrderType(OrderType orderType) throws APIException
updateOrderType in interface OrderServiceAPIExceptionOrderService.updateOrderType(org.openmrs.OrderType)@Deprecated public void deleteOrderType(OrderType orderType) throws APIException
deleteOrderType in interface OrderServiceAPIExceptionOrderService.deleteOrderType(org.openmrs.OrderType)public OrderType retireOrderType(OrderType orderType, String reason) throws APIException
OrderServiceorderType out of active use in OpenMRS.
All references to this order type will remain in place. Future use of this order type are
discouraged.retireOrderType in interface OrderServiceorderType - the order type to retiredreason - The reason this order type is being taken our of commission.APIExceptionOrderService.retireOrderType(OrderType, String)public OrderType unretireOrderType(OrderType orderType) throws APIException
OrderServiceunretireOrderType in interface OrderServiceorderType - the order type to unretireAPIExceptionOrderService.unretireOrderType(org.openmrs.OrderType)public void purgeOrderType(OrderType orderType) throws APIException
OrderServicepurgeOrderType in interface OrderServiceAPIExceptionOrderService.purgeOrderType(org.openmrs.OrderType)public void createOrdersAndEncounter(Patient p, Collection<Order> orders) throws APIException
createOrdersAndEncounter in interface OrderServicep - the patient to add Orders toorders - The Orders to add to the Patient (and to the makeshift Encounter)APIException - if there is no User with username Unknown or no Location with name
Unknown or Unknown Location, or if there's no encounter type with name 'Regimen
Change'OrderService.createOrdersAndEncounter(org.openmrs.Patient,
java.util.Collection)public Order getOrder(Integer orderId) throws APIException
OrderServicegetOrder in interface OrderServiceorderId - internal order identifierAPIExceptionOrderService.getOrder(java.lang.Integer)@Deprecated public DrugOrder getDrugOrder(Integer drugOrderId) throws APIException
getDrugOrder in interface OrderServiceAPIExceptionOrderService.getDrugOrder(java.lang.Integer)public <o extends Order> o getOrder(Integer orderId, Class<o> orderClassType) throws APIException
OrderServicegetOrder in interface OrderServiceo - An Order type. Currently only org.openmrs.Order or org.openmrs.DrugOrderorderId - the primary key of the OrderorderClassType - The class of Order to fetch (Currently only org.openmrs.Order or
org.openmrs.DrugOrder)APIExceptionOrderService.getOrder(java.lang.Integer, java.lang.Class)@Deprecated public List<Order> getOrders() throws APIException
getOrders in interface OrderServiceAPIException@Deprecated public List<DrugOrder> getDrugOrders() throws APIException
getDrugOrders in interface OrderServiceAPIExceptionpublic <Ord extends Order> List<Ord> getOrders(Class<Ord> orderClassType, List<Patient> patients, List<Concept> concepts, OrderService.ORDER_STATUS status, List<User> orderers, List<Encounter> encounters, List<OrderType> orderTypes)
OrderServicegetOrders in interface OrderServiceorderClassType - The type of Order to get (currently only options are Order and
DrugOrder)patients - The patients to get orders forconcepts - The concepts in order.getConcept to get orders forstatus - The ORDER_STATUS of the orders for its patientorderers - The users/orderers of theencounters - The encounters that the orders are assigned toorderTypes - The OrderTypes to match onOrderService.getOrders(java.lang.Class, java.util.List, java.util.List,
org.openmrs.api.OrderService.ORDER_STATUS, java.util.List, java.util.List,
java.util.List)public List<Order> getOrdersByUser(User user) throws APIException
OrderServicegetOrdersByUser in interface OrderServiceAPIExceptionOrderService.getOrdersByUser(org.openmrs.User)public List<Order> getOrdersByPatient(Patient patient) throws APIException
OrderServicegetOrdersByPatient in interface OrderServiceAPIExceptionOrderService.getOrdersByPatient(org.openmrs.Patient)@Deprecated public List<DrugOrder> getDrugOrdersByPatient(Patient patient, int whatToShow)
getDrugOrdersByPatient in interface OrderServiceOrderService.getDrugOrdersByPatient(org.openmrs.Patient, int)@Deprecated public List<DrugOrder> getDrugOrdersByPatient(Patient patient, int whatToShow, boolean includeVoided)
getDrugOrdersByPatient in interface OrderServiceOrderService.getDrugOrdersByPatient(org.openmrs.Patient, int, boolean)public List<DrugOrder> getDrugOrdersByPatient(Patient patient, OrderService.ORDER_STATUS orderStatus, boolean includeVoided)
OrderServicegetDrugOrdersByPatient in interface OrderServicepatient - the owning Patient of the returned ordersorderStatus - the status of the orders returnedincludeVoided - true/false whether or not to include voided drug ordersOrderService.getDrugOrdersByPatient(org.openmrs.Patient,
org.openmrs.api.OrderService.ORDER_STATUS, boolean)public List<DrugOrder> getDrugOrdersByPatient(Patient patient, OrderService.ORDER_STATUS orderStatus)
OrderServicegetDrugOrdersByPatient in interface OrderServiceOrderService.getDrugOrdersByPatient(org.openmrs.Patient,
org.openmrs.api.OrderService.ORDER_STATUS)@Deprecated public List<OrderType> getOrderTypes() throws APIException
OrderServicegetOrderTypes in interface OrderServiceAPIExceptionOrderService.getOrderTypes()public List<OrderType> getAllOrderTypes() throws APIException
OrderServicegetAllOrderTypes in interface OrderServiceAPIExceptionOrderService.getAllOrderTypes()public List<OrderType> getAllOrderTypes(boolean includeRetired) throws APIException
OrderServicegetAllOrderTypes in interface OrderServiceincludeRetired - true/false whether to include retired orderTypes in this listAPIExceptionOrderService.getAllOrderTypes(boolean)public OrderType getOrderType(Integer orderTypeId) throws APIException
OrderServicegetOrderType in interface OrderServiceAPIExceptionOrderService.getOrderType(java.lang.Integer)public List<DrugOrder> getDrugOrdersByPatient(Patient patient) throws APIException
OrderServicepatientgetDrugOrdersByPatient in interface OrderServiceAPIExceptionOrderService.getDrugOrdersByPatient(org.openmrs.Patient)public List<RegimenSuggestion> getStandardRegimens()
OrderServicegetStandardRegimens in interface OrderServiceOrderService.getStandardRegimens()@Deprecated public Map<Concept,List<DrugOrder>> getDrugSetsByConcepts(List<DrugOrder> drugOrders, List<Concept> drugSets) throws APIException
OrderUtil.getDrugSetsByConcepts(List, List)getDrugSetsByConcepts in interface OrderServiceAPIExceptionOrderService.getDrugSetsByConcepts(java.util.List, java.util.List)@Deprecated public Map<String,List<DrugOrder>> getDrugSetsByDrugSetIdList(List<DrugOrder> orderList, String drugSetIdList, String delimiter)
OrderUtil.getDrugSetsByDrugSetIdList(List, String, String)getDrugSetsByDrugSetIdList in interface OrderServiceOrderService.getDrugSetsByDrugSetIdList(java.util.List,
java.lang.String, java.lang.String)@Deprecated public Map<String,String> getDrugSetHeadersByDrugSetIdList(String drugSetIds)
OrderUtil.getDrugSetHeadersByDrugSetIdList(String)getDrugSetHeadersByDrugSetIdList in interface OrderServiceOrderService.getDrugSetHeadersByDrugSetIdList(java.lang.String)@Deprecated public void discontinueDrugSet(Patient patient, String drugSetId, Concept discontinueReason, Date discontinueDate)
OrderUtil.discontinueDrugSet(Patient, String, Concept, Date)discontinueDrugSet in interface OrderServiceOrderService.discontinueDrugSet(org.openmrs.Patient, java.lang.String,
org.openmrs.Concept, java.util.Date)@Deprecated public void voidDrugSet(Patient patient, String drugSetId, String voidReason, int whatToVoid)
OrderUtil.voidDrugSet(Patient, String, String, org.openmrs.api.OrderService.ORDER_STATUS)voidDrugSet in interface OrderServiceOrderService.voidDrugSet(Patient, String, String, int)@Deprecated public void discontinueAllOrders(Patient patient, Concept discontinueReason, Date discontinueDate)
OrderUtil.discontinueAllOrders(Patient, Concept, Date)discontinueAllOrders in interface OrderServiceOrderService.discontinueAllOrders(org.openmrs.Patient,
org.openmrs.Concept, java.util.Date)public Order getOrderByUuid(String uuid) throws APIException
OrderServicegetOrderByUuid in interface OrderServiceAPIExceptionOrderService.getOrderByUuid(java.lang.String)public OrderType getOrderTypeByUuid(String uuid) throws APIException
OrderServicegetOrderTypeByUuid in interface OrderServiceAPIExceptionOrderService.getOrderTypeByUuid(java.lang.String)public List<Order> getOrdersByEncounter(Encounter encounter)
OrderServicegetOrdersByEncounter in interface OrderServiceencounter - the encounter in which to search for ordersOrderService.getOrdersByEncounter(org.openmrs.Encounter)Copyright © 2018 OpenMRS LLC.. All Rights Reserved.