@Transactional public interface PersonService extends OpenmrsService
List<Person> personObjects = Context.getPersonService().getAllPersons();
Modifier and Type | Interface and Description |
---|---|
static class |
PersonService.ATTR_VIEW_TYPE
These enumerations are used when determining which person attr types to display.
|
Modifier and Type | Method and Description |
---|---|
Person |
createPerson(Person person)
Deprecated.
replaced by #savePerson(Person)
|
void |
createPersonAttributeType(PersonAttributeType type)
Deprecated.
|
void |
createRelationship(Relationship relationship)
Deprecated.
replaced by #saveRelationship(Relationship)
|
void |
createRelationshipType(RelationshipType relationshipType)
Deprecated.
replaced with #saveRelationshipType(RelationshipType)
|
void |
deletePerson(Person person)
Deprecated.
replaced by #purgePerson(Person)
|
void |
deletePersonAttributeType(java.lang.Integer attrTypeId)
Deprecated.
use (@link #purgePersonAttributeType(PersonAttributeType))
|
void |
deletePersonAttributeType(PersonAttributeType type)
Deprecated.
replaced by #purgePersonAttributeType(PersonAttributeType)
|
void |
deleteRelationship(Relationship relationship)
Deprecated.
replaced by #purgeRelationship(Relationship)
|
void |
deleteRelationshipType(RelationshipType relationshipType)
Deprecated.
replaced by #purgeRelationshipType(RelationshipType)
|
java.util.Set<Person> |
findPeople(java.lang.String searchPhrase,
boolean includeVoided)
Deprecated.
@see #getPeople(...)
|
java.util.Set<Person> |
findPeople(java.lang.String searchPhrase,
boolean includeVoided,
java.util.List<java.lang.String> roles)
Deprecated.
@see #getPeople(...)
|
java.util.Set<Person> |
findPeople(java.lang.String searchPhrase,
boolean includeVoided,
java.lang.String roles)
Deprecated.
@see #getPeople(...)
|
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 typeName)
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 personType,
java.lang.String viewType)
Deprecated.
|
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 relationshipType)
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 relationshipType)
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 nameSearch,
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.
replaced by 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.
replaced by #saveRelationship(Relationship)
|
void |
updateRelationshipType(RelationshipType relationshipType)
Deprecated.
replaced by #saveRelationshipType(RelationshipType)
|
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
void setPersonDAO(PersonDAO dao)
dao
- DAO for this service@Transactional(readOnly=true) @Authorized(value="View People") java.util.Set<Person> getSimilarPeople(java.lang.String nameSearch, java.lang.Integer birthyear, java.lang.String gender) throws APIException
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 includednameSearch
- 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
@Deprecated 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)
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
#getSimilarPeople(String, Integer, String)}
@Transactional(readOnly=true) @Authorized(value="View People") java.util.List<Person> getPeople(java.lang.String searchPhrase, java.lang.Boolean dead) throws APIException
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
@Deprecated @Transactional(readOnly=true) @Authorized(value="View People") java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided) throws APIException
APIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View People") java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided, java.lang.String roles) throws APIException
APIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View People") java.util.Set<Person> findPeople(java.lang.String searchPhrase, boolean includeVoided, java.util.List<java.lang.String> roles) throws APIException
APIException
@Authorized(value="Manage Person Attribute Types") PersonAttributeType savePersonAttributeType(PersonAttributeType type) throws APIException
OpenmrsConstants.GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES
and reference this given
type, prior to saving this given type. type
- APIException
@Authorized(value="Manage Person Attribute Types") PersonAttributeType retirePersonAttributeType(PersonAttributeType type, java.lang.String retiredReason) throws APIException
attrTypeId,
- retiredReasonAPIException
@Authorized(value="Manage Relationship Types") RelationshipType retireRelationshipType(RelationshipType type, java.lang.String retiredReason) throws APIException
relationshipType,
- retiredReasonAPIException
@Authorized(value="Manage Relationship Types") RelationshipType unretireRelationshipType(RelationshipType relationshipType)
relationshipType,
- retiredReason@Deprecated @Authorized(value="Manage Person Attribute Types") void createPersonAttributeType(PersonAttributeType type) throws APIException
savePersonAttributeType(PersonAttributeType)
APIException
@Deprecated @Authorized(value="Purge Person Attribute Types") void deletePersonAttributeType(PersonAttributeType type) throws APIException
APIException
@Authorized(value="Purge Person Attribute Types") void purgePersonAttributeType(PersonAttributeType type) throws APIException
type
- type to be purged from the databaseAPIException
@Authorized(value="Manage Person Attribute Types") void unretirePersonAttributeType(PersonAttributeType type) throws APIException
type
- type to be restored from the databaseAPIException
@Authorized(value="Edit People") Person voidPerson(Person person, java.lang.String reason) throws APIException
person
- person to be voidedreason
- reason for voiding personAPIException
@Authorized(value="Edit People") Person unvoidPerson(Person person) throws APIException
person
- person to be revivedAPIException
@Deprecated @Authorized(value="Manage Person Attribute Types") void deletePersonAttributeType(java.lang.Integer attrTypeId) throws APIException
attrTypeId
- APIException
@Deprecated @Authorized(value="Manage Person Attribute Types") void updatePersonAttributeType(PersonAttributeType type) throws APIException
savePersonAttributeType(PersonAttributeType)
APIException
@Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") java.util.List<PersonAttributeType> getAllPersonAttributeTypes() throws APIException
APIException
getAllPersonAttributeTypes(boolean)
@Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") java.util.List<PersonAttributeType> getAllPersonAttributeTypes(boolean includeRetired) throws APIException
includeRetired
- boolean - include retired attribute types as well?APIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") java.util.List<PersonAttributeType> getPersonAttributeTypes() throws APIException
getAllPersonAttributeTypes()
APIException
@Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String exactName, java.lang.String format, java.lang.Integer foreignKey, java.lang.Boolean searchable) throws APIException
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
@Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") PersonAttributeType getPersonAttributeType(java.lang.Integer typeId) throws APIException
typeId
- PersonAttributeType.personAttributeTypeId to match onAPIException
@Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") PersonAttributeType getPersonAttributeTypeByUuid(java.lang.String uuid)
uuid
- the universally unique identifier to lookup@Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") PersonAttribute getPersonAttribute(java.lang.Integer id) throws APIException
id
- the PersonAttribute.personAttributeId to match onAPIException
@Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") PersonAttributeType getPersonAttributeTypeByName(java.lang.String typeName) throws APIException
typeName
- APIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View Person Attribute Types") PersonAttributeType getPersonAttributeType(java.lang.String typeName) throws APIException
getPersonAttributeTypeByName(String)
APIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") Relationship getRelationship(java.lang.Integer relationshipId) throws APIException
relationshipId
- APIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") Relationship getRelationshipByUuid(java.lang.String uuid) throws APIException
uuid
- APIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getAllRelationships() throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getAllRelationships(boolean includeVoided) throws APIException
includeVoided
- true/false whether to include the voided relationshipsAPIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationships() throws APIException
getAllRelationships()
APIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationshipsByPerson(Person p) throws APIException
p
- person object listed on either side of the relationshipAPIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationshipsByPerson(Person p, java.util.Date effectiveDate) throws APIException
p
- person object listed on either side of the relationshipeffectiveDate
- effective date of relationshipAPIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationships(Person p, boolean showVoided) throws APIException
getRelationshipsByPerson(Person)
APIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationships(Person p) throws APIException
getRelationshipsByPerson(Person)
APIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationshipsTo(Person toPerson, RelationshipType relType) throws APIException
getRelationships(...)
APIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType) throws APIException
fromPerson
- (optional) Person to in the person_id columntoPerson
- (optional) Person in the relative_id columnrelType
- (optional) The RelationshipType to matchAPIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, java.util.Date effectiveDate) throws APIException
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
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.List<Relationship> getRelationships(Person fromPerson, Person toPerson, RelationshipType relType, java.util.Date startEffectiveDate, java.util.Date endEffectiveDate) throws APIException
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
@Transactional(readOnly=true) @Authorized(value="View Relationship Types") java.util.List<RelationshipType> getAllRelationshipTypes() throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Relationship Types") java.util.List<RelationshipType> getAllRelationshipTypes(boolean includeRetired) throws APIException
includeRetired
- boolean - include retired relationshipTypes as well?APIException
@Deprecated @Transactional(readOnly=true) java.util.List<RelationshipType> getRelationshipTypes() throws APIException
getAllRelationshipTypes()
APIException
@Transactional(readOnly=true) @Authorized(value="View Relationship Types") RelationshipType getRelationshipType(java.lang.Integer relationshipTypeId) throws APIException
relationshipTypeId
- APIException
@Transactional(readOnly=true) @Authorized(value="View Relationship Types") RelationshipType getRelationshipTypeByUuid(java.lang.String uuid) throws APIException
uuid
- APIException
@Deprecated @Transactional(readOnly=true) RelationshipType findRelationshipType(java.lang.String relationshipTypeName) throws APIException
getRelationshipTypeByName(String)
APIException
@Transactional(readOnly=true) @Authorized(value="View Relationship Types") RelationshipType getRelationshipTypeByName(java.lang.String relationshipTypeName) throws APIException
relationshipTypeName
- name to match onAPIException
@Transactional(readOnly=true) @Authorized(value="View Relationship Types") java.util.List<RelationshipType> getRelationshipTypes(java.lang.String relationshipTypeName, java.lang.Boolean preferred) throws APIException
relationshipTypeName
- name to match onpreferred
- if true, returns on preferred types, if false returns only the nonpreferred
types. if null returns bothAPIException
@Transactional(readOnly=true) @Authorized(value="View Relationship Types") java.util.List<RelationshipType> getRelationshipTypes(java.lang.String searchString) throws APIException
searchString
- string to match to a relationship type nameAPIException
@Deprecated @Authorized(value="Add Relationships") void createRelationship(Relationship relationship) throws APIException
APIException
@Authorized(value={"Add Relationships","Edit Relationships"}) Relationship saveRelationship(Relationship relationship) throws APIException
relationship
to
the databaserelationship
- relationship to be created or updatedAPIException
@Deprecated @Authorized(value="Edit Relationships") void updateRelationship(Relationship relationship) throws APIException
APIException
@Deprecated @Authorized(value="Purge Relationships") void deleteRelationship(Relationship relationship) throws APIException
APIException
@Authorized(value="Purge Relationships") void purgeRelationship(Relationship relationship) throws APIException
relationship
- relationship to be purged from the databaseAPIException
@Authorized(value="Delete Relationships") Relationship voidRelationship(Relationship relationship, java.lang.String voidReason) throws APIException
relationship
- Relationship to voidvoidReason
- String reason the relationship is being voided.APIException
@Authorized(value="Edit Relationships") Relationship unvoidRelationship(Relationship relationship) throws APIException
relationship
- Relationship to unvoidAPIException
@Deprecated @Authorized(value="Add People") Person createPerson(Person person) throws APIException
APIException
@Authorized(value={"Add People","Edit People"}) Person savePerson(Person person) throws APIException
person
- person to be created or updatedAPIException
@Deprecated @Authorized(value="Edit People") void updatePerson(Person person) throws APIException
savePerson(Person)
APIException
@Deprecated @Authorized(value="Purge People") void deletePerson(Person person) throws APIException
APIException
@Authorized(value="Purge People") void purgePerson(Person person) throws APIException
person
- person to be purged from the databaseAPIException
@Transactional(readOnly=true) @Authorized(value="View People") Person getPersonByUuid(java.lang.String uuid) throws APIException
uuid
- APIException
@Transactional(readOnly=true) @Authorized(value="View People") PersonAddress getPersonAddressByUuid(java.lang.String uuid) throws APIException
uuid
- APIException
@Transactional(readOnly=true) @Authorized(value="View People") PersonAttribute getPersonAttributeByUuid(java.lang.String uuid) throws APIException
uuid
- APIException
@Transactional(readOnly=true) @Authorized(value="View People") PersonName getPersonName(java.lang.Integer personNameId)
personNameId
- @Transactional(readOnly=true) @Authorized(value="View People") PersonName getPersonNameByUuid(java.lang.String uuid) throws APIException
uuid
- APIException
@Transactional(readOnly=true) @Authorized(value="View People") Person getPerson(java.lang.Integer personId) throws APIException
personId
- internal identifier of person to getAPIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View People") Person getPerson(Patient pat) throws APIException
getPerson(Integer)
getPerson(Integer)
passing in pat.getPatientId() or just cast the pat
object to a Person object because Patient is a subclass of Person. (Person)patAPIException
@Deprecated @Transactional(readOnly=true) @Authorized(value="View People") Person getPerson(User user) throws APIException
getPerson(Integer)
getPerson(Integer)
passing in user.getUserId() or just cast the user
object to a Person object because User is a subclass of Person. (Person)userAPIException
@Deprecated @Authorized(value="Manage Relationship Types") void createRelationshipType(RelationshipType relationshipType) throws APIException
APIException
@Authorized(value="Manage Relationship Types") RelationshipType saveRelationshipType(RelationshipType relationshipType) throws APIException
relationshipType
- type to be created or updatedAPIException
@Deprecated @Authorized(value="Manage Relationship Types") void updateRelationshipType(RelationshipType relationshipType) throws APIException
APIException
@Deprecated @Authorized(value="Purge Relationship Types") void deleteRelationshipType(RelationshipType relationshipType) throws APIException
APIException
@Authorized(value="Purge Relationship Types") void purgeRelationshipType(RelationshipType relationshipType) throws APIException
relationshipType
- relationship type to be purgedAPIException
@Transactional(readOnly=true) java.util.List<PersonAttributeType> getPersonAttributeTypes(OpenmrsConstants.PERSON_TYPE personType, PersonService.ATTR_VIEW_TYPE viewType) throws APIException
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
@Deprecated @Transactional(readOnly=true) java.util.List<PersonAttributeType> getPersonAttributeTypes(java.lang.String personType, java.lang.String viewType) throws APIException
getPersonAttributeTypes(String, String)
APIException
@Deprecated PersonName splitPersonName(java.lang.String name)
name
string into Given, Middle, and Family parts of a PersonNamename
- parsePersonName(String)
@Authorized(value="Edit People") PersonName voidPersonName(PersonName personName, java.lang.String voidReason)
personName
- PersonName to voidvoidReason
- String reason the personName is being voided.APIException
@Authorized(value="Edit People") PersonName unvoidPersonName(PersonName personName) throws APIException
personName
- PersonName to unvoidAPIException
@Authorized(value="Edit People") PersonName savePersonName(PersonName personName)
personName
- to be created or updatedAPIException
PersonName parsePersonName(java.lang.String name) throws APIException
name
- person name to be parsedAPIException
@Transactional(readOnly=true) @Authorized(value="View Relationships") java.util.Map<Person,java.util.List<Person>> getRelationshipMap(RelationshipType relationshipType) throws APIException
relationshipType
- type of relationship for which to retrieve all relationshipsAPIException
@Deprecated @Transactional(readOnly=true) java.util.Map<Person,java.util.List<Person>> getRelationships(RelationshipType relationshipType) throws APIException
getRelationshipMap(RelationshipType)
APIException
PersonMergeLog savePersonMergeLog(PersonMergeLog personMergeLog) throws SerializationException, APIException
PersonMergeLog.getPersonMergeLogData()
, sets the mergedData String,
and the creator and date if null. It then saves the PersonMergeLog
object to the
model.personMergeLog
- the PersonMergeLog
object to save.PersonMergeLog
objectSerializationException
APIException
PersonMergeLog
,
OpenmrsObjectSaveHandler
PersonMergeLog getPersonMergeLogByUuid(java.lang.String uuid, boolean deserialize) throws SerializationException, APIException
uuid
- deserialize
- SerializationException
APIException
java.util.List<PersonMergeLog> getAllPersonMergeLogs(boolean deserialize) throws SerializationException
PersonMergeLog
objects from the modelSerializationException
java.util.List<PersonMergeLog> getWinningPersonMergeLogs(Person person, boolean deserialize) throws SerializationException
PersonMergeLog
objects by winning person p. Useful for to getting all persons merged into p.person
- the winning personPersonMergeLog
objectsSerializationException
PersonMergeLog getLosingPersonMergeLog(Person person, boolean deserialize) throws SerializationException
PersonMergeLog
where person p is the loser. Useful for getting the person that p was merged into.person
- the losing personPersonMergeLog
objectSerializationException
@Authorized(value="Edit People") PersonAddress voidPersonAddress(PersonAddress personAddress, java.lang.String voidReason)
personAddress
- PersonAddress to voidvoidReason
- String reason the personAddress is being voided.APIException
@Authorized(value="Edit People") PersonAddress unvoidPersonAddress(PersonAddress personAddress) throws APIException
personAddress
- PersonAddress to unvoidAPIException
@Authorized(value="Edit People") PersonAddress savePersonAddress(PersonAddress personAddress)
personAddress
- PersonAddress to be created or updatedCopyright © 2018 OpenMRS Inc.. All Rights Reserved.