public class HibernateEncounterDAO extends Object implements EncounterDAO
EncounterService
All calls should be made on the
Context.getEncounterService() objectEncounterDAO
,
EncounterService
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.
|
List<EncounterType> |
findEncounterTypes(String name)
Find Encounter Types matching the given name.
|
List<EncounterRole> |
getAllEncounterRoles(boolean includeRetired)
Get all encounter roles and optionally specify whether to include retired encountered roles
|
Map<Integer,List<Encounter>> |
getAllEncounters(Cohort patients) |
List<EncounterType> |
getAllEncounterTypes(Boolean includeRetired)
Get all encounter types
|
Long |
getCountOfEncounters(String query,
Integer patientId,
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 |
EncounterRole |
getEncounterRole(Integer encounterRoleId)
Get encounter role by internal identifier
|
EncounterRole |
getEncounterRoleByName(String name) |
EncounterRole |
getEncounterRoleByUuid(String uuid)
Find
EncounterRole matching a uuid |
List<EncounterRole> |
getEncounterRolesByName(String name)
Get encounter roles by name
|
List<Encounter> |
getEncounters(EncounterSearchCriteria searchCriteria) |
List<Encounter> |
getEncounters(String query,
Integer patientId,
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) |
List<Encounter> |
getEncountersByVisit(Visit visit,
boolean includeVoided) |
List<Encounter> |
getEncountersByVisitsAndPatient(Patient patient,
boolean includeVoided,
String query,
Integer start,
Integer length) |
Integer |
getEncountersByVisitsAndPatientCount(Patient patient,
boolean includeVoided,
String query) |
List<Encounter> |
getEncountersNotAssignedToAnyVisit(Patient patient) |
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
|
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
org.openmrs.api.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(EncounterSearchCriteria searchCriteria)
getEncounters
in interface EncounterDAO
EncounterDAO.getEncounters(org.openmrs.parameter.EncounterSearchCriteria)
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 patientId, Integer start, 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 Map<Integer,List<Encounter>> getAllEncounters(Cohort patients)
getAllEncounters
in interface EncounterDAO
EncounterDAO.getAllEncounters(org.openmrs.Cohort)
public Long getCountOfEncounters(String query, 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 List<Encounter> getEncountersByVisit(Visit visit, boolean includeVoided)
getEncountersByVisit
in interface EncounterDAO
EncounterDAO.getEncountersByVisit(Visit, boolean)
public EncounterRole saveEncounterRole(EncounterRole encounterRole) throws DAOException
EncounterDAO
saveEncounterRole
in interface EncounterDAO
encounterRole
- role to be savedDAOException
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(Integer encounterRoleId) throws DAOException
EncounterDAO
getEncounterRole
in interface EncounterDAO
encounterRoleId
- encounter role idDAOException
EncounterDAO.getEncounterRole(Integer)
public EncounterRole getEncounterRoleByUuid(String uuid)
EncounterDAO
EncounterRole
matching a uuidgetEncounterRoleByUuid
in interface EncounterDAO
EncounterRole
EncounterDAO.getEncounterRoleByUuid(String)
public List<EncounterRole> getAllEncounterRoles(boolean includeRetired)
EncounterDAO
getAllEncounterRoles
in interface EncounterDAO
includeRetired
- include retiredEncounterDAO.getAllEncounterRoles(boolean)
public EncounterRole getEncounterRoleByName(String name)
getEncounterRoleByName
in interface EncounterDAO
EncounterDAO.getEncounterRoleByName(String)
public List<Encounter> getEncountersNotAssignedToAnyVisit(Patient patient)
getEncountersNotAssignedToAnyVisit
in interface EncounterDAO
EncounterService.getEncountersNotAssignedToAnyVisit(Patient)
public List<Encounter> getEncountersByVisitsAndPatient(Patient patient, boolean includeVoided, String query, Integer start, Integer length)
public Integer getEncountersByVisitsAndPatientCount(Patient patient, boolean includeVoided, String query)
getEncountersByVisitsAndPatientCount
in interface EncounterDAO
EncounterDAO.getEncountersByVisitsAndPatientCount(org.openmrs.Patient,
boolean, java.lang.String)
public List<EncounterRole> getEncounterRolesByName(String name)
EncounterDAO
getEncounterRolesByName
in interface EncounterDAO
name
- encounter role nameEncounterDAO.getEncounterRolesByName(String)
Copyright © 2024 OpenMRS Inc.. All rights reserved.