public class PersonServiceImpl extends BaseOpenmrsService implements PersonService
Which implementation to use is determined by Spring. See the spring application context file in /metadata/api/spring/applicatContext-service.xml
PersonService,
ContextPersonService.ATTR_VIEW_TYPE| Constructor and Description |
|---|
PersonServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Person |
createPerson(Person person)
Deprecated.
|
void |
createPersonAttributeType(PersonAttributeType type)
Deprecated.
|
void |
createRelationship(Relationship relationship)
Deprecated.
|
void |
createRelationshipType(RelationshipType relationshipType)
Deprecated.
|
void |
deletePerson(Person person)
Deprecated.
|
void |
deletePersonAttributeType(java.lang.Integer attrTypeId)
Deprecated.
|
void |
deletePersonAttributeType(PersonAttributeType type)
Deprecated.
|
void |
deleteRelationship(Relationship relationship)
Deprecated.
|
void |
deleteRelationshipType(RelationshipType relationshipType)
Deprecated.
|
java.util.Set<Person> |
findPeople(java.lang.String searchPhrase,
boolean includeVoided)
Deprecated.
|
java.util.Set<Person> |
findPeople(java.lang.String searchPhrase,
boolean includeVoided,
java.util.List<java.lang.String> roles)
Deprecated.
|
java.util.Set<Person> |
findPeople(java.lang.String searchPhrase,
boolean includeVoided,
java.lang.String roles)
Deprecated.
|
RelationshipType |
findRelationshipType(java.lang.String relationshipTypeName)
Deprecated.
|
java.util.List<PersonAttributeType> |
getAllPersonAttributeTypes()
Get all PersonAttributeTypes in the database
|
java.util.List<PersonAttributeType> |
getAllPersonAttributeTypes(boolean includeRetired)
Get all PersonAttributeTypes in the database with the option of including the retired types
|
java.util.List<PersonMergeLog> |
getAllPersonMergeLogs(boolean deserialize)
Gets all the
PersonMergeLog objects from the model |
java.util.List<Relationship> |
getAllRelationships()
Get list of relationships that are not voided
|
java.util.List<Relationship> |
getAllRelationships(boolean includeVoided)
Get list of relationships optionally including the voided ones or not
|
java.util.List<RelationshipType> |
getAllRelationshipTypes()
Get all relationshipTypes Includes retired relationship types
|
java.util.List<RelationshipType> |
getAllRelationshipTypes(boolean includeRetired)
Get all relationshipTypes with the option of including the retired types
|
PersonMergeLog |
getLosingPersonMergeLog(Person person,
boolean deserialize)
Gets the
PersonMergeLog where person p is the loser. |
java.util.List<Person> |
getPeople(java.lang.String searchPhrase,
java.lang.Boolean dead)
Find a person matching the searchPhrase search string
|
Person |
getPerson(java.lang.Integer personId)
Gets a person by internal id
|
Person |
getPerson(Patient pat)
Deprecated.
|
Person |
getPerson(User user)
Deprecated.
|
PersonAddress |
getPersonAddressByUuid(java.lang.String uuid)
Get PersonAddress by its UUID
|
PersonAttribute |
getPersonAttribute(java.lang.Integer id)
Get a PersonAttribute from the database with the given PersonAttributeid
|
PersonAttribute |
getPersonAttributeByUuid(java.lang.String uuid)
Get PersonAttribute by its UUID
|
PersonAttributeType |
getPersonAttributeType(java.lang.Integer typeId)
Get the PersonAttributeType given the type's PersonAttributeTypeId
|
PersonAttributeType |
getPersonAttributeType(java.lang.String s)
Deprecated.
|
PersonAttributeType |
getPersonAttributeTypeByName(java.lang.String typeName)
Get the PersonAttributeType given the type's name
|
PersonAttributeType |
getPersonAttributeTypeByUuid(java.lang.String uuid)
Gets a person attribute type with the given uuid.
|
java.util.List<PersonAttributeType> |
getPersonAttributeTypes()
Deprecated.
|
java.util.List<PersonAttributeType> |
getPersonAttributeTypes(OpenmrsConstants.PERSON_TYPE personType,
PersonService.ATTR_VIEW_TYPE viewType)
Gets the types defined for the given person type (person, user, patient) and the given type
of view (one person vs many person objects)
|
java.util.List<PersonAttributeType> |
getPersonAttributeTypes(java.lang.String personTypeStr,
java.lang.String displayTypeStr)
|
java.util.List<PersonAttributeType> |
getPersonAttributeTypes(java.lang.String exactName,
java.lang.String format,
java.lang.Integer foreignKey,
java.lang.Boolean searchable)
Find person attribute types matching the given parameters.
|
Person |
getPersonByUuid(java.lang.String uuid)
Get Person by its UUID
|
PersonMergeLog |
getPersonMergeLogByUuid(java.lang.String uuid,
boolean deserialize)
Gets a PersonMergeLog object from the model using the UUID identifier.
|
PersonName |
getPersonName(java.lang.Integer personNameId)
Get PersonName by its personNameId
|
PersonName |
getPersonNameByUuid(java.lang.String uuid)
Get PersonName by its UUID
|
Relationship |
getRelationship(java.lang.Integer relationshipId)
Get relationship by internal relationship identifier
|
Relationship |
getRelationshipByUuid(java.lang.String uuid)
Get Relationship by its UUID
|
java.util.Map<Person,java.util.List<Person>> |
getRelationshipMap(RelationshipType relType)
Get all relationships for a given type of relationship mapped from the personA to all of the
personB's
|
java.util.List<Relationship> |
getRelationships()
Deprecated.
|
java.util.List<Relationship> |
getRelationships(Person p)
Deprecated.
|
java.util.List<Relationship> |
getRelationships(Person p,
boolean showVoided)
Deprecated.
|
java.util.List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType)
Get relationships stored in the database that
|
java.util.List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType,
java.util.Date effectiveDate)
Get relationships stored in the database that are active on the passed date
|
java.util.List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType,
java.util.Date startEffectiveDate,
java.util.Date endEffectiveDate)
Get relationships stored in the database that were active during the specified date range
|
java.util.Map<Person,java.util.List<Person>> |
getRelationships(RelationshipType relType)
Deprecated.
|
java.util.List<Relationship> |
getRelationshipsByPerson(Person p)
Get list of relationships that include Person in person_id or relative_id Does not include
voided relationships
|
java.util.List<Relationship> |
getRelationshipsByPerson(Person p,
java.util.Date effectiveDate)
Get list of relationships that include Person in person_id or relative_id.
|
java.util.List<Relationship> |
getRelationshipsTo(Person toPerson,
RelationshipType relType)
Deprecated.
|
RelationshipType |
getRelationshipType(java.lang.Integer relationshipTypeId)
Get relationshipType by internal identifier
|
RelationshipType |
getRelationshipTypeByName(java.lang.String relationshipTypeName)
Find relationshipType by exact name match
|
RelationshipType |
getRelationshipTypeByUuid(java.lang.String uuid)
Gets the relationship type with the given uuid.
|
java.util.List<RelationshipType> |
getRelationshipTypes()
Deprecated.
|
java.util.List<RelationshipType> |
getRelationshipTypes(java.lang.String searchString)
Get relationshipTypes by searching through the names and loosely matching to the given
searchString
|
java.util.List<RelationshipType> |
getRelationshipTypes(java.lang.String relationshipTypeName,
java.lang.Boolean preferred)
Find relationshipTypes by exact name match and/or preferred status
|
java.util.Set<Person> |
getSimilarPeople(java.lang.String name,
java.lang.Integer birthyear,
java.lang.String gender)
Find a similar person given the attributes.
|
java.util.Set<Person> |
getSimilarPeople(java.lang.String nameSearch,
java.lang.Integer birthyear,
java.lang.String gender,
java.lang.String personType)
Deprecated.
|
java.util.List<PersonMergeLog> |
getWinningPersonMergeLogs(Person person,
boolean deserialize)
Gets
PersonMergeLog objects by winning person p. |
PersonName |
parsePersonName(java.lang.String name)
Parses a name into a PersonName (separate Given, Middle, and Family names)
|
void |
purgePerson(Person person)
Purges a person from the database (cannot be undone)
|
void |
purgePersonAttributeType(PersonAttributeType type)
Purges a PersonAttribute type from the database (cannot be undone)
|
void |
purgeRelationship(Relationship relationship)
Purges a relationship from the database (cannot be undone)
|
void |
purgeRelationshipType(RelationshipType relationshipType)
Purge relationship type from the database (cannot be undone)
|
PersonAttributeType |
retirePersonAttributeType(PersonAttributeType type,
java.lang.String retiredReason)
Retire a Person Attribute Type
|
RelationshipType |
retireRelationshipType(RelationshipType type,
java.lang.String retiredReason)
Retire a Person Relationship Type
|
Person |
savePerson(Person person)
Creates or updates a Person in the database
|
PersonAddress |
savePersonAddress(PersonAddress personAddress)
Inserts or updates the given personAddress object in the database
|
PersonAttributeType |
savePersonAttributeType(PersonAttributeType type)
Save the given person attribute type in the database.
|
PersonMergeLog |
savePersonMergeLog(PersonMergeLog personMergeLog)
Builds the serialized data from
PersonMergeLog.getPersonMergeLogData(), sets the mergedData String,
and the creator and date if null. |
PersonName |
savePersonName(PersonName personName)
Inserts or updates the given personName object in the database
|
Relationship |
saveRelationship(Relationship relationship)
Create or update a relationship between people.
|
RelationshipType |
saveRelationshipType(RelationshipType relationshipType)
Inserts or updates the given relationship type object in the database
|
void |
setPersonDAO(PersonDAO dao)
Sets the DAO for this service.
|
PersonName |
splitPersonName(java.lang.String name)
Deprecated.
see #parsePersonName(String)
|
void |
unretirePersonAttributeType(PersonAttributeType type)
Unretires a PersonAttribute type from the database (can be undone)
|
RelationshipType |
unretireRelationshipType(RelationshipType relationshipType)
Unretire a Person Relationship Type
|
Person |
unvoidPerson(Person person)
Effectively resurrects this person in the db.
|
PersonAddress |
unvoidPersonAddress(PersonAddress personAddress)
Unvoid PersonAddress in the database, effectively marking this as a valid PersonAddress again
|
PersonName |
unvoidPersonName(PersonName personName)
Unvoid PersonName in the database, effectively marking this as a valid personName again
|
Relationship |
unvoidRelationship(Relationship relationship)
Unvoid Relationship in the database, effectively marking this as a valid relationship again
|
void |
updatePerson(Person person)
Deprecated.
|
void |
updatePersonAttributeType(PersonAttributeType type)
Deprecated.
|
void |
updateRelationship(Relationship relationship)
Deprecated.
|
void |
updateRelationshipType(RelationshipType relationshipType)
Deprecated.
|
Person |
voidPerson(Person person,
java.lang.String reason)
Effectively removes this person from the system.
|
PersonAddress |
voidPersonAddress(PersonAddress personAddress,
java.lang.String voidReason)
Voids the given PersonAddress, effectively deleting the personAddress, from the end-user's
point of view.
|
PersonName |
voidPersonName(PersonName personName,
java.lang.String voidReason)
Voids the given PersonName, effectively deleting the name, from the end-user's point of view.
|
Relationship |
voidRelationship(Relationship relationship,
java.lang.String voidReason)
Voids the given Relationship, effectively removing it from openmrs.
|
onShutdown, onStartupclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonShutdown, onStartuppublic void setPersonDAO(PersonDAO dao)
PersonServicesetPersonDAO in interface PersonServicedao - DAO for this servicePersonService.setPersonDAO(org.openmrs.api.db.PersonDAO)public java.util.Set<Person> getSimilarPeople(java.lang.String name, java.lang.Integer birthyear, java.lang.String gender) throws APIException
PersonServicenameSearch parameter. This does a very loose lookup on birthyear as
well. Any person with a null/missing birthdate is included and anyone with a birthyear
plus/minus one year from the given birthyear is also includedgetSimilarPeople in interface PersonServicename - string to search the person's name forbirthyear - the year of birth to restrictgender - The gender field to search on (Typically just "M" or "F")APIExceptionPersonService.getSimilarPeople(java.lang.String, java.lang.Integer,
java.lang.String)public java.util.Set<Person> getSimilarPeople(java.lang.String nameSearch, java.lang.Integer birthyear, java.lang.String gender, java.lang.String personType) throws APIException
getSimilarPeople(String, Integer, String)PersonServicegetSimilarPeople in interface PersonServicenameSearch - string to search the person's name forbirthyear - the year of birth to restrictgender - The gender field to search on (Typically just "M" or "F")personType - one of person, user, or patient. If Person, any Person object is returned,
if Patient, only Persons that are Patients are returned, if User, only Persons
that are Users are returnedAPIExceptionPersonService.getSimilarPeople(java.lang.String, java.lang.Integer,
java.lang.String, java.lang.String)public java.util.List<Person> getPeople(java.lang.String searchPhrase, java.lang.Boolean dead) throws APIException
PersonServicegetPeople in interface PersonServicesearchPhrase - person name to match ondead - if true will return only dead patients, if false will return only alive patients,
if null will return bothAPIExceptionPersonService.getPeople(String, Boolean)public java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided)
getPeople(String, Boolean)findPeople in interface PersonServicepublic java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided, java.lang.String roles)
getPeople(String, Boolean)findPeople in interface PersonServicepublic java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided, java.util.List<java.lang.String> roles)
getPeople(String, Boolean)findPeople in interface PersonServicepublic java.util.List<PersonAttributeType> getAllPersonAttributeTypes() throws APIException
PersonServicegetAllPersonAttributeTypes in interface PersonServiceAPIExceptionPersonService.getAllPersonAttributeTypes()public java.util.List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired) throws APIException
PersonServicegetAllPersonAttributeTypes in interface PersonServiceincludeRetired - boolean - include retired attribute types as well?APIExceptionPersonService.getAllPersonAttributeTypes(boolean)public PersonAttributeType getPersonAttributeTypeByName(java.lang.String typeName) throws APIException
PersonServicegetPersonAttributeTypeByName in interface PersonServiceAPIExceptionPersonService.getPersonAttributeTypeByName(java.lang.String)public void purgePersonAttributeType(PersonAttributeType type) throws APIException
PersonServicepurgePersonAttributeType in interface PersonServicetype - type to be purged from the databaseAPIExceptionPersonService.purgePersonAttributeType(org.openmrs.PersonAttributeType)public PersonAttributeType savePersonAttributeType(PersonAttributeType type) throws APIException
PersonServiceOpenmrsConstants.GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES and reference this given
type, prior to saving this given type. savePersonAttributeType in interface PersonServiceAPIExceptionPersonService.savePersonAttributeType(org.openmrs.PersonAttributeType)public PersonAttributeType retirePersonAttributeType(PersonAttributeType type, java.lang.String retiredReason) throws APIException
PersonServiceretirePersonAttributeType in interface PersonServiceAPIExceptionorg.openmrs.api.PersonService#retirePersonAttributeType(org.openmrs.PersonAttributeType)public void createPersonAttributeType(PersonAttributeType type) throws APIException
savePersonAttributeType(PersonAttributeType)createPersonAttributeType in interface PersonServiceAPIExceptionpublic void updatePersonAttributeType(PersonAttributeType type) throws APIException
savePersonAttributeType(PersonAttributeType)updatePersonAttributeType in interface PersonServiceAPIExceptionpublic java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String exactName, java.lang.String format, java.lang.Integer foreignKey, java.lang.Boolean searchable) throws APIException
PersonServicegetPersonAttributeTypes in interface PersonServiceexactName - (optional) The name of typeformat - (optional) The format for this typeforeignKey - (optional) The foreign keysearchable - (optional) if true only returns searchable types, if false returns only
nonsearchable and if null returns allAPIExceptionPersonService.getPersonAttributeTypes(java.lang.String,
java.lang.String, java.lang.Integer, java.lang.Boolean)public void deletePersonAttributeType(java.lang.Integer attrTypeId)
purgePersonAttributeType(PersonAttributeType)PersonServicedeletePersonAttributeType in interface PersonServicepublic void deletePersonAttributeType(PersonAttributeType type)
purgePersonAttributeType(PersonAttributeType)deletePersonAttributeType in interface PersonServicepublic void unretirePersonAttributeType(PersonAttributeType type) throws APIException
PersonServiceunretirePersonAttributeType in interface PersonServicetype - type to be restored from the databaseAPIExceptionpublic java.util.List<PersonAttributeType> getPersonAttributeTypes()
getAllPersonAttributeTypes()getPersonAttributeTypes in interface PersonServicepublic PersonAttributeType getPersonAttributeType(java.lang.Integer typeId)
PersonServicegetPersonAttributeType in interface PersonServicetypeId - PersonAttributeType.personAttributeTypeId to match onPersonService.getPersonAttributeType(java.lang.Integer)public PersonAttribute getPersonAttribute(java.lang.Integer id)
PersonServicegetPersonAttribute in interface PersonServiceid - the PersonAttribute.personAttributeId to match onPersonService.getPersonAttribute(java.lang.Integer)public PersonAttributeType getPersonAttributeType(java.lang.String s)
getPersonAttributeTypeByName(String)getPersonAttributeType in interface PersonServicepublic Relationship getRelationship(java.lang.Integer relationshipId) throws APIException
PersonServicegetRelationship in interface PersonServiceAPIExceptionPersonService.getRelationship(java.lang.Integer)public java.util.List<Relationship> getRelationships() throws APIException
getAllRelationships()getRelationships in interface PersonServiceAPIExceptionpublic java.util.List<Relationship> getRelationships(Person p, boolean showVoided) throws APIException
getRelationshipsByPerson(Person)getRelationships in interface PersonServiceAPIExceptionpublic java.util.List<Relationship> getRelationships(Person p) throws APIException
getRelationshipsByPerson(Person)getRelationships in interface PersonServiceAPIExceptionpublic java.util.List<Relationship> getRelationshipsTo(Person toPerson, RelationshipType relType) throws APIException
getRelationships(Person, Person, RelationshipType)getRelationshipsTo in interface PersonServiceAPIExceptionpublic java.util.List<RelationshipType> getRelationshipTypes() throws APIException
getAllRelationshipTypes()getRelationshipTypes in interface PersonServiceAPIExceptionpublic RelationshipType getRelationshipType(java.lang.Integer relationshipTypeId) throws APIException
PersonServicegetRelationshipType in interface PersonServiceAPIExceptionPersonService.getRelationshipType(java.lang.Integer)public RelationshipType findRelationshipType(java.lang.String relationshipTypeName) throws APIException
getRelationshipTypeByName(String)findRelationshipType in interface PersonServiceAPIExceptionpublic RelationshipType getRelationshipTypeByName(java.lang.String relationshipTypeName) throws APIException
PersonServicegetRelationshipTypeByName in interface PersonServicerelationshipTypeName - name to match onAPIExceptionPersonService.getRelationshipTypeByName(java.lang.String)public void purgePerson(Person person) throws APIException
PersonServicepurgePerson in interface PersonServiceperson - person to be purged from the databaseAPIExceptionPersonService.purgePerson(org.openmrs.Person)public Person savePerson(Person person) throws APIException
PersonServicesavePerson in interface PersonServiceperson - person to be created or updatedAPIExceptionPersonService.savePerson(org.openmrs.Person)public Person createPerson(Person person) throws APIException
savePerson(Person)createPerson in interface PersonServiceAPIExceptionpublic void updatePerson(Person person) throws APIException
savePerson(Person)updatePerson in interface PersonServiceAPIExceptionpublic void deletePerson(Person person) throws APIException
purgePerson(Person)deletePerson in interface PersonServiceAPIExceptionpublic Person voidPerson(Person person, java.lang.String reason) throws APIException
PersonServicevoidPerson in interface PersonServiceperson - person to be voidedreason - reason for voiding personAPIExceptionPersonService.voidPerson(org.openmrs.Person, java.lang.String)public Person unvoidPerson(Person person) throws APIException
PersonServiceunvoidPerson in interface PersonServiceperson - person to be revivedAPIExceptionPersonService.unvoidPerson(org.openmrs.Person)public Person getPerson(java.lang.Integer personId) throws APIException
PersonServicegetPerson in interface PersonServicepersonId - internal identifier of person to getAPIExceptionPersonService.getPerson(java.lang.Integer)public Person getPerson(Patient pat) throws APIException
getPerson(Integer)PersonServicePersonService.getPerson(Integer) passing in pat.getPatientId() or just cast the pat
object to a Person object because Patient is a subclass of Person. (Person)patgetPerson in interface PersonServiceAPIExceptionpublic Person getPerson(User user) throws APIException
getPerson(Integer)PersonServicePersonService.getPerson(Integer) passing in user.getUserId() or just cast the user
object to a Person object because User is a subclass of Person. (Person)usergetPerson in interface PersonServiceAPIExceptionpublic java.util.List<Relationship> getAllRelationships() throws APIException
PersonServicegetAllRelationships in interface PersonServiceAPIExceptionPersonService.getAllRelationships()public java.util.List<Relationship> getAllRelationships(boolean includeVoided) throws APIException
PersonServicegetAllRelationships in interface PersonServiceincludeVoided - true/false whether to include the voided relationshipsAPIExceptionPersonService.getAllRelationships(boolean)public java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType) throws APIException
PersonServicegetRelationships in interface PersonServicefromPerson - (optional) Person to in the person_id columntoPerson - (optional) Person in the relative_id columnrelType - (optional) The RelationshipType to matchAPIExceptionPersonService.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType)public java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, java.util.Date effectiveDate) throws APIException
PersonServicegetRelationships in interface PersonServicefromPerson - (optional) Person to in the person_id columntoPerson - (optional) Person in the relative_id columnrelType - (optional) The RelationshipType to matcheffectiveDate - (optional) The date during which the relationship was effectiveAPIExceptionPersonService.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType, java.util.Date)public java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, java.util.Date startEffectiveDate, java.util.Date endEffectiveDate) throws APIException
PersonServicegetRelationships in interface PersonServicefromPerson - (optional) Person to in the person_id columntoPerson - (optional) Person in the relative_id columnrelType - (optional) The RelationshipType to matchstartEffectiveDate - (optional) The date during which the relationship was effective
(lower bound)endEffectiveDate - (optional) The date during which the relationship was effective
(upper bound)APIExceptionPersonService.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType, java.util.Date, java.util.Date)public java.util.List<Relationship> getRelationshipsByPerson(Person p) throws APIException
PersonServicegetRelationshipsByPerson in interface PersonServicep - person object listed on either side of the relationshipAPIExceptionPersonService.getRelationshipsByPerson(org.openmrs.Person)public java.util.List<Relationship> getRelationshipsByPerson(Person p, java.util.Date effectiveDate) throws APIException
PersonServicegetRelationshipsByPerson in interface PersonServicep - person object listed on either side of the relationshipeffectiveDate - effective date of relationshipAPIExceptionPersonService.getRelationshipsByPerson(org.openmrs.Person,
java.util.Date)public void purgeRelationship(Relationship relationship) throws APIException
PersonServicepurgeRelationship in interface PersonServicerelationship - relationship to be purged from the databaseAPIExceptionPersonService.purgeRelationship(org.openmrs.Relationship)public Relationship saveRelationship(Relationship relationship) throws APIException
PersonServicerelationship to
the databasesaveRelationship in interface PersonServicerelationship - relationship to be created or updatedAPIExceptionPersonService.saveRelationship(org.openmrs.Relationship)public void createRelationship(Relationship relationship) throws APIException
saveRelationship(Relationship)createRelationship in interface PersonServiceAPIExceptionpublic void updateRelationship(Relationship relationship) throws APIException
saveRelationship(Relationship)updateRelationship in interface PersonServiceAPIExceptionpublic void deleteRelationship(Relationship relationship) throws APIException
purgeRelationship(Relationship)deleteRelationship in interface PersonServiceAPIExceptionpublic Relationship voidRelationship(Relationship relationship, java.lang.String voidReason) throws APIException
PersonServicevoidRelationship in interface PersonServicerelationship - Relationship to voidvoidReason - String reason the relationship is being voided.APIExceptionPersonService.voidRelationship(org.openmrs.Relationship,
java.lang.String)public Relationship unvoidRelationship(Relationship relationship) throws APIException
PersonServiceunvoidRelationship in interface PersonServicerelationship - Relationship to unvoidAPIExceptionPersonService.unvoidRelationship(org.openmrs.Relationship)public void createRelationshipType(RelationshipType relationshipType) throws APIException
saveRelationshipType(RelationshipType)createRelationshipType in interface PersonServiceAPIExceptionpublic void updateRelationshipType(RelationshipType relationshipType) throws APIException
saveRelationshipType(RelationshipType)updateRelationshipType in interface PersonServiceAPIExceptionpublic void deleteRelationshipType(RelationshipType relationshipType) throws APIException
purgeRelationshipType(RelationshipType)deleteRelationshipType in interface PersonServiceAPIExceptionpublic java.util.List<RelationshipType> getAllRelationshipTypes() throws APIException
PersonServicegetAllRelationshipTypes in interface PersonServiceAPIExceptionPersonService.getAllRelationshipTypes()public java.util.List<RelationshipType> getRelationshipTypes(java.lang.String searchString) throws APIException
PersonServicegetRelationshipTypes in interface PersonServicesearchString - string to match to a relationship type nameAPIExceptionPersonService.getRelationshipTypes(java.lang.String)public java.util.List<RelationshipType> getRelationshipTypes(java.lang.String relationshipTypeName, java.lang.Boolean preferred) throws APIException
PersonServicegetRelationshipTypes in interface PersonServicerelationshipTypeName - name to match onpreferred - if true, returns on preferred types, if false returns only the nonpreferred
types. if null returns bothAPIExceptionPersonService.getRelationshipTypes(java.lang.String, java.lang.Boolean)public void purgeRelationshipType(RelationshipType relationshipType) throws APIException
PersonServicepurgeRelationshipType in interface PersonServicerelationshipType - relationship type to be purgedAPIExceptionPersonService.purgeRelationshipType(org.openmrs.RelationshipType)public RelationshipType saveRelationshipType(RelationshipType relationshipType) throws APIException
PersonServicesaveRelationshipType in interface PersonServicerelationshipType - type to be created or updatedAPIExceptionPersonService.saveRelationshipType(org.openmrs.RelationshipType)public java.util.List<PersonAttributeType> getPersonAttributeTypes(OpenmrsConstants.PERSON_TYPE personType, PersonService.ATTR_VIEW_TYPE viewType) throws APIException
PersonServicegetPersonAttributeTypes in interface PersonServicepersonType - PERSON, USER, PATIENT, or null. Both PERSON and null mean to return attr
types for both patients and usersviewType - whether this is a listing or viewing or null for both listing and viewingAPIExceptionPersonService.getPersonAttributeTypes(org.openmrs.util.OpenmrsConstants.PERSON_TYPE,
org.openmrs.api.PersonService.ATTR_VIEW_TYPE)public java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String personTypeStr, java.lang.String displayTypeStr) throws APIException
getPersonAttributeTypes in interface PersonServiceAPIExceptionpublic PersonName parsePersonName(java.lang.String name) throws APIException
PersonServiceparsePersonName in interface PersonServicename - person name to be parsedAPIExceptionPersonService.parsePersonName(java.lang.String)public PersonName splitPersonName(java.lang.String name)
PersonServicename string into Given, Middle, and Family parts of a PersonNamesplitPersonName in interface PersonServicePersonService.parsePersonName(String)public PersonName voidPersonName(PersonName personName, java.lang.String voidReason) throws APIException
PersonServicevoidPersonName in interface PersonServicepersonName - PersonName to voidvoidReason - String reason the personName is being voided.APIExceptionPersonService.voidPersonName(org.openmrs.PersonName, String)public PersonName unvoidPersonName(PersonName personName) throws APIException
PersonServiceunvoidPersonName in interface PersonServicepersonName - PersonName to unvoidAPIExceptionPersonService.unvoidPersonName(org.openmrs.PersonName)public PersonName savePersonName(PersonName personName) throws APIException
PersonServicesavePersonName in interface PersonServicepersonName - to be created or updatedAPIExceptionPersonService.savePersonName(org.openmrs.PersonName)public java.util.Map<Person,java.util.List<Person>> getRelationshipMap(RelationshipType relType) throws APIException
PersonServicegetRelationshipMap in interface PersonServicerelType - type of relationship for which to retrieve all relationshipsAPIExceptionPersonService.getRelationshipMap(org.openmrs.RelationshipType)public java.util.Map<Person,java.util.List<Person>> getRelationships(RelationshipType relType) throws APIException
getRelationshipMap(RelationshipType)getRelationships in interface PersonServiceAPIExceptionpublic PersonAttributeType getPersonAttributeTypeByUuid(java.lang.String uuid)
PersonServicegetPersonAttributeTypeByUuid in interface PersonServiceuuid - the universally unique identifier to lookupPersonService.getPersonAttributeTypeByUuid(java.lang.String)public Person getPersonByUuid(java.lang.String uuid) throws APIException
PersonServicegetPersonByUuid in interface PersonServiceAPIExceptionPersonService.getPersonByUuid(java.lang.String)public PersonAddress getPersonAddressByUuid(java.lang.String uuid) throws APIException
PersonServicegetPersonAddressByUuid in interface PersonServiceAPIExceptionpublic PersonAttribute getPersonAttributeByUuid(java.lang.String uuid) throws APIException
PersonServicegetPersonAttributeByUuid in interface PersonServiceAPIExceptionpublic PersonName getPersonName(java.lang.Integer personNameId)
PersonServicegetPersonName in interface PersonServicePersonService.getPersonName(java.lang.Integer)public PersonName getPersonNameByUuid(java.lang.String uuid) throws APIException
PersonServicegetPersonNameByUuid in interface PersonServiceAPIExceptionPersonService.getPersonNameByUuid(java.lang.String)public PersonMergeLog savePersonMergeLog(PersonMergeLog personMergeLog) throws SerializationException, APIException
PersonServicePersonMergeLog.getPersonMergeLogData(), sets the mergedData String,
and the creator and date if null. It then saves the PersonMergeLog object to the
model.savePersonMergeLog in interface PersonServicepersonMergeLog - the PersonMergeLog object to save.PersonMergeLog objectSerializationExceptionAPIExceptionPersonService.savePersonMergeLog(PersonMergeLog)public PersonMergeLog getPersonMergeLogByUuid(java.lang.String uuid, boolean deserialize) throws SerializationException, APIException
PersonServicegetPersonMergeLogByUuid in interface PersonServiceSerializationExceptionAPIExceptionPersonService.getPersonMergeLogByUuid(String, boolean)public java.util.List<PersonMergeLog> getAllPersonMergeLogs(boolean deserialize) throws SerializationException
PersonServicePersonMergeLog objects from the modelgetAllPersonMergeLogs in interface PersonServiceSerializationExceptionPersonService.getAllPersonMergeLogs(boolean)public java.util.List<PersonMergeLog> getWinningPersonMergeLogs(Person person, boolean deserialize) throws SerializationException
PersonServicePersonMergeLog objects by winning person p. Useful for to getting all persons merged into p.getWinningPersonMergeLogs in interface PersonServiceperson - the winning personPersonMergeLog objectsSerializationExceptionorg.openmrs.api.PersonService#getWinningPersonMergeLogs(org.openmrs.Person)public PersonMergeLog getLosingPersonMergeLog(Person person, boolean deserialize) throws SerializationException
PersonServicePersonMergeLog where person p is the loser. Useful for getting the person that p was merged into.getLosingPersonMergeLog in interface PersonServiceperson - the losing personPersonMergeLog objectSerializationExceptionorg.openmrs.api.PersonService#getLosingPersonMergeLog(org.openmrs.Person)public Relationship getRelationshipByUuid(java.lang.String uuid) throws APIException
PersonServicegetRelationshipByUuid in interface PersonServiceAPIExceptionPersonService.getRelationshipByUuid(java.lang.String)public RelationshipType getRelationshipTypeByUuid(java.lang.String uuid) throws APIException
PersonServicegetRelationshipTypeByUuid in interface PersonServiceAPIExceptionPersonService.getRelationshipTypeByUuid(java.lang.String)public java.util.List<RelationshipType> getAllRelationshipTypes(boolean includeRetired) throws APIException
PersonServicegetAllRelationshipTypes in interface PersonServiceincludeRetired - boolean - include retired relationshipTypes as well?APIExceptionPersonService.getAllRelationshipTypes(boolean)public RelationshipType retireRelationshipType(RelationshipType type, java.lang.String retiredReason) throws APIException
PersonServiceretireRelationshipType in interface PersonServiceAPIExceptionPersonService.retireRelationshipType(org.openmrs.RelationshipType,
java.lang.String)public RelationshipType unretireRelationshipType(RelationshipType relationshipType)
PersonServiceunretireRelationshipType in interface PersonServicePersonService.unretireRelationshipType(org.openmrs.RelationshipType)public PersonAddress voidPersonAddress(PersonAddress personAddress, java.lang.String voidReason)
PersonServicevoidPersonAddress in interface PersonServicepersonAddress - PersonAddress to voidvoidReason - String reason the personAddress is being voided.PersonService.voidPersonAddress(org.openmrs.PersonAddress, String)public PersonAddress unvoidPersonAddress(PersonAddress personAddress) throws APIException
PersonServiceunvoidPersonAddress in interface PersonServicepersonAddress - PersonAddress to unvoidAPIExceptionPersonService.unvoidPersonAddress(org.openmrs.PersonAddress)public PersonAddress savePersonAddress(PersonAddress personAddress)
PersonServicesavePersonAddress in interface PersonServicepersonAddress - PersonAddress to be created or updatedPersonService.savePersonAddress(org.openmrs.PersonAddress)Copyright © 2018 OpenMRS Inc.. All Rights Reserved.