@Transactional 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 |
---|---|
void |
checkIfPersonAttributeTypesAreLocked()
Check if the person attribute types are locked, and if they are throws an exception during manipulation of a person attribute type
|
List<PersonAttributeType> |
getAllPersonAttributeTypes()
Get all PersonAttributeTypes in the database
|
List<PersonAttributeType> |
getAllPersonAttributeTypes(boolean includeRetired)
Get all PersonAttributeTypes in the database with the option of including the retired types
|
List<PersonMergeLog> |
getAllPersonMergeLogs(boolean deserialize)
Gets all the
PersonMergeLog objects from the model |
List<Relationship> |
getAllRelationships()
Get list of relationships that are not voided
|
List<Relationship> |
getAllRelationships(boolean includeVoided)
Get list of relationships optionally including the voided ones or not
|
List<RelationshipType> |
getAllRelationshipTypes()
Get all relationshipTypes Includes retired relationship types
|
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. |
List<Person> |
getPeople(String searchPhrase,
Boolean dead)
Find a person matching the searchPhrase search string
|
List<Person> |
getPeople(String searchPhrase,
Boolean dead,
Boolean voided) |
Person |
getPerson(Integer personId)
Gets a person by internal id
|
PersonAddress |
getPersonAddressByUuid(String uuid)
Get PersonAddress by its UUID
|
PersonAttribute |
getPersonAttribute(Integer id)
Get a PersonAttribute from the database with the given PersonAttributeid
|
PersonAttribute |
getPersonAttributeByUuid(String uuid)
Get PersonAttribute by its UUID
|
PersonAttributeType |
getPersonAttributeType(Integer typeId)
Get the PersonAttributeType given the type's PersonAttributeTypeId
|
PersonAttributeType |
getPersonAttributeTypeByName(String typeName)
Get the PersonAttributeType given the type's name
|
PersonAttributeType |
getPersonAttributeTypeByUuid(String uuid)
Gets a person attribute type with the given uuid.
|
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)
|
List<PersonAttributeType> |
getPersonAttributeTypes(String exactName,
String format,
Integer foreignKey,
Boolean searchable)
Find person attribute types matching the given parameters.
|
Person |
getPersonByUuid(String uuid)
Get Person by its UUID
|
PersonMergeLog |
getPersonMergeLogByUuid(String uuid,
boolean deserialize)
Gets a PersonMergeLog object from the model using the UUID identifier.
|
PersonName |
getPersonName(Integer personNameId)
Get PersonName by its personNameId
|
PersonName |
getPersonNameByUuid(String uuid)
Get PersonName by its UUID
|
Relationship |
getRelationship(Integer relationshipId)
Get relationship by internal relationship identifier
|
Relationship |
getRelationshipByUuid(String uuid)
Get Relationship by its UUID
|
Map<Person,List<Person>> |
getRelationshipMap(RelationshipType relType)
Get all relationships for a given type of relationship mapped from the personA to all of the
personB's
|
List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType)
Get relationships stored in the database that
|
List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType,
Date effectiveDate)
Get relationships stored in the database that are active on the passed date
|
List<Relationship> |
getRelationships(Person fromPerson,
Person toPerson,
RelationshipType relType,
Date startEffectiveDate,
Date endEffectiveDate)
Get relationships stored in the database that were active during the specified date range
|
List<Relationship> |
getRelationshipsByPerson(Person p)
Get list of relationships that include Person in person_id or relative_id Does not include
voided relationships
|
List<Relationship> |
getRelationshipsByPerson(Person p,
Date effectiveDate)
Get list of relationships that include Person in person_id or relative_id.
|
RelationshipType |
getRelationshipType(Integer relationshipTypeId)
Get relationshipType by internal identifier
|
RelationshipType |
getRelationshipTypeByName(String relationshipTypeName)
Find relationshipType by exact name match
|
RelationshipType |
getRelationshipTypeByUuid(String uuid)
Gets the relationship type with the given uuid.
|
List<RelationshipType> |
getRelationshipTypes(String searchString)
Get relationshipTypes by searching through the names and loosely matching to the given
searchString
|
List<RelationshipType> |
getRelationshipTypes(String relationshipTypeName,
Boolean preferred)
Find relationshipTypes by exact name match and/or preferred status
|
Set<Person> |
getSimilarPeople(String name,
Integer birthyear,
String gender)
Find a similar person given the attributes.
|
List<PersonMergeLog> |
getWinningPersonMergeLogs(Person person,
boolean deserialize)
Gets
PersonMergeLog objects by winning person p. |
PersonName |
parsePersonName(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,
String retiredReason)
Retire a Person Attribute Type
|
RelationshipType |
retireRelationshipType(RelationshipType type,
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.
|
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
|
Person |
voidPerson(Person person,
String reason)
Effectively removes this person from the system.
|
PersonAddress |
voidPersonAddress(PersonAddress personAddress,
String voidReason)
Voids the given PersonAddress, effectively deleting the personAddress, from the end-user's
point of view.
|
PersonName |
voidPersonName(PersonName personName,
String voidReason)
Voids the given PersonName, effectively deleting the name, from the end-user's point of view.
|
Relationship |
voidRelationship(Relationship relationship,
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)
@Transactional(readOnly=true) public Set<Person> getSimilarPeople(String name, Integer birthyear, 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
- Should accept greater than three names
Should match single search to any name part
Should match two word search to any name part
Should match three word search to any name part
Should match search to familyName2PersonService.getSimilarPeople(java.lang.String, java.lang.Integer,
java.lang.String)
@Transactional(readOnly=true) public List<Person> getPeople(String searchPhrase, 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 List<Person> getPeople(String searchPhrase, Boolean dead, Boolean voided) throws APIException
getPeople
in interface PersonService
APIException
@Transactional(readOnly=true) public List<PersonAttributeType> getAllPersonAttributeTypes() throws APIException
PersonService
getAllPersonAttributeTypes
in interface PersonService
APIException
PersonService.getAllPersonAttributeTypes()
@Transactional(readOnly=true) public List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired) throws APIException
PersonService
getAllPersonAttributeTypes
in interface PersonService
includeRetired
- boolean - include retired attribute types as well?APIException
PersonService.getAllPersonAttributeTypes(boolean)
@Transactional(readOnly=true) public PersonAttributeType getPersonAttributeTypeByName(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
- Should delete person attribute type from database
Should throw an error when trying to delete person attribute type while person attribute types are lockedPersonService.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
- Should set the date created and creator on new
Should set the date changed and changed by on update
Should update any global property which reference this type
Should throw an error when trying to save person attribute type while person attribute types are lockedPersonService.savePersonAttributeType(org.openmrs.PersonAttributeType)
public PersonAttributeType retirePersonAttributeType(PersonAttributeType type, String retiredReason) throws APIException
PersonService
retirePersonAttributeType
in interface PersonService
retiredReason
- Should throw an error when trying to retire person attribute type while person attribute types are lockedAPIException
PersonService.retirePersonAttributeType(PersonAttributeType, String)
@Transactional(readOnly=true) public List<PersonAttributeType> getPersonAttributeTypes(String exactName, String format, Integer foreignKey, 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
- Should return person attribute types matching given parameters
Should return empty list when no person attribute types match given parametersPersonService.getPersonAttributeTypes(java.lang.String,
java.lang.String, java.lang.Integer, java.lang.Boolean)
public void unretirePersonAttributeType(PersonAttributeType type) throws APIException
PersonService
unretirePersonAttributeType
in interface PersonService
type
- type to be restored from the databaseAPIException
- Should restore person attribute type from database
Should throw an error when trying to unretire person attribute type while person attribute types are locked@Transactional(readOnly=true) public PersonAttributeType getPersonAttributeType(Integer typeId)
PersonService
getPersonAttributeType
in interface PersonService
typeId
- PersonAttributeType.personAttributeTypeId to match onPersonService.getPersonAttributeType(java.lang.Integer)
@Transactional(readOnly=true) public PersonAttribute getPersonAttribute(Integer id)
PersonService
getPersonAttribute
in interface PersonService
id
- the PersonAttribute.personAttributeId to match onPersonService.getPersonAttribute(java.lang.Integer)
@Transactional(readOnly=true) public Relationship getRelationship(Integer relationshipId) throws APIException
PersonService
getRelationship
in interface PersonService
APIException
- Should return relationship with given id
Should return null when relationship with given id does not existPersonService.getRelationship(java.lang.Integer)
@Transactional(readOnly=true) public RelationshipType getRelationshipType(Integer relationshipTypeId) throws APIException
PersonService
getRelationshipType
in interface PersonService
APIException
- Should return relationship type with the given relationship type id
Should return null when no relationship type matches given relationship type idPersonService.getRelationshipType(java.lang.Integer)
@Transactional(readOnly=true) public RelationshipType getRelationshipTypeByName(String relationshipTypeName) throws APIException
PersonService
getRelationshipTypeByName
in interface PersonService
relationshipTypeName
- name to match onAPIException
- Should return null when no relationship type match the given namePersonService.getRelationshipTypeByName(java.lang.String)
public void purgePerson(Person person) throws APIException
PersonService
purgePerson
in interface PersonService
person
- person to be purged from the databaseAPIException
- Should delete person from the databasePersonService.purgePerson(org.openmrs.Person)
public Person savePerson(Person person) throws APIException
PersonService
savePerson
in interface PersonService
person
- person to be created or updatedAPIException
- Should create new object when person id is null
Should update existing object when person id is not null
Should set the preferred name and address if none is specified
Should not set the preferred name and address if they already exist
Should not set a voided name or address as preferredPersonService.savePerson(org.openmrs.Person)
public Person voidPerson(Person person, 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)
@Transactional(readOnly=true) public Person getPerson(Integer personId) throws APIException
PersonService
getPerson
in interface PersonService
personId
- internal identifier of person to getAPIException
- Should return null when no person has the given idPersonService.getPerson(java.lang.Integer)
@Transactional(readOnly=true) public List<Relationship> getAllRelationships() throws APIException
PersonService
getAllRelationships
in interface PersonService
APIException
PersonService.getAllRelationships()
@Transactional(readOnly=true) public List<Relationship> getAllRelationships(boolean includeVoided) throws APIException
PersonService
getAllRelationships
in interface PersonService
includeVoided
- true/false whether to include the voided relationshipsAPIException
- Should return all relationship including voided when include voided equals true
Should return all relationship excluding voided when include voided equals falsePersonService.getAllRelationships(boolean)
@Transactional(readOnly=true) public 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
- Should fetch relationships matching the given from person
Should fetch relationships matching the given to person
Should fetch relationships matching the given rel type
Should return empty list when no relationship matching given parameters existPersonService.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType)
@Transactional(readOnly=true) public List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, 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
- Should fetch relationships matching the given from person
Should fetch relationships matching the given to person
Should fetch relationships matching the given rel type
Should return empty list when no relationship matching given parameters exist
Should fetch relationships that were active during effectiveDatePersonService.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType, java.util.Date)
@Transactional(readOnly=true) public List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, Date startEffectiveDate, 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
- Should fetch relationships matching the given from person
Should fetch relationships matching the given to person
Should fetch relationships matching the given rel type
Should return empty list when no relationship matching given parameters exist
Should fetch relationships that were active during the specified date rangePersonService.getRelationships(org.openmrs.Person, org.openmrs.Person,
org.openmrs.RelationshipType, java.util.Date, java.util.Date)
@Transactional(readOnly=true) public List<Relationship> getRelationshipsByPerson(Person p) throws APIException
PersonService
getRelationshipsByPerson
in interface PersonService
p
- person object listed on either side of the relationshipAPIException
- Should only get unvoided relationships
Should fetch relationships associated with the given person
Should fetch unvoided relationships onlyPersonService.getRelationshipsByPerson(org.openmrs.Person)
@Transactional(readOnly=true) public List<Relationship> getRelationshipsByPerson(Person p, Date effectiveDate) throws APIException
PersonService
getRelationshipsByPerson
in interface PersonService
p
- person object listed on either side of the relationshipeffectiveDate
- effective date of relationshipAPIException
- Should only get unvoided relationships
Should only get unvoided relationships regardless of effective date
Should fetch relationships associated with the given person
Should fetch relationships that were active during effectiveDatePersonService.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
- Should delete relationship from the databasePersonService.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
- Should create new object when relationship id is null
Should update existing object when relationship id is not nullPersonService.saveRelationship(org.openmrs.Relationship)
public Relationship voidRelationship(Relationship relationship, String voidReason) throws APIException
PersonService
voidRelationship
in interface PersonService
relationship
- Relationship to voidvoidReason
- String reason the relationship is being voided.APIException
- Should void relationship with the given reasonPersonService.voidRelationship(org.openmrs.Relationship,
java.lang.String)
public Relationship unvoidRelationship(Relationship relationship) throws APIException
PersonService
unvoidRelationship
in interface PersonService
relationship
- Relationship to unvoidAPIException
- Should unvoid voided relationshipPersonService.unvoidRelationship(org.openmrs.Relationship)
@Transactional(readOnly=true) public List<RelationshipType> getAllRelationshipTypes() throws APIException
PersonService
getAllRelationshipTypes
in interface PersonService
APIException
- Should return all relationship typesPersonService.getAllRelationshipTypes()
@Transactional(readOnly=true) public List<RelationshipType> getRelationshipTypes(String searchString) throws APIException
PersonService
getRelationshipTypes
in interface PersonService
searchString
- string to match to a relationship type nameAPIException
- Should return empty list when no relationship type match the search stringPersonService.getRelationshipTypes(java.lang.String)
@Transactional(readOnly=true) public List<RelationshipType> getRelationshipTypes(String relationshipTypeName, 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
- Should return list of preferred relationship type matching given name
Should return empty list when no preferred relationship type match the given namePersonService.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
- Should delete relationship type from the databasePersonService.purgeRelationshipType(org.openmrs.RelationshipType)
public RelationshipType saveRelationshipType(RelationshipType relationshipType) throws APIException
PersonService
saveRelationshipType
in interface PersonService
relationshipType
- type to be created or updatedAPIException
- Should create new object when relationship type id is null
Should update existing object when relationship type id is not null
Should fail if the description is not specifiedPersonService.saveRelationshipType(org.openmrs.RelationshipType)
@Transactional(readOnly=true) public 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 PersonName parsePersonName(String name) throws APIException
PersonService
parsePersonName
in interface PersonService
name
- person name to be parsedAPIException
PersonService.parsePersonName(java.lang.String)
public PersonName voidPersonName(PersonName personName, String voidReason) throws APIException
PersonService
voidPersonName
in interface PersonService
personName
- PersonName to voidvoidReason
- String reason the personName is being voided.APIException
- Should void personName with the given reasonPersonService.voidPersonName(org.openmrs.PersonName, String)
public PersonName unvoidPersonName(PersonName personName) throws APIException
PersonService
unvoidPersonName
in interface PersonService
personName
- PersonName to unvoidAPIException
- Should unvoid voided personNamePersonService.unvoidPersonName(org.openmrs.PersonName)
public PersonName savePersonName(PersonName personName) throws APIException
PersonService
savePersonName
in interface PersonService
personName
- to be created or updatedAPIException
- Should fail if you try to void the last non voided namePersonService.savePersonName(org.openmrs.PersonName)
@Transactional(readOnly=true) public Map<Person,List<Person>> getRelationshipMap(RelationshipType relType) throws APIException
PersonService
getRelationshipMap
in interface PersonService
relType
- type of relationship for which to retrieve all relationshipsAPIException
- Should return empty map when no relationship has the matching relationship typePersonService.getRelationshipMap(org.openmrs.RelationshipType)
@Transactional(readOnly=true) public PersonAttributeType getPersonAttributeTypeByUuid(String uuid)
PersonService
getPersonAttributeTypeByUuid
in interface PersonService
uuid
- the universally unique identifier to lookupPersonService.getPersonAttributeTypeByUuid(java.lang.String)
@Transactional(readOnly=true) public Person getPersonByUuid(String uuid) throws APIException
PersonService
getPersonByUuid
in interface PersonService
APIException
PersonService.getPersonByUuid(java.lang.String)
@Transactional(readOnly=true) public PersonAddress getPersonAddressByUuid(String uuid) throws APIException
PersonService
getPersonAddressByUuid
in interface PersonService
APIException
@Transactional(readOnly=true) public PersonAttribute getPersonAttributeByUuid(String uuid) throws APIException
PersonService
getPersonAttributeByUuid
in interface PersonService
APIException
@Transactional(readOnly=true) public PersonName getPersonName(Integer personNameId)
PersonService
getPersonName
in interface PersonService
PersonService.getPersonName(java.lang.Integer)
@Transactional(readOnly=true) public PersonName getPersonNameByUuid(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)
@Transactional(readOnly=true) public PersonMergeLog getPersonMergeLogByUuid(String uuid, boolean deserialize) throws SerializationException, APIException
PersonService
getPersonMergeLogByUuid
in interface PersonService
SerializationException
APIException
- Should require uuid
Should retrieve personMergeLog without deserializing data
Should retrieve personMergeLog and deserialize dataPersonService.getPersonMergeLogByUuid(String, boolean)
@Transactional(readOnly=true) public List<PersonMergeLog> getAllPersonMergeLogs(boolean deserialize) throws SerializationException
PersonService
PersonMergeLog
objects from the modelgetAllPersonMergeLogs
in interface PersonService
SerializationException
- Should retrieve all PersonMergeLogs from the model
Should retrieve all PersonMergeLogs and deserialize themPersonService.getAllPersonMergeLogs(boolean)
@Transactional(readOnly=true) public 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
- Should retrieve PersonMergeLogs by winnerPersonService.getWinningPersonMergeLogs(Person, boolean)
@Transactional(readOnly=true) 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
- Should find PersonMergeLog by loserPersonService.getLosingPersonMergeLog(Person, boolean)
@Transactional(readOnly=true) public Relationship getRelationshipByUuid(String uuid) throws APIException
PersonService
getRelationshipByUuid
in interface PersonService
APIException
PersonService.getRelationshipByUuid(java.lang.String)
@Transactional(readOnly=true) public RelationshipType getRelationshipTypeByUuid(String uuid) throws APIException
PersonService
getRelationshipTypeByUuid
in interface PersonService
APIException
- Should find object given valid uuid
Should return null if no object found with given uuidPersonService.getRelationshipTypeByUuid(java.lang.String)
@Transactional(readOnly=true) public 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, 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
relationshipType
- retiredReasonPersonService.unretireRelationshipType(org.openmrs.RelationshipType)
public PersonAddress voidPersonAddress(PersonAddress personAddress, 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
- Should unvoid voided personAddressPersonService.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)
public void checkIfPersonAttributeTypesAreLocked()
PersonService
checkIfPersonAttributeTypesAreLocked
in interface PersonService
Copyright © 2024 OpenMRS Inc.. All rights reserved.