org.openmrs.api.db
Interface EncounterDAO

All Known Implementing Classes:
HibernateEncounterDAO

public interface EncounterDAO

Encounter-related database functions


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 includeVoided)
          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 includeVoided)
          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
 

Method Detail

saveEncounter

Encounter saveEncounter(Encounter encounter)
                        throws DAOException
Saves an encounter

Parameters:
encounter - to be saved
Throws:
DAOException

deleteEncounter

void deleteEncounter(Encounter encounter)
                     throws DAOException
Purge an encounter from database.

Parameters:
encounter - encounter object to be purged
Throws:
DAOException

getEncounter

Encounter getEncounter(java.lang.Integer encounterId)
                       throws DAOException
Get encounter by internal identifier

Parameters:
encounterId - encounter id
Returns:
encounter with given internal identifier
Throws:
DAOException

getEncountersByPatientId

java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId)
                                                   throws DAOException
Parameters:
patientId -
Returns:
all encounters for the given patient identifer
Throws:
DAOException

getEncounters

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)
See Also:
EncounterService.getEncounters(org.openmrs.Patient, org.openmrs.Location, java.util.Date, java.util.Date, java.util.Collection, java.util.Collection, java.util.Collection, boolean)

saveEncounterType

EncounterType saveEncounterType(EncounterType encounterType)
Save an Encounter Type

Parameters:
encounterType -

deleteEncounterType

void deleteEncounterType(EncounterType encounterType)
                         throws DAOException
Purge encounter type from database.

Parameters:
encounterType -
Throws:
DAOException

getEncounterType

EncounterType getEncounterType(java.lang.Integer encounterTypeId)
                               throws DAOException
Get encounterType by internal identifier

Parameters:
encounterTypeId - Internal Integer identifier for an EncounterType
Returns:
EncounterType with given internal identifier
Throws:
DAOException

getEncounterType

EncounterType getEncounterType(java.lang.String name)
                               throws DAOException
Get encounterType by name

Parameters:
name - String representation of an encounterType
Returns:
EncounterType
Throws:
DAOException

getAllEncounterTypes

java.util.List<EncounterType> getAllEncounterTypes(java.lang.Boolean includeVoided)
                                                   throws DAOException
Get all encounter types

Returns:
encounter types list
Throws:
DAOException

findEncounterTypes

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

Parameters:
name -
Returns:
all EncounterTypes that match
Throws:
DAOException

getSavedEncounterDatetime

java.util.Date getSavedEncounterDatetime(Encounter encounter)
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

Parameters:
encounter - the Encounter go the the encounterDatetime of
Returns:
the encounterDatetime currently in the database for this encounter
Expected behavior:
get saved encounter datetime from database

getEncounterByUuid

Encounter getEncounterByUuid(java.lang.String uuid)
Find Encounter matching a uuid

Parameters:
uuid -
Returns:
Encounter

getEncounterTypeByUuid

EncounterType getEncounterTypeByUuid(java.lang.String uuid)
Find EncounterType matching a uuid

Parameters:
uuid -
Returns:
EncounterType

getEncountersByPatient

java.util.List<Encounter> getEncountersByPatient(java.lang.String query,
                                                 boolean includeVoided)
Get a list of Encounter by Patient name or identifier

Parameters:
query - patient name or identifier
includeVoided - Specifies whether voided encounters should be included
Returns:
list of Encounter
See Also:
EncounterService.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