public class PatientServiceImpl extends BaseOpenmrsService implements PatientService
Context.getPatientService()Context,
PatientService,
PersonService| Constructor and Description |
|---|
PatientServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkPatientIdentifier(PatientIdentifier pi)
Deprecated.
|
void |
checkPatientIdentifiers(Patient patient)
Convenience method to validate all identifiers for a given patient
|
Patient |
createPatient(Patient patient)
Deprecated.
replaced by #savePatient(Patient)
|
void |
deletePatient(Patient patient)
Deprecated.
replaced by
purgePatient(Patient) |
void |
exitFromCare(Patient patient,
java.util.Date dateExited,
Concept reasonForExit)
This is the way to establish that a patient has left the care center.
|
java.util.List<Patient> |
findDuplicatePatients(java.util.Set<java.lang.String> attributes)
Deprecated.
|
Patient |
findPatient(Patient patientToMatch)
Deprecated.
|
java.util.List<Patient> |
findPatients(java.lang.String query,
boolean includeVoided)
Deprecated.
|
java.util.List<Allergy> |
getAllergies(Person p)
Returns a sorted set of Allergies, sorted on sort_weight
|
Allergy |
getAllergy(java.lang.Integer allergyListId)
Returns the Allergy
|
java.util.Collection<IdentifierValidator> |
getAllIdentifierValidators() |
java.util.List<PatientIdentifierType> |
getAllPatientIdentifierTypes()
Get all patientIdentifier types
|
java.util.List<PatientIdentifierType> |
getAllPatientIdentifierTypes(boolean includeRetired)
Get all patientIdentifier types
|
java.util.List<Patient> |
getAllPatients()
Returns all non voided patients in the system
|
java.util.List<Patient> |
getAllPatients(boolean includeVoided)
Returns patients in the system
|
java.lang.Integer |
getCountOfPatients(java.lang.String query)
Return the number of unvoided patients with names or patient identifiers starting with or
equal to the specified text
|
IdentifierValidator |
getDefaultIdentifierValidator() |
java.util.List<Patient> |
getDuplicatePatientsByAttributes(java.util.List<java.lang.String> attributes)
Search the database for patients that both share the given attributes.
|
IdentifierValidator |
getIdentifierValidator(java.lang.Class<IdentifierValidator> identifierValidator)
Gets an identifier validator matching the given class.
|
IdentifierValidator |
getIdentifierValidator(java.lang.String pivClassName) |
java.util.Map<java.lang.Class<? extends IdentifierValidator>,IdentifierValidator> |
getIdentifierValidators() |
Patient |
getPatient(java.lang.Integer patientId)
Get patient by internal identifier
|
Patient |
getPatientByExample(Patient patientToMatch)
This default implementation simply looks at the OpenMRS internal id (patient_id).
|
Patient |
getPatientByUuid(java.lang.String uuid)
Get patient by universally unique identifier.
|
PatientIdentifier |
getPatientIdentifier(java.lang.Integer patientIdentifierId)
Returns a patient identifier that matches the given patientIndentifier id
|
PatientIdentifier |
getPatientIdentifierByUuid(java.lang.String uuid)
Get patient identifier by universally unique identifier.
|
java.util.List<PatientIdentifier> |
getPatientIdentifiers(PatientIdentifierType pit)
Deprecated.
|
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)
Get all patientIdentifiers that match all of the given criteria Voided identifiers are not
returned
|
java.util.List<PatientIdentifier> |
getPatientIdentifiers(java.lang.String identifier,
PatientIdentifierType pit)
Deprecated.
|
java.util.List<PatientIdentifier> |
getPatientIdentifiers(java.lang.String identifier,
PatientIdentifierType patientIdentifierType,
boolean includeVoided)
Deprecated.
|
PatientIdentifierType |
getPatientIdentifierType(java.lang.Integer patientIdentifierTypeId)
Get patientIdentifierType by internal identifier
|
PatientIdentifierType |
getPatientIdentifierType(java.lang.String name)
Deprecated.
|
PatientIdentifierType |
getPatientIdentifierTypeByName(java.lang.String name)
Get patientIdentifierType by exact name
|
PatientIdentifierType |
getPatientIdentifierTypeByUuid(java.lang.String uuid)
Get patient identifierType by universally unique identifier
|
java.util.List<PatientIdentifierType> |
getPatientIdentifierTypes()
Deprecated.
replaced by
getAllPatientIdentifierTypes() |
java.util.List<PatientIdentifierType> |
getPatientIdentifierTypes(java.lang.String name,
java.lang.String format,
java.lang.Boolean required,
java.lang.Boolean hasCheckDigit)
Get all patientIdentifier types that match the given criteria
|
Patient |
getPatientOrPromotePerson(java.lang.Integer patientOrPersonId)
Get patient by internal identifier.
|
java.util.List<Patient> |
getPatients(java.lang.String query)
Generic search on patients based on the given string.
|
java.util.List<Patient> |
getPatients(java.lang.String query,
java.lang.Integer start,
java.lang.Integer length)
Generic search on patients based on the given string and returns a specific number of them
from the specified starting position.
|
java.util.List<Patient> |
getPatients(java.lang.String name,
java.lang.String identifier,
java.util.List<PatientIdentifierType> identifierTypes)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
java.util.List<Patient> |
getPatients(java.lang.String name,
java.lang.String identifier,
java.util.List<PatientIdentifierType> identifierTypes,
boolean matchIdentifierExactly)
Get patients based on given criteria The identifier is matched with the regex
OpenmrsConstants.PATIENT_IDENTIFIER_REGEX All parameters are optional and
nullable. |
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)
Get a limited size of patients from a given start index based on given criteria The
identifier is matched with the regex
OpenmrsConstants.PATIENT_IDENTIFIER_REGEX
All parameters are optional and nullable. |
java.util.List<Patient> |
getPatientsByIdentifier(java.lang.String identifier,
boolean includeVoided)
Deprecated.
replaced by @deprecated replaced by
getPatients(String, String, List) |
java.util.List<Patient> |
getPatientsByIdentifierPattern(java.lang.String identifier,
boolean includeVoided)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
java.util.List<Patient> |
getPatientsByName(java.lang.String name)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
java.util.List<Patient> |
getPatientsByName(java.lang.String name,
boolean includeVoided)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
Problem |
getProblem(java.lang.Integer problemListId)
Returns the Problem
|
java.util.List<Problem> |
getProblems(Person p)
Get a list of the problems for the patient, sorted on sort_weight
|
Patient |
identifierInUse(java.lang.String identifier,
PatientIdentifierType type,
Patient ignorePatient)
Deprecated.
use getPatientByIdentifier(String) instead
|
boolean |
isIdentifierInUseByAnotherPatient(PatientIdentifier patientIdentifier)
Checks whether the given patient identifier is already assigned to a patient other than
patientIdentifier.patient
|
void |
mergePatients(Patient preferred,
java.util.List<Patient> notPreferred)
Convenience method to join multiple patients' information into one record.
|
void |
mergePatients(Patient preferred,
Patient notPreferred)
1) Moves object (encounters/obs) pointing to
nonPreferred to
preferred 2) Copies data (gender/birthdate/names/ids/etc) from
nonPreferred to preferred iff the data is missing or null in
preferred 3) notPreferred is marked as voided |
void |
onShutdown()
Clean up after this class.
|
void |
processDeath(Patient patient,
java.util.Date dateDied,
Concept causeOfDeath,
java.lang.String otherReason)
This is the way to establish that a patient has died.
|
void |
purgePatient(Patient patient)
Delete patient from database.
|
void |
purgePatientIdentifier(PatientIdentifier patientIdentifier)
Purge PatientIdentifier (cannot be undone)
|
void |
purgePatientIdentifierType(PatientIdentifierType patientIdentifierType)
Purge PatientIdentifierType (cannot be undone)
|
void |
removeAllergy(Allergy allergy,
java.lang.String reason)
Resolving the allergy, effectively removes the Allergy from the Patient's Active List by
setting the stop date to now, if null.
|
void |
removeProblem(Problem problem,
java.lang.String reason)
Effectively removes the Problem from the Patient's Active List by setting the stop date to
now, if null.
|
PatientIdentifierType |
retirePatientIdentifierType(PatientIdentifierType patientIdentifierType,
java.lang.String reason)
Retire a type of patient identifier
|
void |
saveAllergy(Allergy allergy)
Creates an AllergyListItem to the Patient's Allergy Active List.
|
void |
saveCauseOfDeathObs(Patient patient,
java.util.Date deathDate,
Concept cause,
java.lang.String otherReason)
Convenience method that saves the Obs that indicates when and why the patient died (including
any "other" reason there might be) TODO keep this in the PatientService?
|
Patient |
savePatient(Patient patient)
Saved the given
patient to the database |
PatientIdentifier |
savePatientIdentifier(PatientIdentifier patientIdentifier)
Saved the given
patientIndentifier to the database |
PatientIdentifierType |
savePatientIdentifierType(PatientIdentifierType patientIdentifierType)
TODO: Add changedBy and DateChanged columns to table patient_identifier_type
|
void |
saveProblem(Problem problem)
Creates a ProblemListItem to the Patient's Problem Active List.
|
void |
setIdentifierValidators(java.util.Map<java.lang.Class<? extends IdentifierValidator>,IdentifierValidator> identifierValidators)
ADDs identifierValidators, doesn't replace them
|
void |
setPatientDAO(PatientDAO dao)
Sets the DAO for this service.
|
PatientIdentifierType |
unretirePatientIdentifierType(PatientIdentifierType patientIdentifierType)
Unretire a type of patient identifier
|
Patient |
unvoidPatient(Patient patient)
Unvoid patient record.
|
Patient |
updatePatient(Patient patient)
Deprecated.
replaced by #savePatient(Patient)
|
void |
updatePatientIdentifier(PatientIdentifier pi)
Deprecated.
patient identifiers should not be updated directly; rather, after changing
patient identifiers, use
savePatient(Patient) to save changes to the
database |
void |
voidAllergy(Allergy allergy,
java.lang.String reason)
Used only in cases where the Allergy was entered by error
|
Patient |
voidPatient(Patient patient,
java.lang.String reason)
Void patient record (functionally delete patient from system).
|
PatientIdentifier |
voidPatientIdentifier(PatientIdentifier patientIdentifier,
java.lang.String reason)
Void patient identifier (functionally delete patient identifier from system)
|
void |
voidProblem(Problem problem,
java.lang.String reason)
Used only in cases where the Problem was entered by error
|
onStartupclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonStartuppublic void setPatientDAO(PatientDAO dao)
PatientServicesetPatientDAO in interface PatientServicedao - DAO for this servicePatientService.setPatientDAO(org.openmrs.api.db.PatientDAO)public void onShutdown()
onShutdown in interface OpenmrsServiceonShutdown in class BaseOpenmrsServiceBaseOpenmrsService.onShutdown()@Deprecated public Patient createPatient(Patient patient) throws APIException
createPatient in interface PatientServiceAPIExceptionsavePatient(Patient),
PatientService.createPatient(org.openmrs.Patient)public Patient savePatient(Patient patient) throws APIException
PatientServicepatient to the databasesavePatient in interface PatientServicepatient - patient to be created or updatedAPIExceptionPatientService.savePatient(org.openmrs.Patient)public Patient getPatient(java.lang.Integer patientId) throws APIException
PatientServicegetPatient in interface PatientServicepatientId - internal patient identifierAPIExceptionPatientService.getPatient(java.lang.Integer)public Patient getPatientOrPromotePerson(java.lang.Integer patientOrPersonId)
PatientServicegetPatientOrPromotePerson in interface PatientService@Deprecated public Patient updatePatient(Patient patient) throws APIException
updatePatient in interface PatientServiceAPIExceptionsavePatient(Patient),
PatientService.updatePatient(org.openmrs.Patient)public java.util.List<Patient> getAllPatients() throws APIException
PatientServicegetAllPatients in interface PatientServiceAPIExceptionPatientService.getAllPatients()public java.util.List<Patient> getAllPatients(boolean includeVoided) throws APIException
PatientServicegetAllPatients in interface PatientServiceincludeVoided - if false, will limit the search to non-voided patientsAPIExceptionPatientService.getAllPatients(boolean)@Deprecated public java.util.List<Patient> getPatients(java.lang.String name, java.lang.String identifier, java.util.List<PatientIdentifierType> identifierTypes) throws APIException
getPatients(String, String, List, boolean)getPatients in interface PatientServiceAPIExceptionPatientService.getPatients(java.lang.String, java.lang.String,
java.util.List)public java.util.List<Patient> getPatients(java.lang.String name, java.lang.String identifier, java.util.List<PatientIdentifierType> identifierTypes, boolean matchIdentifierExactly) throws APIException
PatientServiceOpenmrsConstants.PATIENT_IDENTIFIER_REGEX All parameters are optional and
nullable. If null, it is not included in the search. Will not return voided patientsgetPatients in interface PatientServicename - (optional) this is a slight break from the norm, patients with a partial match on
this name will be returnedidentifier - (optional) only patients with a matching identifier are returnedidentifierTypes - (optional) the PatientIdentifierTypes to restrict tomatchIdentifierExactly - (required) if true, then the given identifier must
equal the id in the database. if false, then the identifier is 'searched' for by
using a regular expressionAPIExceptionPatientService.getPatients(java.lang.String, java.lang.String,
java.util.List, boolean)public void checkPatientIdentifiers(Patient patient) throws PatientIdentifierException
PatientServicecheckPatientIdentifiers in interface PatientServicepatient - patient for which to validate identifiersPatientIdentifierException - if one or more of the identifiers are invalidPatientService.checkPatientIdentifiers(org.openmrs.Patient)@Deprecated public void checkPatientIdentifier(PatientIdentifier pi) throws PatientIdentifierException
PatientIdentifierValidator.validateIdentifier(PatientIdentifier)PatientServicecheckPatientIdentifier in interface PatientServicepi - identifier to be validatedPatientIdentifierException - if the identifier is invalidPatientService.checkPatientIdentifier(org.openmrs.PatientIdentifier)@Deprecated public Patient identifierInUse(java.lang.String identifier, PatientIdentifierType type, Patient ignorePatient)
identifierInUse in interface PatientServicePatientService.identifierInUse(java.lang.String,
org.openmrs.PatientIdentifierType, org.openmrs.Patient)@Deprecated public java.util.List<Patient> getPatientsByIdentifier(java.lang.String identifier, boolean includeVoided) throws APIException
getPatients(String, String, List)getPatientsByIdentifier in interface PatientServiceAPIExceptionPatientService.getPatientsByIdentifier(java.lang.String, boolean)@Deprecated public java.util.List<Patient> getPatientsByIdentifierPattern(java.lang.String identifier, boolean includeVoided) throws APIException
getPatients(String, String, List, boolean)getPatientsByIdentifierPattern in interface PatientServiceAPIExceptionPatientService.getPatientsByIdentifierPattern(java.lang.String, boolean)@Deprecated public java.util.List<Patient> getPatientsByName(java.lang.String name) throws APIException
getPatients(String, String, List, boolean)getPatientsByName in interface PatientServiceAPIExceptionPatientService.getPatientsByName(java.lang.String)@Deprecated public java.util.List<Patient> getPatientsByName(java.lang.String name, boolean includeVoided) throws APIException
getPatients(String, String, List, boolean)getPatientsByName in interface PatientServiceAPIExceptionpublic Patient voidPatient(Patient patient, java.lang.String reason) throws APIException
PatientServicevoidPatient in interface PatientServicepatient - patient to be voidedreason - reason for voiding patientAPIExceptionPatientService.voidPatient(org.openmrs.Patient, java.lang.String)public Patient unvoidPatient(Patient patient) throws APIException
PatientServiceunvoidPatient in interface PatientServicepatient - patient to be revivedAPIExceptionPatientService.unvoidPatient(org.openmrs.Patient)@Deprecated public void deletePatient(Patient patient) throws APIException
purgePatient(Patient)deletePatient in interface PatientServiceAPIExceptionvoidPatient(org.openmrs.Patient,java.lang.String)public void purgePatient(Patient patient) throws APIException
PatientServicepurgePatient in interface PatientServicepatient - patient to be deletedAPIExceptionPatientService.purgePatient(org.openmrs.Patient)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 APIException
PatientServicegetPatientIdentifiers in interface PatientServiceidentifier - the full identifier to match onpatientIdentifierTypes - the type of identifiers to getlocations - the locations of the identifiers to matchpatients - the patients containing these identifiersisPreferred - if true, limits to only preferred identifiers if false, only non
preferred. if null, ignores preferred statusAPIExceptionPatientService.getPatientIdentifiers(java.lang.String, java.util.List,
java.util.List, java.util.List, java.lang.Boolean)@Deprecated public java.util.List<PatientIdentifier> getPatientIdentifiers(PatientIdentifierType pit) throws APIException
getPatientIdentifiers(String, List, List, List, Boolean)getPatientIdentifiers in interface PatientServiceAPIExceptionPatientService.getPatientIdentifiers(org.openmrs.PatientIdentifierType)@Deprecated public java.util.List<PatientIdentifier> getPatientIdentifiers(java.lang.String identifier, PatientIdentifierType pit) throws APIException
getPatientIdentifiers(String, List, List, List, Boolean)getPatientIdentifiers in interface PatientServiceAPIExceptionPatientService.getPatientIdentifiers(java.lang.String,
org.openmrs.PatientIdentifierType)@Deprecated public java.util.List<PatientIdentifier> getPatientIdentifiers(java.lang.String identifier, PatientIdentifierType patientIdentifierType, boolean includeVoided) throws APIException
getPatientIdentifiers(String, List, List, List, Boolean)@Deprecated public void updatePatientIdentifier(PatientIdentifier pi) throws APIException
savePatient(Patient) to save changes to the
databasePatientServiceupdatePatientIdentifier in interface PatientServicepi - identifier to be updatedAPIExceptionpublic PatientIdentifierType savePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws APIException
savePatientIdentifierType in interface PatientServicepatientIdentifierType - PatientIdentifierType to create or updateAPIExceptionPatientService.savePatientIdentifierType(org.openmrs.PatientIdentifierType)@Deprecated public java.util.List<PatientIdentifierType> getPatientIdentifierTypes() throws APIException
getAllPatientIdentifierTypes()getPatientIdentifierTypes in interface PatientServiceAPIExceptionPatientService.getPatientIdentifierTypes(),
PatientService.getAllPatientIdentifierTypes()public java.util.List<PatientIdentifierType> getAllPatientIdentifierTypes() throws APIException
PatientService
Ordered same as PatientIdentifierTypeDefaultComparator.
getAllPatientIdentifierTypes in interface PatientServiceAPIExceptionPatientService.getAllPatientIdentifierTypes()public java.util.List<PatientIdentifierType> getAllPatientIdentifierTypes(boolean includeRetired) throws APIException
PatientService
Ordered same as PatientIdentifierTypeDefaultComparator.
getAllPatientIdentifierTypes in interface PatientServiceincludeRetired - true/false whether retired types should be includedAPIExceptionPatientService.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 APIException
PatientService
Ordered same as PatientIdentifierTypeDefaultComparator.
getPatientIdentifierTypes in interface PatientServicename - name of the type to match onformat - the string format to match onrequired - if true, limits to only identifiers marked as required if false, only non
required. if null, ignores required bithasCheckDigit - if true, limits to only check digit'd identifiers if false, only non
checkdigit'd. if null, ignores checkDigitAPIExceptionPatientService.getPatientIdentifierTypes(java.lang.String,
java.lang.String, java.lang.Boolean, java.lang.Boolean)public PatientIdentifierType getPatientIdentifierType(java.lang.Integer patientIdentifierTypeId) throws APIException
PatientServicegetPatientIdentifierType in interface PatientServiceAPIExceptionPatientService.getPatientIdentifierType(java.lang.Integer)@Deprecated public PatientIdentifierType getPatientIdentifierType(java.lang.String name) throws APIException
getPatientIdentifierType in interface PatientServiceAPIExceptionPatientService.getPatientIdentifierType(java.lang.String)public PatientIdentifierType getPatientIdentifierTypeByName(java.lang.String name) throws APIException
PatientServicegetPatientIdentifierTypeByName in interface PatientServiceAPIExceptionPatientService.getPatientIdentifierTypeByName(java.lang.String)public PatientIdentifierType retirePatientIdentifierType(PatientIdentifierType patientIdentifierType, java.lang.String reason) throws APIException
PatientServiceretirePatientIdentifierType in interface PatientServicepatientIdentifierType - type of patient identifier to be retiredreason - the reason to retire this identifier typeAPIExceptionPatientService.retirePatientIdentifierType(org.openmrs.PatientIdentifierType,
String)public PatientIdentifierType unretirePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws APIException
PatientServiceunretirePatientIdentifierType in interface PatientServicepatientIdentifierType - type of patient identifier to be unretiredAPIExceptionPatientService.unretirePatientIdentifierType(org.openmrs.PatientIdentifierType)public void purgePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws APIException
PatientServicepurgePatientIdentifierType in interface PatientServicepatientIdentifierType - PatientIdentifierType to purge from the databaseAPIExceptionPatientService.purgePatientIdentifierType(org.openmrs.PatientIdentifierType)@Deprecated public java.util.List<Patient> findPatients(java.lang.String query, boolean includeVoided) throws APIException
findPatients in interface PatientServiceAPIExceptionPatientService.findPatients(java.lang.String, boolean)public java.util.List<Patient> getPatients(java.lang.String query) throws APIException
PatientServicegetPatients in interface PatientServicequery - the string to search onAPIExceptionPatientService.getPatients(java.lang.String)@Deprecated public Patient findPatient(Patient patientToMatch) throws APIException
findPatient in interface PatientServiceAPIExceptionPatientService.findPatient(org.openmrs.Patient),
getPatientByExample(Patient)public Patient getPatientByExample(Patient patientToMatch) throws APIException
getPatientByExample in interface PatientServiceAPIExceptionPatientService.getPatientByExample(org.openmrs.Patient)@Deprecated public java.util.List<Patient> findDuplicatePatients(java.util.Set<java.lang.String> attributes) throws APIException
getDuplicatePatientsByAttributes(List)findDuplicatePatients in interface PatientServiceAPIExceptionPatientService.getDuplicatePatientsByAttributes(List)public java.util.List<Patient> getDuplicatePatientsByAttributes(java.util.List<java.lang.String> attributes) throws APIException
PatientServicegetDuplicatePatientsByAttributes in interface PatientServiceattributes - attributes on a Person or Patient object. similar to: [gender, givenName,
middleName, familyName]APIExceptionPatientService.getDuplicatePatientsByAttributes(java.util.List)public void mergePatients(Patient preferred, Patient notPreferred) throws APIException, SerializationException
nonPreferred to
preferred 2) Copies data (gender/birthdate/names/ids/etc) from
nonPreferred to preferred iff the data is missing or null in
preferred 3) notPreferred is marked as voidedmergePatients in interface PatientServicepreferred - notPreferred - APIExceptionSerializationExceptionPatientService.mergePatients(org.openmrs.Patient, org.openmrs.Patient)public void exitFromCare(Patient patient, java.util.Date dateExited, Concept reasonForExit) throws APIException
exitFromCare in interface PatientServicepatient - - the patient who has exited caredateExited - - the declared date/time of the patient's exitreasonForExit - - the concept that corresponds with why the patient has been declared as
exitedAPIExceptionpublic void processDeath(Patient patient, java.util.Date dateDied, Concept causeOfDeath, java.lang.String otherReason) throws APIException
processDeath in interface PatientServicepatient - - the patient who has dieddateDied - - the declared date/time of the patient's deathcauseOfDeath - - the concept that corresponds with the reason the patient diedotherReason - - in case the causeOfDeath is 'other', a place to store more infoAPIExceptionpublic void saveCauseOfDeathObs(Patient patient, java.util.Date deathDate, Concept cause, java.lang.String otherReason) throws APIException
PatientServicesaveCauseOfDeathObs in interface PatientServicepatient - - the patient who has dieddeathDate - - the declared date/time of the patient's deathcause - - the concept that corresponds with the reason the patient diedotherReason - - if the concept representing the reason is OTHER NON-CODED, and a
string-based "other" reason is suppliedAPIExceptionPatientService.saveCauseOfDeathObs(org.openmrs.Patient, java.util.Date,
org.openmrs.Concept, java.lang.String)public Patient getPatientByUuid(java.lang.String uuid) throws APIException
PatientServicegetPatientByUuid in interface PatientServiceuuid - universally unique identifierAPIExceptionPatientService.getPatientByUuid(java.lang.String)public PatientIdentifier getPatientIdentifierByUuid(java.lang.String uuid) throws APIException
PatientServicegetPatientIdentifierByUuid in interface PatientServiceuuid - universally unique identifierAPIExceptionpublic PatientIdentifierType getPatientIdentifierTypeByUuid(java.lang.String uuid) throws APIException
PatientServicegetPatientIdentifierTypeByUuid in interface PatientServiceAPIExceptionPatientService.getPatientIdentifierTypeByUuid(java.lang.String)public IdentifierValidator getDefaultIdentifierValidator()
getDefaultIdentifierValidator in interface PatientServicePatientService.getDefaultIdentifierValidator()public IdentifierValidator getIdentifierValidator(java.lang.Class<IdentifierValidator> identifierValidator)
PatientServicegetIdentifierValidator in interface PatientServiceidentifierValidator - identifierValidator which validator to get.PatientService.getIdentifierValidator(java.lang.String)public java.util.Map<java.lang.Class<? extends IdentifierValidator>,IdentifierValidator> getIdentifierValidators()
public void setIdentifierValidators(java.util.Map<java.lang.Class<? extends IdentifierValidator>,IdentifierValidator> identifierValidators)
identifierValidators - public java.util.Collection<IdentifierValidator> getAllIdentifierValidators()
getAllIdentifierValidators in interface PatientServicePatientService.getAllIdentifierValidators()public IdentifierValidator getIdentifierValidator(java.lang.String pivClassName)
getIdentifierValidator in interface PatientServicePatientService.getIdentifierValidator(java.lang.String)public boolean isIdentifierInUseByAnotherPatient(PatientIdentifier patientIdentifier)
PatientServiceisIdentifierInUseByAnotherPatient in interface PatientServicepatientIdentifier - the patient identifier to look for in other patientsPatientService.isIdentifierInUseByAnotherPatient(org.openmrs.PatientIdentifier)public PatientIdentifier getPatientIdentifier(java.lang.Integer patientIdentifierId) throws APIException
PatientServicegetPatientIdentifier in interface PatientServiceAPIExceptionPatientService.getPatientIdentifier(java.lang.Integer)public PatientIdentifier voidPatientIdentifier(PatientIdentifier patientIdentifier, java.lang.String reason) throws APIException
PatientServicevoidPatientIdentifier in interface PatientServicereason - reason for voiding patient identifierAPIExceptionPatientService.voidPatientIdentifier(org.openmrs.PatientIdentifier,
java.lang.String)public void mergePatients(Patient preferred, java.util.List<Patient> notPreferred) throws APIException, SerializationException
PatientServicemergePatients in interface PatientServiceAPIExceptionSerializationExceptionPatientService.mergePatients(org.openmrs.Patient, java.util.List)public PatientIdentifier savePatientIdentifier(PatientIdentifier patientIdentifier) throws APIException
PatientServicepatientIndentifier to the databasesavePatientIdentifier in interface PatientServiceAPIExceptionPatientService.savePatientIdentifier(org.openmrs.PatientIdentifier)public void purgePatientIdentifier(PatientIdentifier patientIdentifier) throws APIException
PatientServicepurgePatientIdentifier in interface PatientServicepatientIdentifier - PatientIdentifier to purge from the databaseAPIExceptionPatientService.purgePatientIdentifier(org.openmrs.PatientIdentifier)public java.util.List<Problem> getProblems(Person p) throws APIException
PatientServicegetProblems in interface PatientServicep - the PersonAPIExceptionPatientService.getProblems(org.openmrs.Person)public Problem getProblem(java.lang.Integer problemListId) throws APIException
PatientServicegetProblem in interface PatientServiceAPIExceptionPatientService.getProblem(java.lang.Integer)public void saveProblem(Problem problem) throws APIException
PatientServicesaveProblem in interface PatientServiceproblem - the ProblemAPIExceptionPatientService.saveProblem(org.openmrs.activelist.Problem)public void removeProblem(Problem problem, java.lang.String reason) throws APIException
PatientServiceremoveProblem in interface PatientServiceproblem - the Problemreason - the reason of removing the problemAPIExceptionPatientService.removeProblem(org.openmrs.activelist.Problem,
java.lang.String)public void voidProblem(Problem problem, java.lang.String reason) throws APIException
PatientServicevoidProblem in interface PatientServiceAPIExceptionPatientService.voidProblem(org.openmrs.activelist.Problem,
java.lang.String)public java.util.List<Allergy> getAllergies(Person p) throws APIException
PatientServicegetAllergies in interface PatientServicep - the PersonAPIExceptionPatientService.getAllergies(org.openmrs.Person)public Allergy getAllergy(java.lang.Integer allergyListId) throws APIException
PatientServicegetAllergy in interface PatientServiceAPIExceptionPatientService.getAllergy(java.lang.Integer)public void saveAllergy(Allergy allergy) throws APIException
PatientServicesaveAllergy in interface PatientServiceallergy - the AllergyAPIExceptionPatientService.saveAllergy(org.openmrs.activelist.Allergy)public void removeAllergy(Allergy allergy, java.lang.String reason) throws APIException
PatientServiceremoveAllergy in interface PatientServiceallergy - the Allergyreason - the reason of removeAPIExceptionPatientService.removeAllergy(org.openmrs.activelist.Allergy,
java.lang.String)public void voidAllergy(Allergy allergy, java.lang.String reason) throws APIException
PatientServicevoidAllergy in interface PatientServiceAPIExceptionPatientService.voidAllergy(org.openmrs.activelist.Allergy,
java.lang.String)public java.lang.Integer getCountOfPatients(java.lang.String query)
PatientServicegetCountOfPatients in interface PatientServicequery - the string to search onPatientService.getCountOfPatients(String)public java.util.List<Patient> getPatients(java.lang.String query, java.lang.Integer start, java.lang.Integer length) throws APIException
PatientServicegetPatients in interface PatientServicequery - the string to search onstart - the starting indexlength - the number of patients to returnAPIExceptionPatientService.getPatients(String, Integer, Integer)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) throws APIException
PatientServiceOpenmrsConstants.PATIENT_IDENTIFIER_REGEX
All parameters are optional and nullable. If null, it is not included in the search. Will not
return voided patientsgetPatients in interface PatientServicename - (optional) this is a slight break from the norm, patients with a partial match on
this name will be returnedidentifier - (optional) only patients with a matching identifier are returnedidentifierTypes - (optional) the PatientIdentifierTypes to restrict tomatchIdentifierExactly - (required) if true, then the given identifier must
equal the id in the database. if false, then the identifier is 'searched' for by
using a regular expressionstart - the starting indexlength - the number of patients to returnAPIExceptionPatientService.getPatients(String, String, List, boolean, Integer, Integer)Copyright © 2018 OpenMRS Inc.. All Rights Reserved.