@Transactional public interface OrderService extends OpenmrsService
Order order = new Order(); order.set___(___); ...etc Context.getOrderService().saveOrder(order);
Modifier and Type | Interface and Description |
---|---|
static class |
OrderService.ORDER_STATUS
The type of status to match on an order.
|
Modifier and Type | Field and Description |
---|---|
static int |
SHOW_ALL
Deprecated.
|
static int |
SHOW_COMPLETE
Deprecated.
|
static int |
SHOW_CURRENT
Deprecated.
|
static int |
SHOW_CURRENT_AND_FUTURE
Deprecated.
|
static int |
SHOW_NOTVOIDED
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
createOrder(Order order)
Deprecated.
use #saveOrder(Order)
|
void |
createOrdersAndEncounter(Patient p,
Collection<Order> orders)
Creates a collection of orders and an encounter to hold them.
|
void |
createOrderType(OrderType orderType)
Deprecated.
use #saveOrderType(OrderType)
|
void |
deleteOrder(Order order)
Deprecated.
use #purgeOrder(Order)
|
void |
deleteOrderType(OrderType orderType)
Deprecated.
use #purgeOrderType(OrderType)
|
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.
use
getOrder(Integer, Class) with DrugOrder.class as second parameter
instead |
List<DrugOrder> |
getDrugOrders()
Deprecated.
this method would return a very large list for most systems and doesn't make
sense to be used. If _all_ Orders are really what is wanted, use
getOrders(Class, List, List, org.openmrs.api.OrderService.ORDER_STATUS, List, List, List)
with empty parameters |
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient)
Get all orders for the given
patient |
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
int whatToShow)
|
List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
int whatToShow,
boolean includeVoided)
|
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
|
<Ord extends Order> |
getOrder(Integer orderId,
Class<Ord> orderClassType)
Gets the order with the associated order id
|
Order |
getOrderByUuid(String uuid)
Get Order by its UUID
|
List<Order> |
getOrders()
Deprecated.
this method would return a very large list for most systems and doesn't make
sense to be used. If _all_ Orders are really what is wanted, use
getOrders(Class, List, List, org.openmrs.api.OrderService.ORDER_STATUS, List, List, List)
with empty parameters |
<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.
use #getAllOrderTypes()
|
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 |
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.
use #saveOrder(Order)
|
void |
updateOrderType(OrderType orderType)
Deprecated.
use #saveOrderType(OrderType)
|
void |
voidDrugSet(Patient patient,
String drugSetId,
String voidReason,
int whatToVoid)
|
Order |
voidOrder(Order order,
String voidReason)
Mark an order as voided.
|
onShutdown, onStartup
static final int SHOW_CURRENT
OrderService.ORDER_STATUS.CURRENT
static final int SHOW_ALL
OrderService.ORDER_STATUS.ANY
static final int SHOW_COMPLETE
OrderService.ORDER_STATUS.COMPLETE
static final int SHOW_NOTVOIDED
OrderService.ORDER_STATUS.NOTVOIDED
static final int SHOW_CURRENT_AND_FUTURE
OrderService.ORDER_STATUS.CURRENT_AND_FUTURE
void setOrderDAO(OrderDAO dao)
dao
- The data access object to use@Authorized(value="Add Orders") void createOrder(Order order) throws APIException
APIException
@Authorized(value="Edit Orders") void updateOrder(Order order) throws APIException
APIException
@Authorized(value={"Edit Orders","Add Orders"}) Order saveOrder(Order order) throws APIException
order
in the databaseorder
- the Order to saveAPIException
@Authorized(value="Delete Orders") void deleteOrder(Order order) throws APIException
APIException
@Authorized(value="Purge Orders") void purgeOrder(Order order) throws APIException
voidOrder(Order, String)
order
- The Order to remove from the systemAPIException
@Authorized(value="Delete Orders") Order voidOrder(Order order, String voidReason) throws APIException
voidReason
- String reasonorder
- Order to voidAPIException
@Authorized(value="Edit Orders") Order discontinueOrder(Order order, Concept discontinueReason, Date discontinueDate) throws APIException
voidOrder(Order, String)
method should
probably be used.discontinueReason
- String reason for discontinuing this orderorder
- Order to discontinueAPIException
@Authorized(value={"Add Orders","Add Encounters"}, requireAll=true) void createOrdersAndEncounter(Patient p, Collection<Order> orders) throws APIException
p
- 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'@Transactional(readOnly=true) @Authorized(value="View Orders") Order getOrder(Integer orderId) throws APIException
orderId
- internal order identifierAPIException
getOrder(Integer, Class)
@Transactional(readOnly=true) Order getOrderByUuid(String uuid) throws APIException
uuid
- APIException
@Authorized(value="View Orders") <Ord extends Order> Ord getOrder(Integer orderId, Class<Ord> orderClassType) throws APIException
Ord
- 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)APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") DrugOrder getDrugOrder(Integer drugOrderId) throws APIException
getOrder(Integer, Class)
with DrugOrder.class as second parameter
insteadAPIException
@Authorized(value="View Orders") <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)
orderClassType
- 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 on@Transactional(readOnly=true) @Authorized(value="View Orders") List<Order> getOrders() throws APIException
getOrders(Class, List, List, org.openmrs.api.OrderService.ORDER_STATUS, List, List, List)
with empty parametersAPIException
@Transactional(readOnly=true) @Authorized(value="View Orders") List<DrugOrder> getDrugOrders() throws APIException
getOrders(Class, List, List, org.openmrs.api.OrderService.ORDER_STATUS, List, List, List)
with empty parametersAPIException
@Transactional(readOnly=true) @Authorized(value="View Orders") List<Order> getOrdersByUser(User user) throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") List<Order> getOrdersByPatient(Patient patient) throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") List<DrugOrder> getDrugOrdersByPatient(Patient patient, int whatToShow)
@Transactional(readOnly=true) @Authorized(value="View Orders") List<DrugOrder> getDrugOrdersByPatient(Patient patient, OrderService.ORDER_STATUS orderStatus)
patient
- orderStatus
- getDrugOrdersByPatient(Patient, org.openmrs.api.OrderService.ORDER_STATUS, boolean)
@Transactional(readOnly=true) @Authorized(value="View Orders") List<DrugOrder> getDrugOrdersByPatient(Patient patient, int whatToShow, boolean includeVoided)
@Transactional(readOnly=true) @Authorized(value="View Orders") List<DrugOrder> getDrugOrdersByPatient(Patient patient, OrderService.ORDER_STATUS orderStatus, boolean includeVoided)
patient
- the owning Patient of the returned ordersorderStatus
- the status of the orders returnedincludeVoided
- true/false whether or not to include voided drug orders@Authorized(value="Edit Orders") Order undiscontinueOrder(Order order) throws APIException
discontinueOrder(Order, Concept, Date)
order
- order to be un-discontinuedAPIException
discontinueOrder(Order, Concept, Date)
@Authorized(value="Delete Orders") Order unvoidOrder(Order order) throws APIException
voidOrder(Order, String)
order
- order to be unvoidedAPIException
@Authorized(value="Manage Order Types") OrderType saveOrderType(OrderType orderType) throws APIException
orderType
in the databaseorderType
- The OrderType to save in the databaseAPIException
@Authorized(value="Purge Order Types") void purgeOrderType(OrderType orderType) throws APIException
orderType
- APIException
@Authorized(value="Manage Order Types") void createOrderType(OrderType orderType) throws APIException
APIException
@Authorized(value="Manage Order Types") void updateOrderType(OrderType orderType) throws APIException
APIException
@Authorized(value="Purge Order Types") void deleteOrderType(OrderType orderType) throws APIException
APIException
@Authorized(value="Manage Order Types") OrderType retireOrderType(OrderType orderType, String reason) throws APIException
orderType
out of active use in OpenMRS.
All references to this order type will remain in place. Future use of this order type are
discouraged.orderType
- the order type to retiredreason
- The reason this order type is being taken our of commission.APIException
@Authorized(value="Manage Order Types") OrderType unretireOrderType(OrderType orderType) throws APIException
orderType
- the order type to unretireAPIException
@Transactional(readOnly=true) @Authorized(value="View Order Types") List<OrderType> getOrderTypes() throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Order Types") List<OrderType> getAllOrderTypes() throws APIException
APIException
getAllOrderTypes(boolean)
@Transactional(readOnly=true) @Authorized(value="View Order Types") List<OrderType> getAllOrderTypes(boolean includeRetired) throws APIException
includeRetired
- true/false whether to include retired orderTypes in this listAPIException
@Transactional(readOnly=true) @Authorized(value="View Order Types") OrderType getOrderType(Integer orderTypeId) throws APIException
orderTypeId
- APIException
@Transactional(readOnly=true) OrderType getOrderTypeByUuid(String uuid) throws APIException
uuid
- APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") List<DrugOrder> getDrugOrdersByPatient(Patient patient) throws APIException
patient
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") Map<Concept,List<DrugOrder>> getDrugSetsByConcepts(List<DrugOrder> drugOrders, List<Concept> drugSets) throws APIException
OrderUtil.getDrugSetsByConcepts(List, List)
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") List<RegimenSuggestion> getStandardRegimens()
@Transactional(readOnly=true) @Authorized(value="View Orders") Map<String,List<DrugOrder>> getDrugSetsByDrugSetIdList(List<DrugOrder> orderList, String drugSetIdList, String delimiter)
OrderUtil.getDrugSetsByDrugSetIdList(List, String, String)
@Transactional(readOnly=true) @Authorized(value="View Orders") Map<String,String> getDrugSetHeadersByDrugSetIdList(String drugSetIds)
OrderUtil.getDrugSetHeadersByDrugSetIdList(String)
@Authorized(value="Edit Orders") void discontinueDrugSet(Patient patient, String drugSetId, Concept discontinueReason, Date discontinueDate)
OrderUtil.discontinueDrugSet(Patient, String, Concept, Date)
@Authorized(value="Delete Orders") void voidDrugSet(Patient patient, String drugSetId, String voidReason, int whatToVoid)
@Authorized(value="Edit Orders") void discontinueAllOrders(Patient patient, Concept discontinueReason, Date discontinueDate) throws APIException
OrderUtil.discontinueAllOrders(Patient, Concept, Date)
APIException
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.