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
,
Context
PersonService.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, onStartup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onShutdown, onStartup
public void setPersonDAO(PersonDAO dao)
PersonService
setPersonDAO
in interface PersonService
dao
- 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
PersonService
nameSearch
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 PersonService
name
- 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")APIException
PersonService.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)
PersonService
getSimilarPeople
in interface PersonService
nameSearch
- 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 returnedAPIException
PersonService.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
PersonService
getPeople
in interface PersonService
searchPhrase
- person name to match ondead
- if true will return only dead patients, if false will return only alive patients,
if null will return bothAPIException
PersonService.getPeople(String, Boolean)
public java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided)
getPeople(String, Boolean)
findPeople
in interface PersonService
public java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided, java.lang.String roles)
getPeople(String, Boolean)
findPeople
in interface PersonService
public java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided, java.util.List<java.lang.String> roles)
getPeople(String, Boolean)
findPeople
in interface PersonService
public java.util.List<PersonAttributeType> getAllPersonAttributeTypes() throws APIException
PersonService
getAllPersonAttributeTypes
in interface PersonService
APIException
PersonService.getAllPersonAttributeTypes()
public java.util.List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired) throws APIException
PersonService
getAllPersonAttributeTypes
in interface PersonService
includeRetired
- boolean - include retired attribute types as well?APIException
PersonService.getAllPersonAttributeTypes(boolean)
public PersonAttributeType getPersonAttributeTypeByName(java.lang.String typeName) throws APIException
PersonService
getPersonAttributeTypeByName
in interface PersonService
APIException
PersonService.getPersonAttributeTypeByName(java.lang.String)
public void purgePersonAttributeType(PersonAttributeType type) throws APIException
PersonService
purgePersonAttributeType
in interface PersonService
type
- type to be purged from the databaseAPIException
PersonService.purgePersonAttributeType(org.openmrs.PersonAttributeType)
public PersonAttributeType savePersonAttributeType(PersonAttributeType type) throws APIException
PersonService
OpenmrsConstants.GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES
and reference this given
type, prior to saving this given type. savePersonAttributeType
in interface PersonService
APIException
PersonService.savePersonAttributeType(org.openmrs.PersonAttributeType)
public PersonAttributeType retirePersonAttributeType(PersonAttributeType type, java.lang.String retiredReason) throws APIException
PersonService
retirePersonAttributeType
in interface PersonService
APIException
org.openmrs.api.PersonService#retirePersonAttributeType(org.openmrs.PersonAttributeType)
public void createPersonAttributeType(PersonAttributeType type) throws APIException
savePersonAttributeType(PersonAttributeType)
createPersonAttributeType
in interface PersonService
APIException
public void updatePersonAttributeType(PersonAttributeType type) throws APIException
savePersonAttributeType(PersonAttributeType)
updatePersonAttributeType
in interface PersonService
APIException
public java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String exactName, java.lang.String format, java.lang.Integer foreignKey, java.lang.Boolean searchable) throws APIException
PersonService
getPersonAttributeTypes
in interface PersonService
exactName
- (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 allAPIException
PersonService.getPersonAttributeTypes(java.lang.String,
java.lang.String, java.lang.Integer, java.lang.Boolean)
public void deletePersonAttributeType(java.lang.Integer attrTypeId)
purgePersonAttributeType(PersonAttributeType)
PersonService
deletePersonAttributeType
in interface PersonService
public void deletePersonAttributeType(PersonAttributeType type)
purgePersonAttributeType(PersonAttributeType)
deletePersonAttributeType
in interface PersonService
public void unretirePersonAttributeType(PersonAttributeType type) throws APIException
PersonService
unretirePersonAttributeType
in interface PersonService
type
- type to be restored from the databaseAPIException
public java.util.List<PersonAttributeType> getPersonAttributeTypes()
getAllPersonAttributeTypes()
getPersonAttributeTypes
in interface PersonService
public PersonAttributeType getPersonAttributeType(java.lang.Integer typeId)
PersonService
getPersonAttributeType
in interface PersonService
typeId
- PersonAttributeType.personAttributeTypeId to match onPersonService.getPersonAttributeType(java.lang.Integer)
public PersonAttribute getPersonAttribute(java.lang.Integer id)
PersonService
getPersonAttribute
in interface PersonService
id
- the PersonAttribute.personAttributeId to match onPersonService.getPersonAttribute(java.lang.Integer)
public PersonAttributeType getPersonAttributeType(java.lang.String s)
getPersonAttributeTypeByName(String)
getPersonAttributeType
in interface PersonService
public Relationship getRelationship(java.lang.Integer relationshipId) throws APIException
PersonService
getRelationship
in interface PersonService
APIException
PersonService.getRelationship(java.lang.Integer)
public java.util.List<Relationship> getRelationships() throws APIException
getAllRelationships()
getRelationships
in interface PersonService
APIException
public java.util.List<Relationship> getRelationships(Person p, boolean showVoided) throws APIException
getRelationshipsByPerson(Person)
getRelationships
in interface PersonService
APIException
public java.util.List<Relationship> getRelationships(Person p) throws APIException
getRelationshipsByPerson(Person)
getRelationships
in interface PersonService
APIException
public java.util.List<Relationship> getRelationshipsTo(Person toPerson, RelationshipType relType) throws APIException
getRelationships(Person, Person, RelationshipType)
getRelationshipsTo
in interface PersonService
APIException
public java.util.List<RelationshipType> getRelationshipTypes() throws APIException
getAllRelationshipTypes()
getRelationshipTypes
in interface PersonService
APIException
public RelationshipType getRelationshipType(java.lang.Integer relationshipTypeId) throws APIException
PersonService
getRelationshipType
in interface PersonService
APIException
PersonService.getRelationshipType(java.lang.Integer)
public RelationshipType findRelationshipType(java.lang.String relationshipTypeName) throws APIException
getRelationshipTypeByName(String)
findRelationshipType
in interface PersonService
APIException
public RelationshipType getRelationshipTypeByName(java.lang.String relationshipTypeName) throws APIException
PersonService
getRelationshipTypeByName
in interface PersonService
relationshipTypeName
- name to match onAPIException
PersonService.getRelationshipTypeByName(java.lang.String)
public void purgePerson(Person person) throws APIException
PersonService
purgePerson
in interface PersonService
person
- person to be purged from the databaseAPIException
PersonService.purgePerson(org.openmrs.Person)
public Person savePerson(Person person) throws APIException
PersonService
savePerson
in interface PersonService
person
- person to be created or updatedAPIException
PersonService.savePerson(org.openmrs.Person)
public Person createPerson(Person person) throws APIException
savePerson(Person)
createPerson
in interface PersonService
APIException
public void updatePerson(Person person) throws APIException
savePerson(Person)
updatePerson
in interface PersonService
APIException
public void deletePerson(Person person) throws APIException
purgePerson(Person)
deletePerson
in interface PersonService
APIException
public Person voidPerson(Person person, java.lang.String reason) throws APIException
PersonService
voidPerson
in interface PersonService
person
- person to be voidedreason
- reason for voiding personAPIException
PersonService.voidPerson(org.openmrs.Person, java.lang.String)
public Person unvoidPerson(Person person) throws APIException
PersonService
unvoidPerson
in interface PersonService
person
- person to be revivedAPIException
PersonService.unvoidPerson(org.openmrs.Person)
public Person getPerson(java.lang.Integer personId) throws APIException
PersonService
getPerson
in interface PersonService
personId
- internal identifier of person to getAPIException
PersonService.getPerson(java.lang.Integer)
public Person getPerson(Patient pat) throws APIException
getPerson(Integer)
PersonService
PersonService.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 PersonService
APIException
public Person getPerson(User user) throws APIException
getPerson(Integer)
PersonService
PersonService.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 PersonService
APIException
public java.util.List<Relationship> getAllRelationships() throws APIException
PersonService
getAllRelationships
in interface PersonService
APIException
PersonService.getAllRelationships()
public java.util.List<Relationship> getAllRelationships(boolean includeVoided) throws APIException
PersonService
getAllRelationships
in interface PersonService
includeVoided
- true/false whether to include the voided relationshipsAPIException
PersonService.getAllRelationships(boolean)
public java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType) throws APIException
PersonService
getRelationships
in interface PersonService
fromPerson
- (optional) Person to in the person_id columntoPerson
- (optional) Person in the relative_id columnrelType
- (optional) The RelationshipType to matchAPIException
PersonService.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
PersonService
getRelationships
in interface PersonService
fromPerson
- (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 effectiveAPIException
PersonService.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
PersonService
getRelationships
in interface PersonService
fromPerson
- (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)APIException
PersonService.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
PersonService
getRelationshipsByPerson
in interface PersonService
p
- person object listed on either side of the relationshipAPIException
PersonService.getRelationshipsByPerson(org.openmrs.Person)
public java.util.List<Relationship> getRelationshipsByPerson(Person p, java.util.Date effectiveDate) throws APIException
PersonService
getRelationshipsByPerson
in interface PersonService
p
- person object listed on either side of the relationshipeffectiveDate
- effective date of relationshipAPIException
PersonService.getRelationshipsByPerson(org.openmrs.Person,
java.util.Date)
public void purgeRelationship(Relationship relationship) throws APIException
PersonService
purgeRelationship
in interface PersonService
relationship
- relationship to be purged from the databaseAPIException
PersonService.purgeRelationship(org.openmrs.Relationship)
public Relationship saveRelationship(Relationship relationship) throws APIException
PersonService
relationship
to
the databasesaveRelationship
in interface PersonService
relationship
- relationship to be created or updatedAPIException
PersonService.saveRelationship(org.openmrs.Relationship)
public void createRelationship(Relationship relationship) throws APIException
saveRelationship(Relationship)
createRelationship
in interface PersonService
APIException
public void updateRelationship(Relationship relationship) throws APIException
saveRelationship(Relationship)
updateRelationship
in interface PersonService
APIException
public void deleteRelationship(Relationship relationship) throws APIException
purgeRelationship(Relationship)
deleteRelationship
in interface PersonService
APIException
public Relationship voidRelationship(Relationship relationship, java.lang.String voidReason) throws APIException
PersonService
voidRelationship
in interface PersonService
relationship
- Relationship to voidvoidReason
- String reason the relationship is being voided.APIException
PersonService.voidRelationship(org.openmrs.Relationship,
java.lang.String)
public Relationship unvoidRelationship(Relationship relationship) throws APIException
PersonService
unvoidRelationship
in interface PersonService
relationship
- Relationship to unvoidAPIException
PersonService.unvoidRelationship(org.openmrs.Relationship)
public void createRelationshipType(RelationshipType relationshipType) throws APIException
saveRelationshipType(RelationshipType)
createRelationshipType
in interface PersonService
APIException
public void updateRelationshipType(RelationshipType relationshipType) throws APIException
saveRelationshipType(RelationshipType)
updateRelationshipType
in interface PersonService
APIException
public void deleteRelationshipType(RelationshipType relationshipType) throws APIException
purgeRelationshipType(RelationshipType)
deleteRelationshipType
in interface PersonService
APIException
public java.util.List<RelationshipType> getAllRelationshipTypes() throws APIException
PersonService
getAllRelationshipTypes
in interface PersonService
APIException
PersonService.getAllRelationshipTypes()
public java.util.List<RelationshipType> getRelationshipTypes(java.lang.String searchString) throws APIException
PersonService
getRelationshipTypes
in interface PersonService
searchString
- string to match to a relationship type nameAPIException
PersonService.getRelationshipTypes(java.lang.String)
public java.util.List<RelationshipType> getRelationshipTypes(java.lang.String relationshipTypeName, java.lang.Boolean preferred) throws APIException
PersonService
getRelationshipTypes
in interface PersonService
relationshipTypeName
- name to match onpreferred
- if true, returns on preferred types, if false returns only the nonpreferred
types. if null returns bothAPIException
PersonService.getRelationshipTypes(java.lang.String, java.lang.Boolean)
public void purgeRelationshipType(RelationshipType relationshipType) throws APIException
PersonService
purgeRelationshipType
in interface PersonService
relationshipType
- relationship type to be purgedAPIException
PersonService.purgeRelationshipType(org.openmrs.RelationshipType)
public RelationshipType saveRelationshipType(RelationshipType relationshipType) throws APIException
PersonService
saveRelationshipType
in interface PersonService
relationshipType
- type to be created or updatedAPIException
PersonService.saveRelationshipType(org.openmrs.RelationshipType)
public java.util.List<PersonAttributeType> getPersonAttributeTypes(OpenmrsConstants.PERSON_TYPE personType, PersonService.ATTR_VIEW_TYPE viewType) throws APIException
PersonService
getPersonAttributeTypes
in interface PersonService
personType
- 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 viewingAPIException
PersonService.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 PersonService
APIException
public PersonName parsePersonName(java.lang.String name) throws APIException
PersonService
parsePersonName
in interface PersonService
name
- person name to be parsedAPIException
PersonService.parsePersonName(java.lang.String)
public PersonName splitPersonName(java.lang.String name)
PersonService
name
string into Given, Middle, and Family parts of a PersonNamesplitPersonName
in interface PersonService
PersonService.parsePersonName(String)
public PersonName voidPersonName(PersonName personName, java.lang.String voidReason) throws APIException
PersonService
voidPersonName
in interface PersonService
personName
- PersonName to voidvoidReason
- String reason the personName is being voided.APIException
PersonService.voidPersonName(org.openmrs.PersonName, String)
public PersonName unvoidPersonName(PersonName personName) throws APIException
PersonService
unvoidPersonName
in interface PersonService
personName
- PersonName to unvoidAPIException
PersonService.unvoidPersonName(org.openmrs.PersonName)
public PersonName savePersonName(PersonName personName) throws APIException
PersonService
savePersonName
in interface PersonService
personName
- to be created or updatedAPIException
PersonService.savePersonName(org.openmrs.PersonName)
public java.util.Map<Person,java.util.List<Person>> getRelationshipMap(RelationshipType relType) throws APIException
PersonService
getRelationshipMap
in interface PersonService
relType
- type of relationship for which to retrieve all relationshipsAPIException
PersonService.getRelationshipMap(org.openmrs.RelationshipType)
public java.util.Map<Person,java.util.List<Person>> getRelationships(RelationshipType relType) throws APIException
getRelationshipMap(RelationshipType)
getRelationships
in interface PersonService
APIException
public PersonAttributeType getPersonAttributeTypeByUuid(java.lang.String uuid)
PersonService
getPersonAttributeTypeByUuid
in interface PersonService
uuid
- the universally unique identifier to lookupPersonService.getPersonAttributeTypeByUuid(java.lang.String)
public Person getPersonByUuid(java.lang.String uuid) throws APIException
PersonService
getPersonByUuid
in interface PersonService
APIException
PersonService.getPersonByUuid(java.lang.String)
public PersonAddress getPersonAddressByUuid(java.lang.String uuid) throws APIException
PersonService
getPersonAddressByUuid
in interface PersonService
APIException
public PersonAttribute getPersonAttributeByUuid(java.lang.String uuid) throws APIException
PersonService
getPersonAttributeByUuid
in interface PersonService
APIException
public PersonName getPersonName(java.lang.Integer personNameId)
PersonService
getPersonName
in interface PersonService
PersonService.getPersonName(java.lang.Integer)
public PersonName getPersonNameByUuid(java.lang.String uuid) throws APIException
PersonService
getPersonNameByUuid
in interface PersonService
APIException
PersonService.getPersonNameByUuid(java.lang.String)
public PersonMergeLog savePersonMergeLog(PersonMergeLog personMergeLog) throws SerializationException, APIException
PersonService
PersonMergeLog.getPersonMergeLogData()
, sets the mergedData String,
and the creator and date if null. It then saves the PersonMergeLog
object to the
model.savePersonMergeLog
in interface PersonService
personMergeLog
- the PersonMergeLog
object to save.PersonMergeLog
objectSerializationException
APIException
PersonService.savePersonMergeLog(PersonMergeLog)
public PersonMergeLog getPersonMergeLogByUuid(java.lang.String uuid, boolean deserialize) throws SerializationException, APIException
PersonService
getPersonMergeLogByUuid
in interface PersonService
SerializationException
APIException
PersonService.getPersonMergeLogByUuid(String, boolean)
public java.util.List<PersonMergeLog> getAllPersonMergeLogs(boolean deserialize) throws SerializationException
PersonService
PersonMergeLog
objects from the modelgetAllPersonMergeLogs
in interface PersonService
SerializationException
PersonService.getAllPersonMergeLogs(boolean)
public java.util.List<PersonMergeLog> getWinningPersonMergeLogs(Person person, boolean deserialize) throws SerializationException
PersonService
PersonMergeLog
objects by winning person p. Useful for to getting all persons merged into p.getWinningPersonMergeLogs
in interface PersonService
person
- the winning personPersonMergeLog
objectsSerializationException
org.openmrs.api.PersonService#getWinningPersonMergeLogs(org.openmrs.Person)
public PersonMergeLog getLosingPersonMergeLog(Person person, boolean deserialize) throws SerializationException
PersonService
PersonMergeLog
where person p is the loser. Useful for getting the person that p was merged into.getLosingPersonMergeLog
in interface PersonService
person
- the losing personPersonMergeLog
objectSerializationException
org.openmrs.api.PersonService#getLosingPersonMergeLog(org.openmrs.Person)
public Relationship getRelationshipByUuid(java.lang.String uuid) throws APIException
PersonService
getRelationshipByUuid
in interface PersonService
APIException
PersonService.getRelationshipByUuid(java.lang.String)
public RelationshipType getRelationshipTypeByUuid(java.lang.String uuid) throws APIException
PersonService
getRelationshipTypeByUuid
in interface PersonService
APIException
PersonService.getRelationshipTypeByUuid(java.lang.String)
public java.util.List<RelationshipType> getAllRelationshipTypes(boolean includeRetired) throws APIException
PersonService
getAllRelationshipTypes
in interface PersonService
includeRetired
- boolean - include retired relationshipTypes as well?APIException
PersonService.getAllRelationshipTypes(boolean)
public RelationshipType retireRelationshipType(RelationshipType type, java.lang.String retiredReason) throws APIException
PersonService
retireRelationshipType
in interface PersonService
APIException
PersonService.retireRelationshipType(org.openmrs.RelationshipType,
java.lang.String)
public RelationshipType unretireRelationshipType(RelationshipType relationshipType)
PersonService
unretireRelationshipType
in interface PersonService
PersonService.unretireRelationshipType(org.openmrs.RelationshipType)
public PersonAddress voidPersonAddress(PersonAddress personAddress, java.lang.String voidReason)
PersonService
voidPersonAddress
in interface PersonService
personAddress
- PersonAddress to voidvoidReason
- String reason the personAddress is being voided.PersonService.voidPersonAddress(org.openmrs.PersonAddress, String)
public PersonAddress unvoidPersonAddress(PersonAddress personAddress) throws APIException
PersonService
unvoidPersonAddress
in interface PersonService
personAddress
- PersonAddress to unvoidAPIException
PersonService.unvoidPersonAddress(org.openmrs.PersonAddress)
public PersonAddress savePersonAddress(PersonAddress personAddress)
PersonService
savePersonAddress
in interface PersonService
personAddress
- PersonAddress to be created or updatedPersonService.savePersonAddress(org.openmrs.PersonAddress)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.