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,
Date dateExited,
Concept reasonForExit)
This is the way to establish that a patient has left the care center.
|
List<Patient> |
findDuplicatePatients(Set<String> attributes)
Deprecated.
|
Patient |
findPatient(Patient patientToMatch)
Deprecated.
|
List<Patient> |
findPatients(String query,
boolean includeVoided)
Deprecated.
|
List<Allergy> |
getAllergies(Person p)
Returns a sorted set of Allergies, sorted on sort_weight
|
Allergy |
getAllergy(Integer allergyListId)
Returns the Allergy
|
Collection<IdentifierValidator> |
getAllIdentifierValidators() |
List<PatientIdentifierType> |
getAllPatientIdentifierTypes()
Get all patientIdentifier types
|
List<PatientIdentifierType> |
getAllPatientIdentifierTypes(boolean includeRetired)
Get all patientIdentifier types
|
List<Patient> |
getAllPatients()
Returns all non voided patients in the system
|
List<Patient> |
getAllPatients(boolean includeVoided)
Returns patients in the system
|
Integer |
getCountOfPatients(String query)
Return the number of unvoided patients with names or patient identifiers starting with or
equal to the specified text
|
IdentifierValidator |
getDefaultIdentifierValidator() |
List<Patient> |
getDuplicatePatientsByAttributes(List<String> attributes)
Search the database for patients that both share the given attributes.
|
IdentifierValidator |
getIdentifierValidator(Class<IdentifierValidator> identifierValidator)
Gets an identifier validator matching the given class.
|
IdentifierValidator |
getIdentifierValidator(String pivClassName) |
Map<Class<? extends IdentifierValidator>,IdentifierValidator> |
getIdentifierValidators() |
Patient |
getPatient(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(String uuid)
Get patient by universally unique identifier.
|
PatientIdentifier |
getPatientIdentifier(Integer patientIdentifierId)
Returns a patient identifier that matches the given patientIndentifier id
|
PatientIdentifier |
getPatientIdentifierByUuid(String uuid)
Get patient identifier by universally unique identifier.
|
List<PatientIdentifier> |
getPatientIdentifiers(PatientIdentifierType pit)
Deprecated.
|
List<PatientIdentifier> |
getPatientIdentifiers(String identifier,
List<PatientIdentifierType> patientIdentifierTypes,
List<Location> locations,
List<Patient> patients,
Boolean isPreferred)
Get all patientIdentifiers that match all of the given criteria Voided identifiers are not
returned
|
List<PatientIdentifier> |
getPatientIdentifiers(String identifier,
PatientIdentifierType pit)
Deprecated.
|
List<PatientIdentifier> |
getPatientIdentifiers(String identifier,
PatientIdentifierType patientIdentifierType,
boolean includeVoided)
Deprecated.
|
PatientIdentifierType |
getPatientIdentifierType(Integer patientIdentifierTypeId)
Get patientIdentifierType by internal identifier
|
PatientIdentifierType |
getPatientIdentifierType(String name)
Deprecated.
|
PatientIdentifierType |
getPatientIdentifierTypeByName(String name)
Get patientIdentifierType by exact name
|
PatientIdentifierType |
getPatientIdentifierTypeByUuid(String uuid)
Get patient identifierType by universally unique identifier
|
List<PatientIdentifierType> |
getPatientIdentifierTypes()
Deprecated.
replaced by
getAllPatientIdentifierTypes() |
List<PatientIdentifierType> |
getPatientIdentifierTypes(String name,
String format,
Boolean required,
Boolean hasCheckDigit)
Get all patientIdentifier types that match the given criteria
|
Patient |
getPatientOrPromotePerson(Integer patientOrPersonId)
Get patient by internal identifier.
|
List<Patient> |
getPatients(String query)
Generic search on patients based on the given string.
|
List<Patient> |
getPatients(String query,
Integer start,
Integer length)
Generic search on patients based on the given string and returns a specific number of them
from the specified starting position.
|
List<Patient> |
getPatients(String name,
String identifier,
List<PatientIdentifierType> identifierTypes)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
List<Patient> |
getPatients(String name,
String identifier,
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. |
List<Patient> |
getPatients(String name,
String identifier,
List<PatientIdentifierType> identifierTypes,
boolean matchIdentifierExactly,
Integer start,
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. |
List<Patient> |
getPatientsByIdentifier(String identifier,
boolean includeVoided)
Deprecated.
replaced by @deprecated replaced by
getPatients(String, String, List) |
List<Patient> |
getPatientsByIdentifierPattern(String identifier,
boolean includeVoided)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
List<Patient> |
getPatientsByName(String name)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
List<Patient> |
getPatientsByName(String name,
boolean includeVoided)
Deprecated.
replaced by
getPatients(String, String, List, boolean) |
Problem |
getProblem(Integer problemListId)
Returns the Problem
|
List<Problem> |
getProblems(Person p)
Get a list of the problems for the patient, sorted on sort_weight
|
Patient |
identifierInUse(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,
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,
Date dateDied,
Concept causeOfDeath,
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,
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,
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,
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,
Date deathDate,
Concept cause,
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(Map<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,
String reason)
Used only in cases where the Allergy was entered by error
|
Patient |
voidPatient(Patient patient,
String reason)
Void patient record (functionally delete patient from system)
|
PatientIdentifier |
voidPatientIdentifier(PatientIdentifier patientIdentifier,
String reason)
Void patient identifier (functionally delete patient identifier from system)
|
void |
voidProblem(Problem problem,
String reason)
Used only in cases where the Problem was entered by error
|
onStartup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onStartup
public void setPatientDAO(PatientDAO dao)
PatientService
setPatientDAO
in interface PatientService
dao
- DAO for this servicePatientService.setPatientDAO(org.openmrs.api.db.PatientDAO)
public void onShutdown()
onShutdown
in interface OpenmrsService
onShutdown
in class BaseOpenmrsService
BaseOpenmrsService.onShutdown()
@Deprecated public Patient createPatient(Patient patient) throws APIException
createPatient
in interface PatientService
APIException
savePatient(Patient)
,
PatientService.createPatient(org.openmrs.Patient)
public Patient savePatient(Patient patient) throws APIException
PatientService
patient
to the databasesavePatient
in interface PatientService
patient
- patient to be created or updatedAPIException
PatientService.savePatient(org.openmrs.Patient)
public Patient getPatient(Integer patientId) throws APIException
PatientService
getPatient
in interface PatientService
patientId
- internal patient identifierAPIException
PatientService.getPatient(java.lang.Integer)
public Patient getPatientOrPromotePerson(Integer patientOrPersonId)
PatientService
getPatientOrPromotePerson
in interface PatientService
@Deprecated public Patient updatePatient(Patient patient) throws APIException
updatePatient
in interface PatientService
APIException
savePatient(Patient)
,
PatientService.updatePatient(org.openmrs.Patient)
public List<Patient> getAllPatients() throws APIException
PatientService
getAllPatients
in interface PatientService
APIException
PatientService.getAllPatients()
public List<Patient> getAllPatients(boolean includeVoided) throws APIException
PatientService
getAllPatients
in interface PatientService
includeVoided
- if false, will limit the search to non-voided patientsAPIException
PatientService.getAllPatients(boolean)
@Deprecated public List<Patient> getPatients(String name, String identifier, List<PatientIdentifierType> identifierTypes) throws APIException
getPatients(String, String, List, boolean)
getPatients
in interface PatientService
APIException
PatientService.getPatients(java.lang.String, java.lang.String,
java.util.List)
public List<Patient> getPatients(String name, String identifier, List<PatientIdentifierType> identifierTypes, boolean matchIdentifierExactly) throws APIException
PatientService
OpenmrsConstants.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 PatientService
name
- (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 expressionAPIException
PatientService.getPatients(java.lang.String, java.lang.String,
java.util.List, boolean)
public void checkPatientIdentifiers(Patient patient) throws PatientIdentifierException
PatientService
checkPatientIdentifiers
in interface PatientService
patient
- 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)
PatientService
checkPatientIdentifier
in interface PatientService
pi
- identifier to be validatedPatientIdentifierException
- if the identifier is invalidPatientService.checkPatientIdentifier(org.openmrs.PatientIdentifier)
@Deprecated public Patient identifierInUse(String identifier, PatientIdentifierType type, Patient ignorePatient)
identifierInUse
in interface PatientService
PatientService.identifierInUse(java.lang.String,
org.openmrs.PatientIdentifierType, org.openmrs.Patient)
@Deprecated public List<Patient> getPatientsByIdentifier(String identifier, boolean includeVoided) throws APIException
getPatients(String, String, List)
getPatientsByIdentifier
in interface PatientService
APIException
PatientService.getPatientsByIdentifier(java.lang.String, boolean)
@Deprecated public List<Patient> getPatientsByIdentifierPattern(String identifier, boolean includeVoided) throws APIException
getPatients(String, String, List, boolean)
getPatientsByIdentifierPattern
in interface PatientService
APIException
PatientService.getPatientsByIdentifierPattern(java.lang.String, boolean)
@Deprecated public List<Patient> getPatientsByName(String name) throws APIException
getPatients(String, String, List, boolean)
getPatientsByName
in interface PatientService
APIException
PatientService.getPatientsByName(java.lang.String)
@Deprecated public List<Patient> getPatientsByName(String name, boolean includeVoided) throws APIException
getPatients(String, String, List, boolean)
getPatientsByName
in interface PatientService
APIException
public Patient voidPatient(Patient patient, String reason) throws APIException
PatientService
voidPatient
in interface PatientService
patient
- patient to be voidedreason
- reason for voiding patientAPIException
PatientService.voidPatient(org.openmrs.Patient, java.lang.String)
public Patient unvoidPatient(Patient patient) throws APIException
PatientService
unvoidPatient
in interface PatientService
patient
- patient to be revivedAPIException
PatientService.unvoidPatient(org.openmrs.Patient)
@Deprecated public void deletePatient(Patient patient) throws APIException
purgePatient(Patient)
deletePatient
in interface PatientService
APIException
voidPatient(org.openmrs.Patient,java.lang.String)
public void purgePatient(Patient patient) throws APIException
PatientService
purgePatient
in interface PatientService
patient
- patient to be deletedAPIException
PatientService.purgePatient(org.openmrs.Patient)
public List<PatientIdentifier> getPatientIdentifiers(String identifier, List<PatientIdentifierType> patientIdentifierTypes, List<Location> locations, List<Patient> patients, Boolean isPreferred) throws APIException
PatientService
getPatientIdentifiers
in interface PatientService
identifier
- 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 statusAPIException
PatientService.getPatientIdentifiers(java.lang.String, java.util.List,
java.util.List, java.util.List, java.lang.Boolean)
@Deprecated public List<PatientIdentifier> getPatientIdentifiers(PatientIdentifierType pit) throws APIException
getPatientIdentifiers(String, List, List, List, Boolean)
getPatientIdentifiers
in interface PatientService
APIException
PatientService.getPatientIdentifiers(org.openmrs.PatientIdentifierType)
@Deprecated public List<PatientIdentifier> getPatientIdentifiers(String identifier, PatientIdentifierType pit) throws APIException
getPatientIdentifiers(String, List, List, List, Boolean)
getPatientIdentifiers
in interface PatientService
APIException
PatientService.getPatientIdentifiers(java.lang.String,
org.openmrs.PatientIdentifierType)
@Deprecated public List<PatientIdentifier> getPatientIdentifiers(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
databasePatientService
updatePatientIdentifier
in interface PatientService
pi
- identifier to be updatedAPIException
public PatientIdentifierType savePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws APIException
savePatientIdentifierType
in interface PatientService
patientIdentifierType
- PatientIdentifierType to create or updateAPIException
PatientService.savePatientIdentifierType(org.openmrs.PatientIdentifierType)
@Deprecated public List<PatientIdentifierType> getPatientIdentifierTypes() throws APIException
getAllPatientIdentifierTypes()
getPatientIdentifierTypes
in interface PatientService
APIException
PatientService.getPatientIdentifierTypes()
,
PatientService.getAllPatientIdentifierTypes()
public List<PatientIdentifierType> getAllPatientIdentifierTypes() throws APIException
PatientService
Ordered same as PatientIdentifierTypeDefaultComparator
.
getAllPatientIdentifierTypes
in interface PatientService
APIException
PatientService.getAllPatientIdentifierTypes()
public List<PatientIdentifierType> getAllPatientIdentifierTypes(boolean includeRetired) throws APIException
PatientService
Ordered same as PatientIdentifierTypeDefaultComparator
.
getAllPatientIdentifierTypes
in interface PatientService
includeRetired
- true/false whether retired types should be includedAPIException
PatientService.getAllPatientIdentifierTypes(boolean)
public List<PatientIdentifierType> getPatientIdentifierTypes(String name, String format, Boolean required, Boolean hasCheckDigit) throws APIException
PatientService
Ordered same as PatientIdentifierTypeDefaultComparator
.
getPatientIdentifierTypes
in interface PatientService
name
- 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 checkDigitAPIException
PatientService.getPatientIdentifierTypes(java.lang.String,
java.lang.String, java.lang.Boolean, java.lang.Boolean)
public PatientIdentifierType getPatientIdentifierType(Integer patientIdentifierTypeId) throws APIException
PatientService
getPatientIdentifierType
in interface PatientService
APIException
PatientService.getPatientIdentifierType(java.lang.Integer)
@Deprecated public PatientIdentifierType getPatientIdentifierType(String name) throws APIException
getPatientIdentifierType
in interface PatientService
APIException
PatientService.getPatientIdentifierType(java.lang.String)
public PatientIdentifierType getPatientIdentifierTypeByName(String name) throws APIException
PatientService
getPatientIdentifierTypeByName
in interface PatientService
APIException
PatientService.getPatientIdentifierTypeByName(java.lang.String)
public PatientIdentifierType retirePatientIdentifierType(PatientIdentifierType patientIdentifierType, String reason) throws APIException
PatientService
retirePatientIdentifierType
in interface PatientService
patientIdentifierType
- type of patient identifier to be retiredreason
- the reason to retire this identifier typeAPIException
PatientService.retirePatientIdentifierType(org.openmrs.PatientIdentifierType,
String)
public PatientIdentifierType unretirePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws APIException
PatientService
unretirePatientIdentifierType
in interface PatientService
patientIdentifierType
- type of patient identifier to be unretiredAPIException
PatientService.unretirePatientIdentifierType(org.openmrs.PatientIdentifierType)
public void purgePatientIdentifierType(PatientIdentifierType patientIdentifierType) throws APIException
PatientService
purgePatientIdentifierType
in interface PatientService
patientIdentifierType
- PatientIdentifierType to purge from the databaseAPIException
PatientService.purgePatientIdentifierType(org.openmrs.PatientIdentifierType)
@Deprecated public List<Patient> findPatients(String query, boolean includeVoided) throws APIException
findPatients
in interface PatientService
APIException
PatientService.findPatients(java.lang.String, boolean)
public List<Patient> getPatients(String query) throws APIException
PatientService
getPatients
in interface PatientService
query
- the string to search onAPIException
PatientService.getPatients(java.lang.String)
@Deprecated public Patient findPatient(Patient patientToMatch) throws APIException
findPatient
in interface PatientService
APIException
PatientService.findPatient(org.openmrs.Patient)
,
getPatientByExample(Patient)
public Patient getPatientByExample(Patient patientToMatch) throws APIException
getPatientByExample
in interface PatientService
APIException
PatientService.getPatientByExample(org.openmrs.Patient)
@Deprecated public List<Patient> findDuplicatePatients(Set<String> attributes) throws APIException
getDuplicatePatientsByAttributes(List)
findDuplicatePatients
in interface PatientService
APIException
PatientService.getDuplicatePatientsByAttributes(List)
public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) throws APIException
PatientService
getDuplicatePatientsByAttributes
in interface PatientService
attributes
- attributes on a Person or Patient object. similar to: [gender, givenName,
middleName, familyName]APIException
PatientService.getDuplicatePatientsByAttributes(java.util.List)
public void mergePatients(Patient preferred, Patient notPreferred) throws APIException
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 PatientService
preferred
- notPreferred
- APIException
PatientService.mergePatients(org.openmrs.Patient, org.openmrs.Patient)
public void exitFromCare(Patient patient, Date dateExited, Concept reasonForExit) throws APIException
exitFromCare
in interface PatientService
patient
- - 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
exitedAPIException
public void processDeath(Patient patient, Date dateDied, Concept causeOfDeath, String otherReason) throws APIException
processDeath
in interface PatientService
patient
- - 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 infoAPIException
public void saveCauseOfDeathObs(Patient patient, Date deathDate, Concept cause, String otherReason) throws APIException
PatientService
saveCauseOfDeathObs
in interface PatientService
patient
- - 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 suppliedAPIException
PatientService.saveCauseOfDeathObs(org.openmrs.Patient, java.util.Date,
org.openmrs.Concept, java.lang.String)
public Patient getPatientByUuid(String uuid) throws APIException
PatientService
getPatientByUuid
in interface PatientService
uuid
- universally unique identifierAPIException
PatientService.getPatientByUuid(java.lang.String)
public PatientIdentifier getPatientIdentifierByUuid(String uuid) throws APIException
PatientService
getPatientIdentifierByUuid
in interface PatientService
uuid
- universally unique identifierAPIException
public PatientIdentifierType getPatientIdentifierTypeByUuid(String uuid) throws APIException
PatientService
getPatientIdentifierTypeByUuid
in interface PatientService
APIException
PatientService.getPatientIdentifierTypeByUuid(java.lang.String)
public IdentifierValidator getDefaultIdentifierValidator()
getDefaultIdentifierValidator
in interface PatientService
PatientService.getDefaultIdentifierValidator()
public IdentifierValidator getIdentifierValidator(Class<IdentifierValidator> identifierValidator)
PatientService
getIdentifierValidator
in interface PatientService
identifierValidator
- identifierValidator which validator to get.PatientService.getIdentifierValidator(java.lang.String)
public Map<Class<? extends IdentifierValidator>,IdentifierValidator> getIdentifierValidators()
public void setIdentifierValidators(Map<Class<? extends IdentifierValidator>,IdentifierValidator> identifierValidators)
identifierValidators
- public Collection<IdentifierValidator> getAllIdentifierValidators()
getAllIdentifierValidators
in interface PatientService
PatientService.getAllIdentifierValidators()
public IdentifierValidator getIdentifierValidator(String pivClassName)
getIdentifierValidator
in interface PatientService
PatientService.getIdentifierValidator(java.lang.String)
public boolean isIdentifierInUseByAnotherPatient(PatientIdentifier patientIdentifier)
PatientService
isIdentifierInUseByAnotherPatient
in interface PatientService
patientIdentifier
- the patient identifier to look for in other patientsPatientService.isIdentifierInUseByAnotherPatient(org.openmrs.PatientIdentifier)
public PatientIdentifier getPatientIdentifier(Integer patientIdentifierId) throws APIException
PatientService
getPatientIdentifier
in interface PatientService
APIException
PatientService.getPatientIdentifier(java.lang.Integer)
public PatientIdentifier voidPatientIdentifier(PatientIdentifier patientIdentifier, String reason) throws APIException
PatientService
voidPatientIdentifier
in interface PatientService
reason
- reason for voiding patient identifierAPIException
PatientService.voidPatientIdentifier(org.openmrs.PatientIdentifier,
java.lang.String)
public PatientIdentifier savePatientIdentifier(PatientIdentifier patientIdentifier) throws APIException
PatientService
patientIndentifier
to the databasesavePatientIdentifier
in interface PatientService
APIException
PatientService.savePatientIdentifier(org.openmrs.PatientIdentifier)
public void purgePatientIdentifier(PatientIdentifier patientIdentifier) throws APIException
PatientService
purgePatientIdentifier
in interface PatientService
patientIdentifier
- PatientIdentifier to purge from the databaseAPIException
PatientService.purgePatientIdentifier(org.openmrs.PatientIdentifier)
public List<Problem> getProblems(Person p) throws APIException
PatientService
getProblems
in interface PatientService
p
- the PersonAPIException
PatientService.getProblems(org.openmrs.Person)
public Problem getProblem(Integer problemListId) throws APIException
PatientService
getProblem
in interface PatientService
APIException
PatientService.getProblem(java.lang.Integer)
public void saveProblem(Problem problem) throws APIException
PatientService
saveProblem
in interface PatientService
problem
- the ProblemAPIException
PatientService.saveProblem(org.openmrs.activelist.Problem)
public void removeProblem(Problem problem, String reason) throws APIException
PatientService
removeProblem
in interface PatientService
problem
- the Problemreason
- the reason of removing the problemAPIException
PatientService.removeProblem(org.openmrs.activelist.Problem,
java.lang.String)
public void voidProblem(Problem problem, String reason) throws APIException
PatientService
voidProblem
in interface PatientService
APIException
PatientService.voidProblem(org.openmrs.activelist.Problem,
java.lang.String)
public List<Allergy> getAllergies(Person p) throws APIException
PatientService
getAllergies
in interface PatientService
p
- the PersonAPIException
PatientService.getAllergies(org.openmrs.Person)
public Allergy getAllergy(Integer allergyListId) throws APIException
PatientService
getAllergy
in interface PatientService
APIException
PatientService.getAllergy(java.lang.Integer)
public void saveAllergy(Allergy allergy) throws APIException
PatientService
saveAllergy
in interface PatientService
allergy
- the AllergyAPIException
PatientService.saveAllergy(org.openmrs.activelist.Allergy)
public void removeAllergy(Allergy allergy, String reason) throws APIException
PatientService
removeAllergy
in interface PatientService
allergy
- the Allergyreason
- the reason of removeAPIException
PatientService.removeAllergy(org.openmrs.activelist.Allergy,
java.lang.String)
public void voidAllergy(Allergy allergy, String reason) throws APIException
PatientService
voidAllergy
in interface PatientService
APIException
PatientService.voidAllergy(org.openmrs.activelist.Allergy,
java.lang.String)
public Integer getCountOfPatients(String query)
PatientService
getCountOfPatients
in interface PatientService
query
- the string to search onPatientService.getCountOfPatients(String)
public List<Patient> getPatients(String query, Integer start, Integer length) throws APIException
PatientService
getPatients
in interface PatientService
query
- the string to search onstart
- the starting indexlength
- the number of patients to returnAPIException
PatientService.getPatients(String, Integer, Integer)
public List<Patient> getPatients(String name, String identifier, List<PatientIdentifierType> identifierTypes, boolean matchIdentifierExactly, Integer start, Integer length) throws APIException
PatientService
OpenmrsConstants.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 PatientService
name
- (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 returnAPIException
PatientService#getPatients(String, String, List, boolean, int, Integer)
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.