@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, 
ContextPersonService.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  PersonMergeLogobjects 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  PersonMergeLogwhere 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  PersonMergeLogobjects 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, 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)@Transactional(readOnly=true) public Set<Person> getSimilarPeople(String name, Integer birthyear, 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")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
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 List<Person> getPeople(String searchPhrase, Boolean dead, Boolean voided) throws APIException
getPeople in interface PersonServiceAPIException@Transactional(readOnly=true) public List<PersonAttributeType> getAllPersonAttributeTypes() throws APIException
PersonServicegetAllPersonAttributeTypes in interface PersonServiceAPIExceptionPersonService.getAllPersonAttributeTypes()@Transactional(readOnly=true) public List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired) throws APIException
PersonServicegetAllPersonAttributeTypes in interface PersonServiceincludeRetired - boolean - include retired attribute types as well?APIExceptionPersonService.getAllPersonAttributeTypes(boolean)@Transactional(readOnly=true) public PersonAttributeType getPersonAttributeTypeByName(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 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
PersonServiceOpenmrsConstants.GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES and reference this given
 type, prior to saving this given type. savePersonAttributeType in interface PersonServiceAPIException - 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
PersonServiceretirePersonAttributeType in interface PersonServiceretiredReason - Should throw an error when trying to retire person attribute type while person attribute types are lockedAPIExceptionPersonService.retirePersonAttributeType(PersonAttributeType, String)@Transactional(readOnly=true) public List<PersonAttributeType> getPersonAttributeTypes(String exactName, String format, Integer foreignKey, 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 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
PersonServiceunretirePersonAttributeType in interface PersonServicetype - 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)
PersonServicegetPersonAttributeType in interface PersonServicetypeId - PersonAttributeType.personAttributeTypeId to match onPersonService.getPersonAttributeType(java.lang.Integer)@Transactional(readOnly=true) public PersonAttribute getPersonAttribute(Integer id)
PersonServicegetPersonAttribute in interface PersonServiceid - the PersonAttribute.personAttributeId to match onPersonService.getPersonAttribute(java.lang.Integer)@Transactional(readOnly=true) public Relationship getRelationship(Integer relationshipId) throws APIException
PersonServicegetRelationship in interface PersonServiceAPIException - 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
PersonServicegetRelationshipType in interface PersonServiceAPIException - 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
PersonServicegetRelationshipTypeByName in interface PersonServicerelationshipTypeName - 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
PersonServicepurgePerson in interface PersonServiceperson - person to be purged from the databaseAPIException - Should delete person from the databasePersonService.purgePerson(org.openmrs.Person)public Person savePerson(Person person) throws APIException
PersonServicesavePerson in interface PersonServiceperson - 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
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)@Transactional(readOnly=true) public Person getPerson(Integer personId) throws APIException
PersonServicegetPerson in interface PersonServicepersonId - 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
PersonServicegetAllRelationships in interface PersonServiceAPIExceptionPersonService.getAllRelationships()@Transactional(readOnly=true) public List<Relationship> getAllRelationships(boolean includeVoided) throws APIException
PersonServicegetAllRelationships in interface PersonServiceincludeVoided - 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
PersonServicegetRelationships in interface PersonServicefromPerson - (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
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 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
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)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
PersonServicegetRelationshipsByPerson in interface PersonServicep - 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
PersonServicegetRelationshipsByPerson in interface PersonServicep - 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
PersonServicepurgeRelationship in interface PersonServicerelationship - relationship to be purged from the databaseAPIException - Should delete relationship from the databasePersonService.purgeRelationship(org.openmrs.Relationship)public Relationship saveRelationship(Relationship relationship) throws APIException
PersonServicerelationship to
 the databasesaveRelationship in interface PersonServicerelationship - 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
