public class HibernateEncounterDAO extends java.lang.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 |
deleteEncounterRole(EncounterRole encounterRole)
Purge an encounter role 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<EncounterRole> |
getAllEncounterRoles(boolean includeRetired)
Get all enconter roles and optionally specify whehter to include retired encontered roles
|
java.util.Map<java.lang.Integer,java.util.List<Encounter>> |
getAllEncounters(Cohort patients) |
java.util.List<EncounterType> |
getAllEncounterTypes(java.lang.Boolean includeRetired)
Get all encounter types
|
java.lang.Long |
getCountOfEncounters(java.lang.String query,
java.lang.Integer patientId,
boolean includeVoided)
Return the number of encounters matching a patient name or patient identifier
|
Encounter |
getEncounter(java.lang.Integer encounterId)
Get encounter by internal identifier
|
Encounter |
getEncounterByUuid(java.lang.String uuid)
Find
Encounter matching a uuid |
EncounterRole |
getEncounterRole(java.lang.Integer encounterRoleId)
Get encounter role by internal identifier
|
EncounterRole |
getEncounterRoleByUuid(java.lang.String uuid)
Find
EncounterRole 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<Provider> providers,
java.util.Collection<VisitType> visitTypes,
java.util.Collection<Visit> visits,
boolean includeVoided) |
java.util.List<Encounter> |
getEncounters(java.lang.String query,
java.lang.Integer patientId,
java.lang.Integer start,
java.lang.Integer length,
boolean includeVoided)
Get a list of
Encounter by Patient name or identifier based on batch settings |
java.util.List<Encounter> |
getEncountersByPatientId(java.lang.Integer patientId) |
java.util.List<Encounter> |
getEncountersByVisit(Visit visit,
boolean includeVoided) |
java.util.List<Encounter> |
getEncountersByVisitsAndPatient(Patient patient,
boolean includeVoided,
java.lang.String query,
java.lang.Integer start,
java.lang.Integer length) |
java.lang.Integer |
getEncountersByVisitsAndPatientCount(Patient patient,
boolean includeVoided,
java.lang.String query) |
java.util.List<Encounter> |
getEncountersNotAssignedToAnyVisit(Patient patient) |
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.
|
Location |
getSavedEncounterLocation(Encounter encounter)
Gets the location of the encounter
|
Encounter |
saveEncounter(Encounter encounter)
Saves an encounter
|
EncounterRole |
saveEncounterRole(EncounterRole encounterRole)
Saves an encounter role
|
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(java.lang.Integer encounterId) throws DAOException
EncounterDAO
getEncounter
in interface EncounterDAO
encounterId
- encounter idDAOException
EncounterService.getEncounter(java.lang.Integer)
public java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId) throws DAOException
getEncountersByPatientId
in interface EncounterDAO
DAOException
EncounterDAO.getEncountersByPatientId(java.lang.Integer)
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<Provider> providers, java.util.Collection<VisitType> visitTypes, java.util.Collection<Visit> visits, boolean includeVoided)
getEncounters
in interface EncounterDAO
org.openmrs.api.db.EncounterDAO#getEncounters(org.openmrs.Patient, org.openmrs.Location,
java.util.Date, java.util.Date, java.util.Collection, java.util.Collection,
java.util.Collection, boolean)
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(java.lang.Integer encounterTypeId) throws DAOException
EncounterDAO
getEncounterType
in interface EncounterDAO
encounterTypeId
- Internal Integer identifier for an EncounterTypeDAOException
EncounterService.getEncounterType(java.lang.Integer)
public EncounterType getEncounterType(java.lang.String name) throws DAOException
EncounterDAO
getEncounterType
in interface EncounterDAO
name
- String representation of an encounterTypeDAOException
EncounterService.getEncounterType(java.lang.String)
public java.util.List<EncounterType> getAllEncounterTypes(java.lang.Boolean includeRetired) throws DAOException
EncounterDAO
getAllEncounterTypes
in interface EncounterDAO
DAOException
EncounterDAO.getAllEncounterTypes(java.lang.Boolean)
public java.util.List<EncounterType> findEncounterTypes(java.lang.String name) throws DAOException
EncounterDAO
findEncounterTypes
in interface EncounterDAO
DAOException
EncounterDAO.findEncounterTypes(java.lang.String)
public java.util.Date getSavedEncounterDatetime(Encounter encounter)
EncounterDAO
getSavedEncounterDatetime
in interface EncounterDAO
encounter
- the Encounter go the the encounterDatetime ofEncounterDAO.getSavedEncounterDatetime(org.openmrs.Encounter)
public Encounter getEncounterByUuid(java.lang.String uuid)
EncounterDAO
Encounter
matching a uuidgetEncounterByUuid
in interface EncounterDAO
Encounter
EncounterDAO.getEncounterByUuid(java.lang.String)
public EncounterType getEncounterTypeByUuid(java.lang.String uuid)
EncounterDAO
EncounterType
matching a uuidgetEncounterTypeByUuid
in interface EncounterDAO
EncounterType
EncounterDAO.getEncounterTypeByUuid(java.lang.String)
public java.util.List<Encounter> getEncounters(java.lang.String query, java.lang.Integer patientId, java.lang.Integer start, java.lang.Integer length, boolean includeVoided)
EncounterDAO
Encounter
by Patient name or identifier based on batch settingsgetEncounters
in interface EncounterDAO
query
- patient name or identifierpatientId
- the patient idstart
- 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, 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 java.util.Map<java.lang.Integer,java.util.List<Encounter>> getAllEncounters(Cohort patients)
getAllEncounters
in interface EncounterDAO
EncounterDAO.getAllEncounters(org.openmrs.Cohort)
public java.lang.Long getCountOfEncounters(java.lang.String query, java.lang.Integer patientId, boolean includeVoided)
EncounterDAO
getCountOfEncounters
in interface EncounterDAO
query
- patient name or identifierpatientId
- the patient idincludeVoided
- Specifies whether voided encounters should be includedEncounterDAO.getCountOfEncounters(java.lang.String,
java.lang.Integer, boolean)
public java.util.List<Encounter> getEncountersByVisit(Visit visit, boolean includeVoided)
getEncountersByVisit
in interface EncounterDAO
org.openmrs.api.db.EncounterDAO#getEncountersByVisit(Visit)
public EncounterRole saveEncounterRole(EncounterRole encounterRole) throws DAOException
EncounterDAO
saveEncounterRole
in interface EncounterDAO
DAOException
EncounterDAO.saveEncounterRole(EncounterRole encounterRole)
public void deleteEncounterRole(EncounterRole encounterRole) throws DAOException
EncounterDAO
deleteEncounterRole
in interface EncounterDAO
encounterRole
- encounter role object to be purgedDAOException
EncounterDAO.deleteEncounterRole(org.openmrs.EncounterRole)
public EncounterRole getEncounterRole(java.lang.Integer encounterRoleId) throws DAOException
EncounterDAO
getEncounterRole
in interface EncounterDAO
encounterRoleId
- encounter role idDAOException
EncounterDAO.getEncounterRole(Integer)
public EncounterRole getEncounterRoleByUuid(java.lang.String uuid)
EncounterDAO
EncounterRole
matching a uuidgetEncounterRoleByUuid
in interface EncounterDAO
EncounterRole
EncounterDAO.getEncounterRoleByUuid(String)
public java.util.List<EncounterRole> getAllEncounterRoles(boolean includeRetired) throws DAOException
EncounterDAO
getAllEncounterRoles
in interface EncounterDAO
includeRetired
- include retiredDAOException
EncounterDAO.getAllEncounterRoles(boolean)
public java.util.List<Encounter> getEncountersNotAssignedToAnyVisit(Patient patient) throws DAOException
getEncountersNotAssignedToAnyVisit
in interface EncounterDAO
DAOException
EncounterService.getEncountersNotAssignedToAnyVisit(Patient)
public java.util.List<Encounter> getEncountersByVisitsAndPatient(Patient patient, boolean includeVoided, java.lang.String query, java.lang.Integer start, java.lang.Integer length)
public java.lang.Integer getEncountersByVisitsAndPatientCount(Patient patient, boolean includeVoided, java.lang.String query)
getEncountersByVisitsAndPatientCount
in interface EncounterDAO
EncounterDAO.getEncountersByVisitsAndPatientCount(org.openmrs.Patient,
boolean, java.lang.String)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.