|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Transactional public interface OrderService
Contains methods pertaining to creating/deleting/voiding Orders and DrugOrders Use:
Order order = new Order(); order.set___(___); ...etc Context.getOrderService().saveOrder(order);
Nested Class Summary | |
---|---|
static class |
OrderService.ORDER_STATUS
The type of status to match on an order. |
Field Summary | |
---|---|
static int |
SHOW_ALL
Deprecated. use OrderService.ORDER_STATUS.ANY |
static int |
SHOW_COMPLETE
Deprecated. use OrderService.ORDER_STATUS.COMPLETE |
static int |
SHOW_CURRENT
Deprecated. use OrderService.ORDER_STATUS.CURRENT |
static int |
SHOW_NOTVOIDED
Deprecated. use OrderService.ORDER_STATUS.NOTVOIDED |
Method Summary | ||
---|---|---|
void |
createOrder(Order order)
Deprecated. use #saveOrder(Order) |
|
void |
createOrdersAndEncounter(Patient p,
java.util.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,
java.util.Date discontinueDate)
Deprecated. use OrderUtil.discontinueAllOrders(Patient, Concept, Date) |
|
void |
discontinueDrugSet(Patient patient,
java.lang.String drugSetId,
Concept discontinueReason,
java.util.Date discontinueDate)
Deprecated. use OrderUtil.discontinueDrugSet(Patient, String, Concept, Date) |
|
Order |
discontinueOrder(Order order,
Concept discontinueReason,
java.util.Date discontinueDate)
Mark the given order as discontinued. |
|
java.util.List<OrderType> |
getAllOrderTypes()
Get all order types, including retired ones |
|
java.util.List<OrderType> |
getAllOrderTypes(boolean includeRetired)
Get all order types, only showing ones not marked as retired if includeRetired is true |
|
DrugOrder |
getDrugOrder(java.lang.Integer drugOrderId)
Deprecated. use getOrder(Integer, Class) with DrugOrder.class as second parameter
instead |
|
java.util.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 |
|
java.util.List<DrugOrder> |
getDrugOrdersByPatient(Patient patient)
Get all orders for the given patient |
|
java.util.List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
int whatToShow)
Deprecated. use getDrugOrdersByPatient(Patient, org.openmrs.api.OrderService.ORDER_STATUS) |
|
java.util.List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
int whatToShow,
boolean includeVoided)
Deprecated. use getDrugOrdersByPatient(Patient, org.openmrs.api.OrderService.ORDER_STATUS, boolean) |
|
java.util.List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
OrderService.ORDER_STATUS orderStatus)
Get drug orders for a given patient, not including voided orders |
|
java.util.List<DrugOrder> |
getDrugOrdersByPatient(Patient patient,
OrderService.ORDER_STATUS orderStatus,
boolean includeVoided)
Get drug orders for a given patient |
|
java.util.Map<java.lang.String,java.lang.String> |
getDrugSetHeadersByDrugSetIdList(java.lang.String drugSetIds)
Deprecated. use OrderUtil.getDrugSetHeadersByDrugSetIdList(String) |
|
java.util.Map<Concept,java.util.List<DrugOrder>> |
getDrugSetsByConcepts(java.util.List<DrugOrder> drugOrders,
java.util.List<Concept> drugSets)
Deprecated. use OrderUtil.getDrugSetsByConcepts(List, List) |
|
java.util.Map<java.lang.String,java.util.List<DrugOrder>> |
getDrugSetsByDrugSetIdList(java.util.List<DrugOrder> orderList,
java.lang.String drugSetIdList,
java.lang.String delimiter)
Deprecated. use OrderUtil.getDrugSetsByDrugSetIdList(List, String, String) |
|
Order |
getOrder(java.lang.Integer orderId)
Get order by internal primary key identifier |
|
|
getOrder(java.lang.Integer orderId,
java.lang.Class<Ord> orderClassType)
Gets the order with the associated order id |
|
Order |
getOrderByUuid(java.lang.String uuid)
Get Order by its UUID |
|
java.util.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 |
|
|
getOrders(java.lang.Class<Ord> orderClassType,
java.util.List<Patient> patients,
java.util.List<Concept> concepts,
OrderService.ORDER_STATUS status,
java.util.List<User> orderers,
java.util.List<Encounter> encounters,
java.util.List<OrderType> orderTypes)
This searches for orders given the parameters. |
|
java.util.List<Order> |
getOrdersByEncounter(Encounter encounter)
Gets all orders contained in an encounter |
|
java.util.List<Order> |
getOrdersByPatient(Patient patient)
Get all orders by Patient |
|
java.util.List<Order> |
getOrdersByUser(User user)
Get all orders by the User that is marked as their orderer |
|
OrderType |
getOrderType(java.lang.Integer orderTypeId)
Get orderType by internal identifier |
|
OrderType |
getOrderTypeByUuid(java.lang.String uuid)
Get OrderType by its UUID |
|
java.util.List<OrderType> |
getOrderTypes()
Deprecated. use #getAllOrderTypes() |
|
java.util.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,
java.lang.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,
java.lang.String drugSetId,
java.lang.String voidReason,
int whatToVoid)
Deprecated. use OrderUtil.voidDrugSet(Patient, String, String, org.openmrs.api.OrderService.ORDER_STATUS) |
|
Order |
voidOrder(Order order,
java.lang.String voidReason)
Mark an order as voided. |
Methods inherited from interface org.openmrs.api.OpenmrsService |
---|
onShutdown, onStartup |
Field Detail |
---|
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
Method Detail |
---|
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 database
order
- the Order to save
APIException
@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 system
APIException
@Authorized(value="Delete Orders") Order voidOrder(Order order, java.lang.String voidReason) throws APIException
voidReason
- String reasonorder
- Order to void
APIException
@Authorized(value="Edit Orders") Order discontinueOrder(Order order, Concept discontinueReason, java.util.Date discontinueDate) throws APIException
voidOrder(Order, String)
method should
probably be used.
discontinueReason
- String reason for discontinuing this orderorder
- Order to discontinue
APIException
@Authorized(value={"Add Orders","Add Encounters"}, requireAll=true) void createOrdersAndEncounter(Patient p, java.util.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(java.lang.Integer orderId) throws APIException
orderId
- internal order identifier
APIException
getOrder(Integer, Class)
@Transactional(readOnly=true) Order getOrderByUuid(java.lang.String uuid) throws APIException
uuid
-
APIException
@Authorized(value="View Orders") <Ord extends Order> Ord getOrder(java.lang.Integer orderId, java.lang.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(java.lang.Integer drugOrderId) throws APIException
getOrder(Integer, Class)
with DrugOrder.class as second parameter
instead
APIException
@Authorized(value="View Orders") <Ord extends Order> java.util.List<Ord> getOrders(java.lang.Class<Ord> orderClassType, java.util.List<Patient> patients, java.util.List<Concept> concepts, OrderService.ORDER_STATUS status, java.util.List<User> orderers, java.util.List<Encounter> encounters, java.util.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") java.util.List<Order> getOrders() throws APIException
getOrders(Class, List, List, org.openmrs.api.OrderService.ORDER_STATUS, List, List, List)
with empty parameters
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.List<DrugOrder> getDrugOrders() throws APIException
getOrders(Class, List, List, org.openmrs.api.OrderService.ORDER_STATUS, List, List, List)
with empty parameters
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.List<Order> getOrdersByUser(User user) throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.List<Order> getOrdersByPatient(Patient patient) throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.List<DrugOrder> getDrugOrdersByPatient(Patient patient, int whatToShow)
getDrugOrdersByPatient(Patient, org.openmrs.api.OrderService.ORDER_STATUS)
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.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") java.util.List<DrugOrder> getDrugOrdersByPatient(Patient patient, int whatToShow, boolean includeVoided)
getDrugOrdersByPatient(Patient, org.openmrs.api.OrderService.ORDER_STATUS, boolean)
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.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-discontinued
APIException
discontinueOrder(Order, Concept, Date)
@Authorized(value="Delete Orders") Order unvoidOrder(Order order) throws APIException
voidOrder(Order, String)
order
- order to be unvoided
APIException
@Authorized(value="Manage Order Types") OrderType saveOrderType(OrderType orderType) throws APIException
orderType
in the database
orderType
- The OrderType to save in the database
APIException
@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, java.lang.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 unretire
APIException
@Transactional(readOnly=true) @Authorized(value="View Order Types") java.util.List<OrderType> getOrderTypes() throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Order Types") java.util.List<OrderType> getAllOrderTypes() throws APIException
APIException
getAllOrderTypes(boolean)
@Transactional(readOnly=true) @Authorized(value="View Order Types") java.util.List<OrderType> getAllOrderTypes(boolean includeRetired) throws APIException
includeRetired
- true/false whether to include retired orderTypes in this list
APIException
@Transactional(readOnly=true) @Authorized(value="View Order Types") OrderType getOrderType(java.lang.Integer orderTypeId) throws APIException
orderTypeId
-
APIException
@Transactional(readOnly=true) OrderType getOrderTypeByUuid(java.lang.String uuid) throws APIException
uuid
-
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.List<DrugOrder> getDrugOrdersByPatient(Patient patient) throws APIException
patient
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.Map<Concept,java.util.List<DrugOrder>> getDrugSetsByConcepts(java.util.List<DrugOrder> drugOrders, java.util.List<Concept> drugSets) throws APIException
OrderUtil.getDrugSetsByConcepts(List, List)
APIException
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.List<RegimenSuggestion> getStandardRegimens()
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.Map<java.lang.String,java.util.List<DrugOrder>> getDrugSetsByDrugSetIdList(java.util.List<DrugOrder> orderList, java.lang.String drugSetIdList, java.lang.String delimiter)
OrderUtil.getDrugSetsByDrugSetIdList(List, String, String)
@Transactional(readOnly=true) @Authorized(value="View Orders") java.util.Map<java.lang.String,java.lang.String> getDrugSetHeadersByDrugSetIdList(java.lang.String drugSetIds)
OrderUtil.getDrugSetHeadersByDrugSetIdList(String)
@Authorized(value="Edit Orders") void discontinueDrugSet(Patient patient, java.lang.String drugSetId, Concept discontinueReason, java.util.Date discontinueDate)
OrderUtil.discontinueDrugSet(Patient, String, Concept, Date)
@Authorized(value="Delete Orders") void voidDrugSet(Patient patient, java.lang.String drugSetId, java.lang.String voidReason, int whatToVoid)
OrderUtil.voidDrugSet(Patient, String, String, org.openmrs.api.OrderService.ORDER_STATUS)
@Authorized(value="Edit Orders") void discontinueAllOrders(Patient patient, Concept discontinueReason, java.util.Date discontinueDate) throws APIException
OrderUtil.discontinueAllOrders(Patient, Concept, Date)
APIException
@Transactional(readOnly=true) java.util.List<Order> getOrdersByEncounter(Encounter encounter)
encounter
- the encounter in which to search for orders
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |