org.openmrs
Class PatientIdentifier

java.lang.Object
  extended by org.openmrs.BaseOpenmrsObject
      extended by org.openmrs.BaseOpenmrsData
          extended by org.openmrs.PatientIdentifier
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<PatientIdentifier>, Auditable, OpenmrsData, OpenmrsObject, Voidable

public class PatientIdentifier
extends BaseOpenmrsData
implements java.io.Serializable, java.lang.Comparable<PatientIdentifier>

A Patient can have zero to n identifying PatientIdentifier(s). PatientIdentifiers are anything from medical record numbers, to social security numbers, to driver's licenses. The type of identifier is defined by the PatientIdentifierType. A PatientIdentifier also contains a Location.

See Also:
PatientIdentifierType, Serialized Form

Field Summary
static long serialVersionUID
           
 
Fields inherited from class org.openmrs.BaseOpenmrsData
creator
 
Constructor Summary
PatientIdentifier()
          default constructor
PatientIdentifier(java.lang.String identifier, PatientIdentifierType type, Location location)
          Convenience constructor for creating a basic identifier
 
Method Summary
 int compareTo(PatientIdentifier other)
           
 boolean equals(java.lang.Object obj)
          Compares two objects for similarity
 boolean equalsContent(PatientIdentifier otherIdentifier)
          Compares this PatientIdentifier object to the given otherIdentifier.
 java.lang.Integer getId()
           
 java.lang.String getIdentifier()
           
 PatientIdentifierType getIdentifierType()
           
 Location getLocation()
           
 Patient getPatient()
           
 java.lang.Integer getPatientIdentifierId()
           
 java.lang.Boolean getPreferred()
           
 int hashCode()
           
 java.lang.Boolean isPreferred()
           
 void setId(java.lang.Integer id)
           
 void setIdentifier(java.lang.String identifier)
           
 void setIdentifierType(PatientIdentifierType identifierType)
           
 void setLocation(Location location)
           
 void setPatient(Patient patient)
           
 void setPatientIdentifierId(java.lang.Integer patientIdentifierId)
           
 void setPreferred(java.lang.Boolean preferred)
           
 java.lang.String toString()
           
 
Methods inherited from class org.openmrs.BaseOpenmrsData
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason
 
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

PatientIdentifier

public PatientIdentifier()
default constructor


PatientIdentifier

public PatientIdentifier(java.lang.String identifier,
                         PatientIdentifierType type,
                         Location location)
Convenience constructor for creating a basic identifier

Parameters:
identifier - String identifier
type - PatientIdentifierType
location - Location of the identifier
Method Detail

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
boolean true/false whether or not they are the same objects
Expected behavior:
not fail when patient and identifier and type are null, return true if patient identifier ids are same, return false if one patient identifier id is null, return true if comparing same object with null ids

hashCode

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

equalsContent

public boolean equalsContent(PatientIdentifier otherIdentifier)
Compares this PatientIdentifier object to the given otherIdentifier. This method differs from equals(Object) in that this method compares the inner fields of each identifier for equality. Note: Null/empty fields on otherIdentifier /will not/ cause a false value to be returned

Parameters:
otherIdentifier - PatientiIdentifier with which to compare
Returns:
boolean true/false whether or not they are the same names

getIdentifier

public java.lang.String getIdentifier()
Returns:
Returns the identifier.

setIdentifier

public void setIdentifier(java.lang.String identifier)
Parameters:
identifier - The identifier to set.

getIdentifierType

public PatientIdentifierType getIdentifierType()
Returns:
Returns the identifierType.

setIdentifierType

public void setIdentifierType(PatientIdentifierType identifierType)
Parameters:
identifierType - The identifierType to set.

getLocation

public Location getLocation()
Returns:
Returns the location.

setLocation

public void setLocation(Location location)
Parameters:
location - The location to set.

getPatient

public Patient getPatient()
Returns:
Returns the patient.

setPatient

public void setPatient(Patient patient)
Parameters:
patient - The patient to set.

toString

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

getPreferred

public java.lang.Boolean getPreferred()
Returns:
Returns the preferred.

setPreferred

public void setPreferred(java.lang.Boolean preferred)
Parameters:
preferred - The preferred to set.

isPreferred

public java.lang.Boolean isPreferred()
Returns:
the preferred status

compareTo

public int compareTo(PatientIdentifier other)
Specified by:
compareTo in interface java.lang.Comparable<PatientIdentifier>
See Also:
Comparable.compareTo(java.lang.Object)

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)

getPatientIdentifierId

public java.lang.Integer getPatientIdentifierId()
Returns:
the patientIdentifierId
Since:
1.5

setPatientIdentifierId

public void setPatientIdentifierId(java.lang.Integer patientIdentifierId)
Parameters:
patientIdentifierId - the patientIdentifierId to set
Since:
1.5

OpenMRS-1.7.x

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