public class HibernateEncounterDAO extends Object implements EncounterDAO
EncounterService
All calls should be made on the
Context.getEncounterService() objectEncounterDAO
,
EncounterService
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
HibernateEncounterDAO() |
Modifier and Type | Method and Description |
---|---|
void |
deleteEncounter(Encounter encounter)
Purge an encounter from database.
|
void |
deleteEncounterType(EncounterType encounterType)
Purge encounter type from database.
|
List<EncounterType> |
findEncounterTypes(String name)
Find Encounter Types matching the given name.
|
Map<Integer,List<Encounter>> |
getAllEncounters(Cohort patients) |
List<EncounterType> |
getAllEncounterTypes(Boolean includeRetired)
Get all encounter types
|
Integer |
getCountOfEncounters(String query,
boolean includeVoided)
Return the number of encounters matching a patient name or patient identifier
|
Encounter |
getEncounter(Integer encounterId)
Get encounter by internal identifier
|
Encounter |
getEncounterByUuid(String uuid)
Find
Encounter matching a uuid |
List<Encounter> |
getEncounters(Patient patient,
Location location,
Date fromDate,
Date toDate,
Collection<Form> enteredViaForms,
Collection<EncounterType> encounterTypes,
Collection<User> providers,
boolean includeVoided) |
List<Encounter> |
getEncounters(String query,
Integer start,
Integer length,
boolean includeVoided)
Get a list of
Encounter by Patient name or identifier based on batch settings |
List<Encounter> |
getEncountersByPatientId(Integer patientId) |
EncounterType |
getEncounterType(Integer encounterTypeId)
Get encounterType by internal identifier
|
EncounterType |
getEncounterType(String name)
Get encounterType by name
|
EncounterType |
getEncounterTypeByUuid(String uuid)
Find
EncounterType matching a uuid |
Date |
getSavedEncounterDatetime(Encounter encounter)
Gets the value of encounterDatetime currently saved in the database for the given encounter,
bypassing any caches.
|
Location |
getSavedEncounterLocation(Encounter encounter)
Gets the location of the encounter
|
Encounter |
saveEncounter(Encounter encounter)
Saves an encounter
|
EncounterType |
saveEncounterType(EncounterType encounterType)
Save an Encounter Type
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set session factory
|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory
- public Encounter saveEncounter(Encounter encounter) throws DAOException
EncounterDAO
saveEncounter
in interface EncounterDAO
encounter
- to be savedDAOException
EncounterDAO.saveEncounter(org.openmrs.Encounter)
public void deleteEncounter(Encounter encounter) throws DAOException
EncounterDAO
deleteEncounter
in interface EncounterDAO
encounter
- encounter object to be purgedDAOException
EncounterService.deleteEncounter(org.openmrs.Encounter)
public Encounter getEncounter(Integer encounterId) throws DAOException
EncounterDAO
getEncounter
in interface EncounterDAO
encounterId
- encounter idDAOException
EncounterService.getEncounter(java.lang.Integer)
public List<Encounter> getEncountersByPatientId(Integer patientId) throws DAOException
getEncountersByPatientId
in interface EncounterDAO
DAOException
EncounterDAO.getEncountersByPatientId(java.lang.Integer)
public List<Encounter> getEncounters(Patient patient, Location location, Date fromDate, Date toDate, Collection<Form> enteredViaForms, Collection<EncounterType> encounterTypes, Collection<User> providers, boolean includeVoided)
public EncounterType saveEncounterType(EncounterType encounterType)
EncounterDAO
saveEncounterType
in interface EncounterDAO
EncounterDAO.saveEncounterType(org.openmrs.EncounterType)
public void deleteEncounterType(EncounterType encounterType) throws DAOException
EncounterDAO
deleteEncounterType
in interface EncounterDAO
DAOException
EncounterDAO.deleteEncounterType(org.openmrs.EncounterType)
public EncounterType getEncounterType(Integer encounterTypeId) throws DAOException
EncounterDAO
getEncounterType
in interface EncounterDAO
encounterTypeId
- Internal Integer identifier for an EncounterTypeDAOException
EncounterService.getEncounterType(java.lang.Integer)
public EncounterType getEncounterType(String name) throws DAOException
EncounterDAO
getEncounterType
in interface EncounterDAO
name
- String representation of an encounterTypeDAOException
EncounterService.getEncounterType(java.lang.String)
public List<EncounterType> getAllEncounterTypes(Boolean includeRetired) throws DAOException
EncounterDAO
getAllEncounterTypes
in interface EncounterDAO
DAOException
EncounterDAO.getAllEncounterTypes(java.lang.Boolean)
public List<EncounterType> findEncounterTypes(String name) throws DAOException
EncounterDAO
findEncounterTypes
in interface EncounterDAO
DAOException
EncounterDAO.findEncounterTypes(java.lang.String)
public Date getSavedEncounterDatetime(Encounter encounter)
EncounterDAO
getSavedEncounterDatetime
in interface EncounterDAO
encounter
- the Encounter go the the encounterDatetime ofEncounterDAO.getSavedEncounterDatetime(org.openmrs.Encounter)
public Encounter getEncounterByUuid(String uuid)
EncounterDAO
Encounter
matching a uuidgetEncounterByUuid
in interface EncounterDAO
Encounter
EncounterDAO.getEncounterByUuid(java.lang.String)
public EncounterType getEncounterTypeByUuid(String uuid)
EncounterDAO
EncounterType
matching a uuidgetEncounterTypeByUuid
in interface EncounterDAO
EncounterType
EncounterDAO.getEncounterTypeByUuid(java.lang.String)
public List<Encounter> getEncounters(String query, Integer start, Integer length, boolean includeVoided)
EncounterDAO
Encounter
by Patient name or identifier based on batch settingsgetEncounters
in interface EncounterDAO
query
- patient name or identifierstart
- beginning index for the batchlength
- number of encounters to return in the batchincludeVoided
- Specifies whether voided encounters should be includedEncounter
based on batch settingsEncounterDAO.getEncounters(String, Integer, Integer, boolean)
public Location getSavedEncounterLocation(Encounter encounter)
EncounterDAO
getSavedEncounterLocation
in interface EncounterDAO
encounter
- to be retrieved from the databaseLocation
EncounterDAO.getSavedEncounterLocation(org.openmrs.Encounter)
public Map<Integer,List<Encounter>> getAllEncounters(Cohort patients)
getAllEncounters
in interface EncounterDAO
EncounterDAO.getAllEncounters(org.openmrs.Cohort)
public Integer getCountOfEncounters(String query, boolean includeVoided)
EncounterDAO
getCountOfEncounters
in interface EncounterDAO
query
- patient name or identifierincludeVoided
- Specifies whether voided encounters should be includedEncounterDAO.getCountOfEncounters(java.lang.String, boolean)
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.