org.openmrs.api.db
Interface PersonDAO

All Known Implementing Classes:
HibernatePersonDAO

public interface PersonDAO

Person-related database functions

This is used by the PersonService. This should not be used directly, but rather used through the methods on the PersonService.

Use case: PersonService ps = Context.getPersonService(); ps....

See Also:
PersonService, Context

Method Summary
 void deletePerson(Person person)
           
 void deletePersonAttributeType(PersonAttributeType type)
           
 void deleteRelationship(Relationship relationship)
           
 void deleteRelationshipType(RelationshipType relationshipType)
           
 java.util.List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired)
           
 java.util.List<Relationship> getAllRelationships(boolean includeVoided)
           
 java.util.List<RelationshipType> getAllRelationshipTypes(boolean includeRetired)
           
 java.util.List<Person> getPeople(java.lang.String searchPhrase, java.lang.Boolean dead)
           
 Person getPerson(java.lang.Integer personId)
           
 PersonAddress getPersonAddressByUuid(java.lang.String uuid)
           
 PersonAttribute getPersonAttribute(java.lang.Integer id)
           
 PersonAttribute getPersonAttributeByUuid(java.lang.String uuid)
           
 PersonAttributeType getPersonAttributeType(java.lang.Integer typeId)
           
 PersonAttributeType getPersonAttributeTypeByUuid(java.lang.String uuid)
          Auto generated method comment
 java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String exactName, java.lang.String format, java.lang.Integer foreignKey, java.lang.Boolean searchable)
           
 Person getPersonByUuid(java.lang.String uuid)
          Auto generated method comment
 PersonName getPersonNameByUuid(java.lang.String uuid)
           
 Relationship getRelationship(java.lang.Integer relationshipId)
           
 Relationship getRelationshipByUuid(java.lang.String uuid)
          Auto generated method comment
 java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType)
           
 RelationshipType getRelationshipType(java.lang.Integer relationshipTypeId)
           
 RelationshipType getRelationshipTypeByUuid(java.lang.String uuid)
          Auto generated method comment
 java.util.List<RelationshipType> getRelationshipTypes(java.lang.String relationshipTypeName, java.lang.Boolean preferred)
           
 java.lang.String getSavedPersonAttributeTypeName(PersonAttributeType personAttributeType)
          Gets the value of name currently saved in the database for the given personAttributeType, bypassing any caches.
 java.util.Set<Person> getSimilarPeople(java.lang.String name, java.lang.Integer birthyear, java.lang.String gender)
           
 Person savePerson(Person person)
           
 PersonAttributeType savePersonAttributeType(PersonAttributeType type)
           
 Relationship saveRelationship(Relationship relationship)
           
 RelationshipType saveRelationshipType(RelationshipType relationshipType)
           
 

Method Detail

getSimilarPeople

java.util.Set<Person> getSimilarPeople(java.lang.String name,
                                       java.lang.Integer birthyear,
                                       java.lang.String gender)
                                       throws DAOException
Throws:
DAOException
See Also:
PersonService.getSimilarPeople(java.lang.String, java.lang.Integer, java.lang.String)

getPeople

java.util.List<Person> getPeople(java.lang.String searchPhrase,
                                 java.lang.Boolean dead)
                                 throws DAOException
Throws:
DAOException
See Also:
PersonService.getPeople(String, Boolean)

savePersonAttributeType

PersonAttributeType savePersonAttributeType(PersonAttributeType type)
                                            throws DAOException
Throws:
DAOException
See Also:
PersonService.savePersonAttributeType(org.openmrs.PersonAttributeType)

deletePersonAttributeType

void deletePersonAttributeType(PersonAttributeType type)
                               throws DAOException
Throws:
DAOException
See Also:
PersonService.purgePersonAttributeType(org.openmrs.PersonAttributeType)

getPersonAttributeTypes

java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String exactName,
                                                            java.lang.String format,
                                                            java.lang.Integer foreignKey,
                                                            java.lang.Boolean searchable)
                                                            throws DAOException
Throws:
DAOException
See Also:
PersonService.getPersonAttributeTypes(java.lang.String, java.lang.String, java.lang.Integer, java.lang.Boolean)

getAllPersonAttributeTypes

java.util.List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired)
                                                               throws DAOException
Throws:
DAOException
See Also:
PersonService.getAllPersonAttributeTypes(), PersonService.getAllPersonAttributeTypes(boolean)

