org.openmrs.api.db.hibernate
Class HibernateEncounterDAO

java.lang.Object
  extended by org.openmrs.api.db.hibernate.HibernateEncounterDAO
All Implemented Interfaces:
EncounterDAO

public class HibernateEncounterDAO
extends java.lang.Object
implements EncounterDAO

Hibernate specific dao for the EncounterService All calls should be made on the Context.getEncounterService() object

See Also:
EncounterDAO, EncounterService

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
HibernateEncounterDAO()
           
 
Method Summary
 void deleteEncounter(Encounter encounter)
          Purge an encounter from database.
 void deleteEncounterType(EncounterType encounterType)
          Purge encounter type from database.
 java.util.List<EncounterType> findEncounterTypes(java.lang.String name)
          Find Encounter Types matching the given name.
 java.util.List<EncounterType> getAllEncounterTypes(java.lang.Boolean includeRetired)
          Get all encounter types
 Encounter getEncounter(java.lang.Integer encounterId)
          Get encounter by internal identifier
 Encounter getEncounterByUuid(java.lang.String uuid)
          Find Encounter matching a uuid
 java.util.List<Encounter> getEncounters(Patient patient, Location location, java.util.Date fromDate, java.util.Date toDate, java.util.Collection<Form> enteredViaForms, java.util.Collection<EncounterType> encounterTypes, java.util.Collection<User> providers, boolean includeVoided)
           
 java.util.List<Encounter> getEncountersByPatient(java.lang.String query, boolean includedVoided)
          Get a list of Encounter by Patient name or identifier
 java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId)
           
 EncounterType getEncounterType(java.lang.Integer encounterTypeId)
          Get encounterType by internal identifier
 EncounterType getEncounterType(java.lang.String name)
          Get encounterType by name
 EncounterType getEncounterTypeByUuid(java.lang.String uuid)
          Find EncounterType matching a uuid
 java.util.Date getSavedEncounterDatetime(Encounter encounter)
          Gets the value of encounterDatetime currently saved in the database for the given encounter, bypassing any caches.
 Encounter saveEncounter(Encounter encounter)
          Saves an encounter
 EncounterType saveEncounterType(EncounterType encounterType)
          Save an Encounter Type
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
          Set session factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

HibernateEncounterDAO

public HibernateEncounterDAO()
Method Detail

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set session factory

Parameters:
sessionFactory -

saveEncounter

public Encounter saveEncounter(Encounter encounter)
                        throws DAOException
Description copied from interface: EncounterDAO
Saves an encounter

Specified by:
saveEncounter in interface EncounterDAO
Parameters:
encounter - to be saved
Throws:
DAOException
See Also:
EncounterDAO.saveEncounter(org.openmrs.Encounter)

deleteEncounter

public void deleteEncounter(Encounter encounter)
                     throws DAOException
Description copied from interface: EncounterDAO
Purge an encounter from database.

Specified by:
deleteEncounter in interface EncounterDAO
Parameters:
encounter - encounter object to be purged
Throws:
DAOException
See Also:
EncounterService.deleteEncounter(org.openmrs.Encounter)

getEncounter

public Encounter getEncounter(java.lang.Integer encounterId)
                       throws DAOException
Description copied from interface: EncounterDAO
Get encounter by internal identifier

Specified by:
getEncounter in interface EncounterDAO
Parameters:
encounterId - encounter id
Returns:
encounter with given internal identifier
Throws:
DAOException
See Also:
EncounterService.getEncounter(java.lang.Integer)

getEncountersByPatientId

public java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId)
                                                   throws DAOException
Specified by:
getEncountersByPatientId in interface EncounterDAO
Returns:
all encounters for the given patient identifer
Throws:
DAOException
See Also:
EncounterDAO.getEncountersByPatientId(java.lang.Integer)

getEncounters

public java.util.List<Encounter> getEncounters(Patient patient,
                                               Location location,
                                               java.util.Date fromDate,
                                               java.util.Date toDate,
                                               java.util.Collection<Form> enteredViaForms,
                                               java.util.Collection<EncounterType> encounterTypes,
                                               java.util.Collection<User> providers,
                                               boolean includeVoided)
Specified by:
getEncounters in interface EncounterDAO
See Also:
EncounterDAO.getEncounters(org.openmrs.Patient, org.openmrs.Location, java.util.Date, java.util.Date, java.util.Collection, java.util.Collection, java.util.Collection, boolean)

