org.openmrs.api
Interface ActiveListService

All Superinterfaces:
OpenmrsService
All Known Implementing Classes:
ActiveListServiceImpl

@Transactional
public interface ActiveListService
extends OpenmrsService

Contains generic methods pertaining to Active Lists in the system

See Also:
Context, Patient

Method Summary
<T extends ActiveListItem>
T
getActiveListItem(java.lang.Class<T> clazz, java.lang.Integer activeListItemId)
          Returns the ActiveListItem
 ActiveListItem getActiveListItemByUuid(java.lang.String uuid)
          Return the ActiveList by the UUID
<T extends ActiveListItem>
java.util.List<T>
getActiveListItems(java.lang.Class<T> clazz, Person p, ActiveListType type)
          Returns a sorted set of active list items from a class that extends ActiveListItem
 java.util.List<ActiveListItem> getActiveListItems(Person p, ActiveListType type)
          Returns a sorted set of active list items based on the type given.
 ActiveListItem removeActiveListItem(ActiveListItem item, java.util.Date endDate)
          Sets the Active List Item as inactive by setting the end date to today, if null
 ActiveListItem saveActiveListItem(ActiveListItem item)
          Save or update an Active List Item
 void setActiveListDAO(ActiveListDAO dao)
          Sets the DAO for this service.
 ActiveListItem voidActiveListItem(ActiveListItem item, java.lang.String reason)
          Voids the Active List Item
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Method Detail

setActiveListDAO

void setActiveListDAO(ActiveListDAO dao)
Sets the DAO for this service. This is done by DI and Spring. See the applicationContext-service.xml definition file.

Parameters:
dao - DAO for this service

getActiveListItems

@Transactional(readOnly=true)
java.util.List<ActiveListItem> getActiveListItems(Person p,
                                                                ActiveListType type)
                                                  throws APIException
Returns a sorted set of active list items based on the type given.

Parameters:
p - the Person
type - Problem or Allergy
Returns:
sorted set based on the start date
Throws:
APIException

getActiveListItems

@Transactional(readOnly=true)
<T extends ActiveListItem> java.util.List<T> getActiveListItems(java.lang.Class<T> clazz,
                                                                              Person p,
                                                                              ActiveListType type)
                                                            throws APIException
Returns a sorted set of active list items from a class that extends ActiveListItem

Parameters:
clazz - extends ActiveListItem
p - the Person
type -
Returns:
sorted set based on the start date
Throws:
APIException

getActiveListItem

@Transactional(readOnly=true)
<T extends ActiveListItem> T getActiveListItem(java.lang.Class<T> clazz,
                                                             java.lang.Integer activeListItemId)
                                           throws APIException
Returns the ActiveListItem

Parameters:
clazz - extends ActiveListItem
activeListItemId - the unique ID of the Active List
Returns:
Throws:
APIException

getActiveListItemByUuid

@Transactional(readOnly=true)
ActiveListItem getActiveListItemByUuid(java.lang.String uuid)
                                       throws APIException
Return the ActiveList by the UUID

Parameters:
uuid - unique identifier
Returns:
Throws:
APIException

saveActiveListItem

ActiveListItem saveActiveListItem(ActiveListItem item)
                                  throws APIException
Save or update an Active List Item

Parameters:
item -
Returns:
the newly saved item
Throws:
APIException

removeActiveListItem

ActiveListItem removeActiveListItem(ActiveListItem item,
                                    java.util.Date endDate)
                                    throws APIException
Sets the Active List Item as inactive by setting the end date to today, if null

Parameters:
item -
Returns:
the newly removed item
Throws:
APIException

voidActiveListItem

ActiveListItem voidActiveListItem(ActiveListItem item,
                                  java.lang.String reason)
                                  throws APIException
Voids the Active List Item

Parameters:
item -
Returns:
the newly voided item
Throws:
APIException

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change