public interface PatientDAO
Context
,
PatientService
Modifier and Type | Method and Description |
---|---|
void |
deletePatient(Patient patient)
Delete patient from database.
|
void |
deletePatientIdentifier(PatientIdentifier patientIdentifier) |
void |
deletePatientIdentifierType(PatientIdentifierType patientIdentifierType) |
List<Allergy> |
getAllergies(Patient patient)
Gets a list of allergies that a patient has
|
Allergy |
getAllergy(Integer allergyId)
Gets a allergy matching the given allergyId
|
Allergy |
getAllergyByUuid(String uuid)
Gets a allergy matching the given uuid
|
String |
getAllergyStatus(Patient patient)
Gets a patient's allergy status
|
List<PatientIdentifierType> |
getAllPatientIdentifierTypes(boolean includeRetired)
Should not return null when includeRetired is false
Should not return retired when includeRetired is false
Should not return null when includeRetired is true
Should return all when includeRetired is true
|
List<Patient> |
getAllPatients(boolean includeVoided) |
Long |
getCountOfPatients(String query) |
Long |
getCountOfPatients(String query,
boolean includeVoided) |
List<Patient> |
getDuplicatePatientsByAttributes(List<String> attributes) |
Patient |
getPatient(Integer patientId) |
Patient |
getPatientByUuid(String uuid) |
PatientIdentifier |
getPatientIdentifier(Integer patientIdentifierId) |
List |
getPatientIdentifierByProgram(PatientProgram patientProgram)
Gets a List of Patient Identifiers associated to a program
|
PatientIdentifier |
getPatientIdentifierByUuid(String uuid) |
List<PatientIdentifier> |
getPatientIdentifiers(String identifier,
List<PatientIdentifierType> patientIdentifierTypes,
List<Location> locations,
List<Patient> patients,
Boolean isPreferred) |
PatientIdentifierType |
getPatientIdentifierType(Integer patientIdentifierTypeId) |
PatientIdentifierType |
getPatientIdentifierTypeByUuid(String uuid) |
List<PatientIdentifierType> |
getPatientIdentifierTypes(String name,
String format,
Boolean required,
Boolean hasCheckDigit) |
List<Patient> |
getPatients(String query,
boolean includeVoided,
Integer start,
Integer length) |
List<Patient> |
getPatients(String query,
Integer start,
Integer length) |
List<Patient> |
getPatients(String name,
List<PatientIdentifierType> identifierTypes,
boolean matchIdentifierExactly,
Integer start,
Integer length) |
boolean |
isIdentifierInUseByAnotherPatient(PatientIdentifier patientIdentifier) |
Allergies |
saveAllergies(Patient patient,
Allergies allergies)
Saves patient allergies to the database.
|
Allergy |
saveAllergy(Allergy allergy)
Saves an allergy to the database
|
Patient |
savePatient(Patient patient) |
PatientIdentifier |
savePatientIdentifier(PatientIdentifier patientIdentifier) |
PatientIdentifierType |
savePatientIdentifierType(PatientIdentifierType patientIdentifierType) |
Patient savePatient(Patient patient) throws DAOException
DAOException
PatientService.savePatient(org.openmrs.Patient)
Patient getPatient(Integer patientId) throws DAOException
DAOException
PatientService.getPatient(Integer)
void deletePatient(Patient patient) throws DAOException
patient
- patient to be deletedDAOException
org.openmrs.api.PatientService#deletePatient(org.openmrs.Patient)
,
PatientService.voidPatient(Patient, String)
List<Patient> getAllPatients(boolean includeVoided) throws DAOException
DAOException
PatientService.getAllPatients(boolean)
List<Patient> getPatients(String query, Integer start, Integer length) throws DAOException
DAOException
Should not get patients by empty query _ signature no 2
Should not get patients by null query _ signature no 2
Should get patient by given name _ signature no 2
Should get patient by middle name _ signature no 2
Should get patient by family name _ signature no 2
Should get patient by family2 name _ signature no 2
Should get patient by whole name _ signature no 2
Should not get patient by non-existing single name _ signature no 2
Should not get patient by non-existing name parts _ signature no 2
Should not get patient by mix of existing and non-existing name parts _ signature no 2
Should not get patient by voided name _ signature no 2
Should get patient by short given name _ signature no 2
Should get patient by short middle name _ signature no 2
Should get patient by short family name _ signature no 2
Should get patient by short family2 name _ signature no 2
Should get patient by whole name made up of short names _ signature no 2
Should get patients by multiple short name parts _ signature no 2
Should not get patient by non-existing single short name _ signature no 2
Should not get patient by non-existing short name parts _ signature no 2
Should not get patient by mix of existing and non-existing short name parts _ signature no 2
Should not get patient by voided short name _ signature no 2
Should get patient by identifier _ signature no 2
Should not get patient by non-existing identifier _ signature no 2
Should not get patient by voided identifier _ signature no 2
Should get no patient by non-existing attribute _ signature no 2
Should get no patient by non-searchable attribute _ signature no 2
Should get no patient by voided attribute _ signature no 2
Should get one patient by attribute _ signature no 2
Should get one patient by random case attribute _ signature no 2
Should not get patients by searching for non-voided and voided attribute _ signature no 2
Should get multiple patients by single attribute _ signature no 2
Should not get patients by multiple attributes _ signature no 2
Should find eleven out of eleven patients _ signature no 2
Should find the first four out of eleven patients _ signature no 2
Should find the next four out of eleven patients _ signature no 2
Should find the remaining three out of eleven patients _ signature no 2
Should find patients with null as start _ signature no 2
Should find patients with negative start _ signature no 2
Should find patients with null as length _ signature no 2
Should not get patients by zero length _ signature no 2
Should not get patients by negative length _ signature no 2
Should find patients with excessive length _ signature no 2
Should return distinct patient list _ signature no 2
Should not match voided patients _ signature no 2
Should get patients with match mode start _ signature no 2
Should get patients with match mode anywhere _ signature no 2
Should not get patients with match mode start _ signature no 2
Should not get patients with match mode anywhere _ signature no 2
List<Patient> getPatients(String query, boolean includeVoided, Integer start, Integer length) throws DAOException
List<Patient> getPatients(String name, List<PatientIdentifierType> identifierTypes, boolean matchIdentifierExactly, Integer start, Integer length) throws DAOException
List<PatientIdentifier> getPatientIdentifiers(String identifier, List<PatientIdentifierType> patientIdentifierTypes, List<Location> locations, List<Patient> patients, Boolean isPreferred) throws DAOException
DAOException
Should return all matching non voided patient identifiers if is preferred is set to null
Should return all matching non voided patient identifiers if is preferred is set to true
Should return all matching non voided patient identifiers if is preferred is set to false
Should fetch all patient identifiers belong to given patient
Should fetch all patient identifiers belong to given patients
Should fetch patient identifiers that equals given identifier
Should not fetch patient identifiers that partially matches given identifier
Should not get voided patient identifiers
PatientIdentifierType savePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws DAOException
List<PatientIdentifierType> getAllPatientIdentifierTypes(boolean includeRetired) throws DAOException
DAOException
PatientService.getAllPatientIdentifierTypes(boolean)
List<PatientIdentifierType> getPatientIdentifierTypes(String name, String format, Boolean required, Boolean hasCheckDigit) throws DAOException
PatientIdentifierType getPatientIdentifierType(Integer patientIdentifierTypeId) throws DAOException
DAOException
PatientService.getPatientIdentifierType(java.lang.Integer)
void deletePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws DAOException
List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) throws DAOException
DAOException
PatientService.getDuplicatePatientsByAttributes(java.util.List)
boolean isIdentifierInUseByAnotherPatient(PatientIdentifier patientIdentifier)
PatientIdentifier getPatientIdentifierByUuid(String uuid)
PatientIdentifierType getPatientIdentifierTypeByUuid(String uuid)
uuid
- PatientIdentifier getPatientIdentifier(Integer patientIdentifierId) throws DAOException
DAOException
PatientService.getPatientIdentifier(java.lang.Integer)
PatientIdentifier savePatientIdentifier(PatientIdentifier patientIdentifier)
void deletePatientIdentifier(PatientIdentifier patientIdentifier) throws DAOException
List<Allergy> getAllergies(Patient patient)
patient
- the patientString getAllergyStatus(Patient patient)
patient
- the patientAllergies saveAllergies(Patient patient, Allergies allergies)
patient
- the patientallergies
- the allergiesAllergy getAllergy(Integer allergyId)
allergyId
- of allergy to returnAllergy getAllergyByUuid(String uuid)
uuid
- of allergy to returnAllergy saveAllergy(Allergy allergy)
allergy
- the allergy to saveList getPatientIdentifierByProgram(PatientProgram patientProgram)
patientProgram
- the program that matches the patientIdentifierCopyright © 2024 OpenMRS Inc.. All rights reserved.