saveEncounterType

public EncounterType saveEncounterType(EncounterType encounterType)
Description copied from interface: EncounterDAO
Save an Encounter Type

Specified by:
saveEncounterType in interface EncounterDAO
See Also:
EncounterDAO.saveEncounterType(org.openmrs.EncounterType)

deleteEncounterType

public void deleteEncounterType(EncounterType encounterType)
                         throws DAOException
Description copied from interface: EncounterDAO
Purge encounter type from database.

Specified by:
deleteEncounterType in interface EncounterDAO
Throws:
DAOException
See Also:
EncounterDAO.deleteEncounterType(org.openmrs.EncounterType)

getEncounterType

public EncounterType getEncounterType(java.lang.Integer encounterTypeId)
                               throws DAOException
Description copied from interface: EncounterDAO
Get encounterType by internal identifier

Specified by:
getEncounterType in interface EncounterDAO
Parameters:
encounterTypeId - Internal Integer identifier for an EncounterType
Returns:
EncounterType with given internal identifier
Throws:
DAOException
See Also:
EncounterService.getEncounterType(java.lang.Integer)

getEncounterType

public EncounterType getEncounterType(java.lang.String name)
                               throws DAOException
Description copied from interface: EncounterDAO
Get encounterType by name

Specified by:
getEncounterType in interface EncounterDAO
Parameters:
name - String representation of an encounterType
Returns:
EncounterType
Throws:
DAOException
See Also:
EncounterService.getEncounterType(java.lang.String)

getAllEncounterTypes

public java.util.List<EncounterType> getAllEncounterTypes(java.lang.Boolean includeRetired)
                                                   throws DAOException
Description copied from interface: EncounterDAO
Get all encounter types

Specified by:
getAllEncounterTypes in interface EncounterDAO
Returns:
encounter types list
Throws:
DAOException
See Also:
EncounterDAO.getAllEncounterTypes(java.lang.Boolean)

findEncounterTypes

public java.util.List<EncounterType> findEncounterTypes(java.lang.String name)
                                                 throws DAOException
Description copied from interface: EncounterDAO
Find Encounter Types matching the given name. Search string is case insensitive, so that "NaMe".equals("name") is true.

Specified by:
findEncounterTypes in interface EncounterDAO
Returns:
all EncounterTypes that match
Throws:
DAOException
See Also:
EncounterDAO.findEncounterTypes(java.lang.String)

getSavedEncounterDatetime

public java.util.Date getSavedEncounterDatetime(Encounter encounter)
Description copied from interface: EncounterDAO
Gets the value of encounterDatetime currently saved in the database for the given encounter, bypassing any caches. This is used prior to saving an encounter so that we can change the obs if need be

Specified by:
getSavedEncounterDatetime in interface EncounterDAO
Parameters:
encounter - the Encounter go the the encounterDatetime of
Returns:
the encounterDatetime currently in the database for this encounter
See Also:
EncounterDAO.getSavedEncounterDatetime(org.openmrs.Encounter)

getEncounterByUuid

public Encounter getEncounterByUuid(java.lang.String uuid)
Description copied from interface: EncounterDAO
Find Encounter matching a uuid

Specified by:
getEncounterByUuid in interface EncounterDAO
Returns:
Encounter
See Also:
EncounterDAO.getEncounterByUuid(java.lang.String)

getEncounterTypeByUuid

public EncounterType getEncounterTypeByUuid(java.lang.String uuid)
Description copied from interface: EncounterDAO
Find EncounterType matching a uuid

Specified by:
getEncounterTypeByUuid in interface EncounterDAO
Returns:
EncounterType
See Also:
EncounterDAO.getEncounterTypeByUuid(java.lang.String)

getEncountersByPatient

public java.util.List<Encounter> getEncountersByPatient(java.lang.String query,
                                                        boolean includedVoided)
Description copied from interface: EncounterDAO
Get a list of Encounter by Patient name or identifier

Specified by:
getEncountersByPatient in interface EncounterDAO
Parameters:
query - patient name or identifier
includedVoided - Specifies whether voided encounters should be included
Returns:
list of Encounter
See Also:
EncounterDAO.getEncountersByPatient(String, boolean)

OpenMRS-1.7.x

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