PersonServicevoidRelationship in interface PersonServicerelationship - 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
PersonServiceunvoidRelationship in interface PersonServicerelationship - Relationship to unvoidAPIException - Should unvoid voided relationshipPersonService.unvoidRelationship(org.openmrs.Relationship)@Transactional(readOnly=true) public List<RelationshipType> getAllRelationshipTypes() throws APIException
PersonServicegetAllRelationshipTypes in interface PersonServiceAPIException - Should return all relationship typesPersonService.getAllRelationshipTypes()@Transactional(readOnly=true) public List<RelationshipType> getRelationshipTypes(String searchString) throws APIException
PersonServicegetRelationshipTypes in interface PersonServicesearchString - 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
PersonServicegetRelationshipTypes in interface PersonServicerelationshipTypeName - 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
PersonServicepurgeRelationshipType in interface PersonServicerelationshipType - relationship type to be purgedAPIException - Should delete relationship type from the databasePersonService.purgeRelationshipType(org.openmrs.RelationshipType)public RelationshipType saveRelationshipType(RelationshipType relationshipType) throws APIException
PersonServicesaveRelationshipType in interface PersonServicerelationshipType - 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
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 PersonName parsePersonName(String name) throws APIException
PersonServiceparsePersonName in interface PersonServicename - person name to be parsedAPIExceptionPersonService.parsePersonName(java.lang.String)public PersonName voidPersonName(PersonName personName, String voidReason) throws APIException
PersonServicevoidPersonName in interface PersonServicepersonName - 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
PersonServiceunvoidPersonName in interface PersonServicepersonName - PersonName to unvoidAPIException - Should unvoid voided personNamePersonService.unvoidPersonName(org.openmrs.PersonName)public PersonName savePersonName(PersonName personName) throws APIException
PersonServicesavePersonName in interface PersonServicepersonName - 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
PersonServicegetRelationshipMap in interface PersonServicerelType - 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)
PersonServicegetPersonAttributeTypeByUuid in interface PersonServiceuuid - the universally unique identifier to lookupPersonService.getPersonAttributeTypeByUuid(java.lang.String)@Transactional(readOnly=true) public Person getPersonByUuid(String uuid) throws APIException
PersonServicegetPersonByUuid in interface PersonServiceAPIExceptionPersonService.getPersonByUuid(java.lang.String)@Transactional(readOnly=true) public PersonAddress getPersonAddressByUuid(String uuid) throws APIException
PersonServicegetPersonAddressByUuid in interface PersonServiceAPIException@Transactional(readOnly=true) public PersonAttribute getPersonAttributeByUuid(String uuid) throws APIException
PersonServicegetPersonAttributeByUuid in interface PersonServiceAPIException@Transactional(readOnly=true) public PersonName getPersonName(Integer personNameId)
PersonServicegetPersonName in interface PersonServicePersonService.getPersonName(java.lang.Integer)@Transactional(readOnly=true) public PersonName getPersonNameByUuid(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)@Transactional(readOnly=true) public PersonMergeLog getPersonMergeLogByUuid(String uuid, boolean deserialize) throws SerializationException, APIException
PersonServicegetPersonMergeLogByUuid in interface PersonServiceSerializationExceptionAPIException - 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
PersonServicePersonMergeLog objects from the modelgetAllPersonMergeLogs in interface PersonServiceSerializationException - 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
PersonServicePersonMergeLog objects by winning person p. Useful for to getting all persons merged into p.getWinningPersonMergeLogs in interface PersonServiceperson - the winning personPersonMergeLog objectsSerializationException - Should retrieve PersonMergeLogs by winnerPersonService.getWinningPersonMergeLogs(Person, boolean)@Transactional(readOnly=true) 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 objectSerializationException - Should find PersonMergeLog by loserPersonService.getLosingPersonMergeLog(Person, boolean)@Transactional(readOnly=true) public Relationship getRelationshipByUuid(String uuid) throws APIException
PersonServicegetRelationshipByUuid in interface PersonServiceAPIExceptionPersonService.getRelationshipByUuid(java.lang.String)@Transactional(readOnly=true) public RelationshipType getRelationshipTypeByUuid(String uuid) throws APIException
PersonServicegetRelationshipTypeByUuid in interface PersonServiceAPIException - 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
PersonServicegetAllRelationshipTypes in interface PersonServiceincludeRetired - boolean - include retired relationshipTypes as well?APIExceptionPersonService.getAllRelationshipTypes(boolean)public RelationshipType retireRelationshipType(RelationshipType type, String retiredReason) throws APIException
PersonServiceretireRelationshipType in interface PersonServiceAPIExceptionPersonService.retireRelationshipType(org.openmrs.RelationshipType,
      java.lang.String)public RelationshipType unretireRelationshipType(RelationshipType relationshipType)
PersonServiceunretireRelationshipType in interface PersonServicerelationshipType - retiredReasonPersonService.unretireRelationshipType(org.openmrs.RelationshipType)public PersonAddress voidPersonAddress(PersonAddress personAddress, 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 unvoidAPIException - Should unvoid voided personAddressPersonService.unvoidPersonAddress(org.openmrs.PersonAddress)public PersonAddress savePersonAddress(PersonAddress personAddress)
PersonServicesavePersonAddress in interface PersonServicepersonAddress - PersonAddress to be created or updatedPersonService.savePersonAddress(org.openmrs.PersonAddress)public void checkIfPersonAttributeTypesAreLocked()
PersonServicecheckIfPersonAttributeTypesAreLocked in interface PersonServiceCopyright © 2024 OpenMRS Inc.. All rights reserved.