org.openmrs.api.impl
Class ActiveListServiceImpl

java.lang.Object
  extended by org.openmrs.api.impl.BaseOpenmrsService
      extended by org.openmrs.api.impl.ActiveListServiceImpl
All Implemented Interfaces:
ActiveListService, OpenmrsService

public class ActiveListServiceImpl
extends BaseOpenmrsService
implements ActiveListService

Default implementation of the active list service. This class should not be used on its own. The current OpenMRS implementation should be fetched from the Context via Context.getActiveListService()

See Also:
Context, ActiveListService

Constructor Summary
ActiveListServiceImpl()
           
 
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 class org.openmrs.api.impl.BaseOpenmrsService
onShutdown, onStartup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Constructor Detail

ActiveListServiceImpl

public ActiveListServiceImpl()
Method Detail

setActiveListDAO

public void setActiveListDAO(ActiveListDAO dao)
Description copied from interface: ActiveListService
Sets the DAO for this service. This is done by DI and Spring. See the applicationContext-service.xml definition file.

Specified by:
setActiveListDAO in interface ActiveListService
Parameters:
dao - DAO for this service
See Also:
ActiveListService.setActiveListDAO(org.openmrs.api.db.ActiveListDAO)

getActiveListItems

public java.util.List<ActiveListItem> getActiveListItems(Person p,
                                                         ActiveListType type)
                                                  throws APIException
Description copied from interface: ActiveListService
Returns a sorted set of active list items based on the type given.

Specified by:
getActiveListItems in interface ActiveListService
Parameters:
p - the Person
type - Problem or Allergy
Returns:
sorted set based on the start date
Throws:
APIException
See Also:
ActiveListService.getActiveListItems(org.openmrs.Person, org.openmrs.activelist.ActiveListType)

getActiveListItems

public <T extends ActiveListItem> java.util.List<T> getActiveListItems(java.lang.Class<T> clazz,
                                                                       Person p,
                                                                       ActiveListType type)
                                                            throws APIException
Description copied from interface: ActiveListService
Returns a sorted set of active list items from a class that extends ActiveListItem

Specified by:
getActiveListItems in interface ActiveListService
Parameters:
clazz - extends ActiveListItem
p - the Person
Returns:
sorted set based on the start date
Throws:
APIException
See Also:
ActiveListService.getActiveListItems(java.lang.Class, org.openmrs.Person, org.openmrs.activelist.ActiveListType)

getActiveListItem

public <T extends ActiveListItem> T getActiveListItem(java.lang.Class<T> clazz,
                                                      java.lang.Integer activeListItemId)
                                           throws APIException
Description copied from interface: ActiveListService
Returns the ActiveListItem

Specified by:
getActiveListItem in interface ActiveListService
Parameters:
clazz - extends ActiveListItem
activeListItemId - the unique ID of the Active List
Returns:
Throws:
APIException
See Also:
ActiveListService.getActiveListItem(java.lang.Class, java.lang.Integer)

getActiveListItemByUuid

public ActiveListItem getActiveListItemByUuid(java.lang.String uuid)
                                       throws APIException
Description copied from interface: ActiveListService
Return the ActiveList by the UUID

Specified by:
getActiveListItemByUuid in interface ActiveListService
Parameters:
uuid - unique identifier
Returns:
Throws:
APIException
See Also:
ActiveListService.getActiveListItemByUuid(java.lang.String)

saveActiveListItem

public ActiveListItem saveActiveListItem(ActiveListItem item)
                                  throws APIException
Description copied from interface: ActiveListService
Save or update an Active List Item

Specified by:
saveActiveListItem in interface ActiveListService
Returns:
the newly saved item
Throws:
APIException
See Also:
ActiveListService.saveActiveListItem(org.openmrs.activelist.ActiveListItem)

removeActiveListItem

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

Specified by:
removeActiveListItem in interface ActiveListService
Returns:
the newly removed item
Throws:
APIException
See Also:
ActiveListService.removeActiveListItem(org.openmrs.activelist.ActiveListItem, java.util.Date)

voidActiveListItem

public ActiveListItem voidActiveListItem(ActiveListItem item,
                                         java.lang.String reason)
                                  throws APIException
Description copied from interface: ActiveListService
Voids the Active List Item

Specified by:
voidActiveListItem in interface ActiveListService
Returns:
the newly voided item
Throws:
APIException
See Also:
ActiveListService.voidActiveListItem(org.openmrs.activelist.ActiveListItem, java.lang.String)

OpenMRS-1.7.x

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