getPersonAttributeType

PersonAttributeType getPersonAttributeType(java.lang.Integer typeId)
                                           throws DAOException
Throws:
DAOException
See Also:
PersonService.getPersonAttributeType(java.lang.Integer)

getPersonAttribute

PersonAttribute getPersonAttribute(java.lang.Integer id)
                                   throws DAOException
Throws:
DAOException
See Also:
PersonService.getPersonAttribute(java.lang.Integer)

getRelationship

Relationship getRelationship(java.lang.Integer relationshipId)
                             throws DAOException
Throws:
DAOException
See Also:
PersonService.getRelationship(java.lang.Integer)

getAllRelationships

java.util.List<Relationship> getAllRelationships(boolean includeVoided)
                                                 throws DAOException
Throws:
DAOException
See Also:
PersonService.getAllRelationships(boolean)

getRelationshipType

RelationshipType getRelationshipType(java.lang.Integer relationshipTypeId)
                                     throws DAOException
Throws:
DAOException
See Also:
PersonService.getRelationshipType(java.lang.Integer)

getRelationshipTypes

java.util.List<RelationshipType> getRelationshipTypes(java.lang.String relationshipTypeName,
                                                      java.lang.Boolean preferred)
                                                      throws DAOException
Throws:
DAOException
See Also:
PersonService.getRelationshipTypes(java.lang.String, java.lang.Boolean)

savePerson

Person savePerson(Person person)
                  throws DAOException
Throws:
DAOException
See Also:
PersonService.savePerson(org.openmrs.Person)

deletePerson

void deletePerson(Person person)
                  throws DAOException
Throws:
DAOException
See Also:
PersonService.deletePerson(org.openmrs.Person)

getPerson

Person getPerson(java.lang.Integer personId)
                 throws DAOException
Throws:
DAOException
See Also:
PersonService.getPerson(java.lang.Integer)

saveRelationship

Relationship saveRelationship(Relationship relationship)
                              throws DAOException
Throws:
DAOException
See Also:
PersonService.saveRelationship(org.openmrs.Relationship)

deleteRelationship

void deleteRelationship(Relationship relationship)
                        throws DAOException
Throws:
DAOException
See Also:
PersonService.purgeRelationship(org.openmrs.Relationship)

getRelationships

java.util.List<Relationship> getRelationships(Person fromPerson,
                                              Person toPerson,
                                              RelationshipType relType)
                                              throws DAOException
Throws:
DAOException
See Also:
PersonService.getRelationships(org.openmrs.Person, org.openmrs.Person, org.openmrs.RelationshipType)

saveRelationshipType

RelationshipType saveRelationshipType(RelationshipType relationshipType)
                                      throws DAOException
Throws:
DAOException
See Also:
PersonService.saveRelationshipType(org.openmrs.RelationshipType)

deleteRelationshipType

void deleteRelationshipType(RelationshipType relationshipType)
                            throws DAOException
Throws:
DAOException
See Also:
PersonService.deleteRelationshipType(org.openmrs.RelationshipType)

getPersonByUuid

Person getPersonByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getPersonAddressByUuid

PersonAddress getPersonAddressByUuid(java.lang.String uuid)

getPersonAttributeByUuid

PersonAttribute getPersonAttributeByUuid(java.lang.String uuid)

getPersonNameByUuid

PersonName getPersonNameByUuid(java.lang.String uuid)

getRelationshipByUuid

Relationship getRelationshipByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getRelationshipTypeByUuid

RelationshipType getRelationshipTypeByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getPersonAttributeTypeByUuid

PersonAttributeType getPersonAttributeTypeByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getSavedPersonAttributeTypeName

java.lang.String getSavedPersonAttributeTypeName(PersonAttributeType personAttributeType)
Gets the value of name currently saved in the database for the given personAttributeType, bypassing any caches. This is used prior to saving an personAttributeType, so that we can change the vlaue of any global property which is in OpenmrsConstants.GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES and reference the given personAttributeType.

Parameters:
personAttributeType - the personAttributeType get the the name of
Returns:
the name currently in the database for this personAttributeType
Expected behavior:
get saved personAttributeType name from database

getAllRelationshipTypes

java.util.List<RelationshipType> getAllRelationshipTypes(boolean includeRetired)
See Also:
org.openmrs.api.PersonService#getAllRelationshipTypes(java.lang.Boolean)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change