org.openmrs
Class RelationshipType

java.lang.Object
  extended by org.openmrs.BaseOpenmrsObject
      extended by org.openmrs.BaseOpenmrsMetadata
          extended by org.openmrs.RelationshipType
All Implemented Interfaces:
java.io.Serializable, Auditable, OpenmrsMetadata, OpenmrsObject, Retireable

public class RelationshipType
extends BaseOpenmrsMetadata
implements java.io.Serializable

Defines a type of relationship between two people in the database.

A relationship is two-way. There is a name for the relationship in both directions.

For example:
a) physician Joe
b) patient Bob
Joe is the "physician of" Bob and Bob is the patient of Joe. Once you can establish one of the two relationships, you automatically know the other.

ALL relationships are two-way and can be defined as such.

RelationshipTypes should be defined as gender non-specific For example: A mother and her son. Instead of having a RelationshipType defined as mother-son, it should be defined as Parent-child. (This avoids the duplicative types that would come out like father-son, father-daughter, mother-daughter)

In English, we run into a tricky RelationshipType with aunts and uncles. We have chosen to define them as aunt/uncle-niece/nephew.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
RelationshipType()
          default constructor
RelationshipType(java.lang.Integer relationshipTypeId)
          constructor with id
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares two RelationshipTypes for similarity
 java.lang.String getaIsToB()
          The java bean specifications says that if an attribute has the second letter capitalized (as the "I" is), the initial "a" is not to be capitalized.
 java.lang.String getbIsToA()
           
 java.lang.Integer getId()
           
 java.lang.Integer getRelationshipTypeId()
           
 java.lang.Integer getWeight()
           
 int hashCode()
           
 java.lang.Boolean isPreferred()
          "Preferred" relationship types are those that should be shown as default types when adding/editing a person's relationships
 void setaIsToB(java.lang.String aisToB)
           
 void setbIsToA(java.lang.String bisToA)
           
 void setId(java.lang.Integer id)
           
 void setPreferred(java.lang.Boolean preferred)
          "Preferred" relationship types are those that should be shown as default types when adding/editing a person's relationships
 void setRelationshipTypeId(java.lang.Integer relationshipTypeId)
           
 void setWeight(java.lang.Integer weight)
           
 java.lang.String toString()
           
 
Methods inherited from class org.openmrs.BaseOpenmrsMetadata
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReason
 
Methods inherited from class org.openmrs.BaseOpenmrsObject
getUuid, setUuid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmrs.OpenmrsObject
getUuid, setUuid
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

RelationshipType

public RelationshipType()
default constructor


RelationshipType

public RelationshipType(java.lang.Integer relationshipTypeId)
constructor with id

Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares two RelationshipTypes for similarity

Overrides:
equals in class java.lang.Object
Parameters:
obj - RelationshipType to compare to this object
Returns:
boolean true/false whether or not they are the same objects
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

getRelationshipTypeId

public java.lang.Integer getRelationshipTypeId()
Returns:
Returns the relationshipTypeId.

setRelationshipTypeId

public void setRelationshipTypeId(java.lang.Integer relationshipTypeId)
Parameters:
relationshipTypeId - The relationshipTypeId to set.

getWeight

public java.lang.Integer getWeight()
Returns:
the weight

setWeight

public void setWeight(java.lang.Integer weight)
Parameters:
weight - the weight to set

getaIsToB

public java.lang.String getaIsToB()
The java bean specifications says that if an attribute has the second letter capitalized (as the "I" is), the initial "a" is not to be capitalized. Both Spring and Hibernate use this "getter" definition

Returns:
the aIsToB

setaIsToB

public void setaIsToB(java.lang.String aisToB)
Parameters:
aisToB - the aIsToB to set

getbIsToA

public java.lang.String getbIsToA()
Returns:
the bIsToA

isPreferred

public java.lang.Boolean isPreferred()
"Preferred" relationship types are those that should be shown as default types when adding/editing a person's relationships

Returns:
the preferred status

setPreferred

public void setPreferred(java.lang.Boolean preferred)
"Preferred" relationship types are those that should be shown as default types when adding/editing a person's relationships

Parameters:
preferred - sets the preferred status of this relationship type

setbIsToA

public void setbIsToA(java.lang.String bisToA)
Parameters:
bisToA - the bIsToA to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getId

public java.lang.Integer getId()
Specified by:
getId in interface OpenmrsObject
Returns:
id - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.getId()

setId

public void setId(java.lang.Integer id)
Specified by:
setId in interface OpenmrsObject
Parameters:
id - - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.setId(java.lang.Integer)

OpenMRS-1.7.x

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