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
|
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(java.lang.Integer patientId) throws APIException
PatientService
getPatient
in interface PatientService
patientId
- internal patient identifierAPIException
PatientService.getPatient(java.lang.Integer)
public Patient getPatientOrPromotePerson(java.lang.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 java.util.List<Patient> getAllPatients() throws APIException
PatientService
getAllPatients
in interface PatientService
APIException
PatientService.getAllPatients()
public java.util.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 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 PatientService
APIException
PatientService.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
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(java.lang.String identifier, PatientIdentifierType type, Patient ignorePatient)
identifierInUse
in interface PatientService
PatientService.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 PatientService
APIException
PatientService.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 PatientService
APIException
PatientService.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 PatientService
APIException
PatientService.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 PatientService
APIException
public Patient voidPatient(Patient patient, java.lang.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 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
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 java.util.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 java.util.List<PatientIdentifier> getPatientIdentifiers(java.lang.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 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
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 java.util.List<PatientIdentifierType> getPatientIdentifierTypes() throws APIException
getAllPatientIdentifierTypes()
getPatientIdentifierTypes
in interface PatientService
APIException
PatientService.getPatientIdentifierTypes()
,
PatientService.getAllPatientIdentifierTypes()
public java.util.List<PatientIdentifierType> getAllPatientIdentifierTypes() throws APIException
PatientService
Ordered same as PatientIdentifierTypeDefaultComparator
.
getAllPatientIdentifierTypes
in interface PatientService
APIException
PatientService.getAllPatientIdentifierTypes()
public java.util.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 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 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(java.lang.Integer patientIdentifierTypeId) throws APIException
PatientService
getPatientIdentifierType
in interface PatientService
APIException
PatientService.getPatientIdentifierType(java.lang.Integer)
@Deprecated public PatientIdentifierType getPatientIdentifierType(java.lang.String name) throws APIException
getPatientIdentifierType
in interface PatientService
APIException
PatientService.getPatientIdentifierType(java.lang.String)
public PatientIdentifierType getPatientIdentifierTypeByName(java.lang.String name) throws APIException
PatientService
getPatientIdentifierTypeByName
in interface PatientService
APIException
PatientService.getPatientIdentifierTypeByName(java.lang.String)
public PatientIdentifierType retirePatientIdentifierType(PatientIdentifierType patientIdentifierType, java.lang.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 java.util.List<Patient> findPatients(java.lang.String query, boolean includeVoided) throws APIException
findPatients
in interface PatientService
APIException
PatientService.findPatients(java.lang.String, boolean)
public java.util.List<Patient> getPatients(java.lang.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 java.util.List<Patient> findDuplicatePatients(java.util.Set<java.lang.String> attributes) throws APIException
getDuplicatePatientsByAttributes(List)
findDuplicatePatients
in interface PatientService
APIException
PatientService.getDuplicatePatientsByAttributes(List)
public java.util.List<Patient> getDuplicatePatientsByAttributes(java.util.List<java.lang.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, 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 PatientService
preferred
- notPreferred
- APIException
SerializationException
PatientService.mergePatients(org.openmrs.Patient, org.openmrs.Patient)
public void exitFromCare(Patient patient, java.util.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, java.util.Date dateDied, Concept causeOfDeath, java.lang.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, java.util.Date deathDate, Concept cause, java.lang.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(java.lang.String uuid) throws APIException
PatientService
getPatientByUuid
in interface PatientService
uuid
- universally unique identifierAPIException
PatientService.getPatientByUuid(java.lang.String)
public PatientIdentifier getPatientIdentifierByUuid(java.lang.String uuid) throws APIException
PatientService
getPatientIdentifierByUuid
in interface PatientService
uuid
- universally unique identifierAPIException
public PatientIdentifierType getPatientIdentifierTypeByUuid(java.lang.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(java.lang.Class<IdentifierValidator> identifierValidator)
PatientService
getIdentifierValidator
in interface PatientService
identifierValidator
- 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 PatientService
PatientService.getAllIdentifierValidators()
public IdentifierValidator getIdentifierValidator(java.lang.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(java.lang.Integer patientIdentifierId) throws APIException
PatientService
getPatientIdentifier
in interface PatientService
APIException
PatientService.getPatientIdentifier(java.lang.Integer)
public PatientIdentifier voidPatientIdentifier(PatientIdentifier patientIdentifier, java.lang.String reason) throws APIException
PatientService
voidPatientIdentifier
in interface PatientService
reason
- reason for voiding patient identifierAPIException
PatientService.voidPatientIdentifier(org.openmrs.PatientIdentifier,
java.lang.String)
public void mergePatients(Patient preferred, java.util.List<Patient> notPreferred) throws APIException, SerializationException
PatientService
mergePatients
in interface PatientService
APIException
SerializationException
PatientService.mergePatients(org.openmrs.Patient, java.util.List)
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 java.util.List<Problem> getProblems(Person p) throws APIException
PatientService
getProblems
in interface PatientService
p
- the PersonAPIException
PatientService.getProblems(org.openmrs.Person)
public Problem getProblem(java.lang.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, java.lang.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, java.lang.String reason) throws APIException
PatientService
voidProblem
in interface PatientService
APIException
PatientService.voidProblem(org.openmrs.activelist.Problem,
java.lang.String)
public java.util.List<Allergy> getAllergies(Person p) throws APIException
PatientService
getAllergies
in interface PatientService
p
- the PersonAPIException
PatientService.getAllergies(org.openmrs.Person)
public Allergy getAllergy(java.lang.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, java.lang.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, java.lang.String reason) throws APIException
PatientService
voidAllergy
in interface PatientService
APIException
PatientService.voidAllergy(org.openmrs.activelist.Allergy,
java.lang.String)
public java.lang.Integer getCountOfPatients(java.lang.String query)
PatientService
getCountOfPatients
in interface PatientService
query
- 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
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 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
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, Integer, Integer)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.