public class HibernatePatientDAO extends java.lang.Object implements PatientDAO
Context
,
PatientDAO
,
PatientService
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
HibernatePatientDAO() |
Modifier and Type | Method and Description |
---|---|
void |
deletePatient(Patient patient)
Delete patient from database.
|
void |
deletePatientIdentifier(PatientIdentifier patientIdentifier) |
void |
deletePatientIdentifierType(PatientIdentifierType patientIdentifierType) |
java.util.List<PatientIdentifierType> |
getAllPatientIdentifierTypes(boolean includeRetired) |
java.util.List<Patient> |
getAllPatients(boolean includeVoided) |
java.lang.Long |
getCountOfPatients(java.lang.String name,
java.lang.String identifier,
java.util.List<PatientIdentifierType> identifierTypes,
boolean matchIdentifierExactly,
boolean searchOnNamesOrIdentifiers) |
java.util.List<Patient> |
getDuplicatePatientsByAttributes(java.util.List<java.lang.String> attributes) |
Patient |
getPatient(java.lang.Integer patientId) |
Patient |
getPatientByUuid(java.lang.String uuid)
Auto generated method comment
|
PatientIdentifier |
getPatientIdentifier(java.lang.Integer patientIdentifierId) |
PatientIdentifier |
getPatientIdentifierByUuid(java.lang.String uuid) |
java.util.List<PatientIdentifier> |
getPatientIdentifiers(java.lang.String identifier,
java.util.List<PatientIdentifierType> patientIdentifierTypes,
java.util.List<Location> locations,
java.util.List<Patient> patients,
java.lang.Boolean isPreferred) |
PatientIdentifierType |
getPatientIdentifierType(java.lang.Integer patientIdentifierTypeId) |
PatientIdentifierType |
getPatientIdentifierTypeByUuid(java.lang.String uuid)
Auto generated method comment
|
java.util.List<PatientIdentifierType> |
getPatientIdentifierTypes(java.lang.String name,
java.lang.String format,
java.lang.Boolean required,
java.lang.Boolean hasCheckDigit) |
java.util.List<Patient> |
getPatients(java.lang.String name,
java.lang.String identifier,
java.util.List<PatientIdentifierType> identifierTypes,
boolean matchIdentifierExactly,
java.lang.Integer start,
java.lang.Integer length,
boolean searchOnNamesOrIdentifiers) |
boolean |
isIdentifierInUseByAnotherPatient(PatientIdentifier patientIdentifier)
This method uses a SQL query and does not load anything into the hibernate session.
|
Patient |
savePatient(Patient patient) |
PatientIdentifier |
savePatientIdentifier(PatientIdentifier patientIdentifier) |
PatientIdentifierType |
savePatientIdentifierType(PatientIdentifierType patientIdentifierType) |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set session factory
|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory
- public Patient getPatient(java.lang.Integer patientId)
getPatient
in interface PatientDAO
PatientService.getPatient(java.lang.Integer)
public Patient savePatient(Patient patient) throws DAOException
savePatient
in interface PatientDAO
DAOException
PatientDAO.savePatient(org.openmrs.Patient)
public java.util.List<Patient> getPatients(java.lang.String name, java.lang.String identifier, java.util.List<PatientIdentifierType> identifierTypes, boolean matchIdentifierExactly, java.lang.Integer start, java.lang.Integer length, boolean searchOnNamesOrIdentifiers) throws DAOException
getPatients
in interface PatientDAO
searchOnNamesOrIdentifiers
- specifies if the logic should find patients that match the
name or identifier otherwise find patients that match both the name and identifierDAOException
PatientDAO.getPatients(String, String, List, boolean, Integer,
Integer, boolean)
public java.util.List<Patient> getAllPatients(boolean includeVoided) throws DAOException
getAllPatients
in interface PatientDAO
DAOException
PatientDAO.getAllPatients(boolean)
public void deletePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws DAOException
deletePatientIdentifierType
in interface PatientDAO
DAOException
PatientService.purgePatientIdentifierType(org.openmrs.PatientIdentifierType)
,
PatientDAO.deletePatientIdentifierType(org.openmrs.PatientIdentifierType)
public java.util.List<PatientIdentifier> getPatientIdentifiers(java.lang.String identifier, java.util.List<PatientIdentifierType> patientIdentifierTypes, java.util.List<Location> locations, java.util.List<Patient> patients, java.lang.Boolean isPreferred) throws DAOException
getPatientIdentifiers
in interface PatientDAO
DAOException
PatientDAO.getPatientIdentifiers(java.lang.String, java.util.List,
java.util.List, java.util.List, java.lang.Boolean)
,
PatientService.getPatientIdentifiers(java.lang.String, java.util.List,
java.util.List, java.util.List, java.lang.Boolean)
public PatientIdentifierType savePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws DAOException
savePatientIdentifierType
in interface PatientDAO
DAOException
PatientDAO.savePatientIdentifierType(org.openmrs.PatientIdentifierType)
public void deletePatient(Patient patient) throws DAOException
PatientDAO
deletePatient
in interface PatientDAO
patient
- patient to be deletedDAOException
PatientService.deletePatient(org.openmrs.Patient)
public PatientIdentifierType getPatientIdentifierType(java.lang.Integer patientIdentifierTypeId) throws DAOException
getPatientIdentifierType
in interface PatientDAO
DAOException
PatientService.getPatientIdentifierType(java.lang.Integer)
public java.util.List<PatientIdentifierType> getAllPatientIdentifierTypes(boolean includeRetired) throws DAOException
getAllPatientIdentifierTypes
in interface PatientDAO
DAOException
PatientDAO.getAllPatientIdentifierTypes(boolean)
public java.util.List<PatientIdentifierType> getPatientIdentifierTypes(java.lang.String name, java.lang.String format, java.lang.Boolean required, java.lang.Boolean hasCheckDigit) throws DAOException
getPatientIdentifierTypes
in interface PatientDAO
DAOException
PatientDAO.getPatientIdentifierTypes(java.lang.String,
java.lang.String, java.lang.Boolean, java.lang.Boolean)
public java.util.List<Patient> getDuplicatePatientsByAttributes(java.util.List<java.lang.String> attributes)
getDuplicatePatientsByAttributes
in interface PatientDAO
PatientDAO.getDuplicatePatientsByAttributes(java.util.List)
public Patient getPatientByUuid(java.lang.String uuid)
PatientDAO
getPatientByUuid
in interface PatientDAO
PatientDAO.getPatientByUuid(java.lang.String)
public PatientIdentifier getPatientIdentifierByUuid(java.lang.String uuid)
getPatientIdentifierByUuid
in interface PatientDAO
public PatientIdentifierType getPatientIdentifierTypeByUuid(java.lang.String uuid)
PatientDAO
getPatientIdentifierTypeByUuid
in interface PatientDAO
PatientDAO.getPatientIdentifierTypeByUuid(java.lang.String)
public boolean isIdentifierInUseByAnotherPatient(PatientIdentifier patientIdentifier)
isIdentifierInUseByAnotherPatient
in interface PatientDAO
PatientDAO.isIdentifierInUseByAnotherPatient(org.openmrs.PatientIdentifier)
public PatientIdentifier getPatientIdentifier(java.lang.Integer patientIdentifierId) throws DAOException
getPatientIdentifier
in interface PatientDAO
DAOException
PatientDAO.getPatientIdentifier(java.lang.Integer)
public PatientIdentifier savePatientIdentifier(PatientIdentifier patientIdentifier)
savePatientIdentifier
in interface PatientDAO
PatientDAO.savePatientIdentifier(org.openmrs.PatientIdentifier)
public void deletePatientIdentifier(PatientIdentifier patientIdentifier) throws DAOException
deletePatientIdentifier
in interface PatientDAO
DAOException
PatientService.purgePatientIdentifier(org.openmrs.PatientIdentifier)
,
PatientDAO.deletePatientIdentifier(org.openmrs.PatientIdentifier)
public java.lang.Long getCountOfPatients(java.lang.String name, java.lang.String identifier, java.util.List<PatientIdentifierType> identifierTypes, boolean matchIdentifierExactly, boolean searchOnNamesOrIdentifiers)
getCountOfPatients
in interface PatientDAO
searchOnNamesOrIdentifiers
- specifies if the logic should find patients that match the
name or identifier otherwise find patients that match both the name and identifierPatientDAO.getCountOfPatients(String, String, List, boolean, boolean)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.