org.openmrs
Class PatientIdentifier
java.lang.Object
org.openmrs.BaseOpenmrsObject
org.openmrs.BaseOpenmrsData
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
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 java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
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 identifiertype
- PatientIdentifierTypelocation
- Location of the identifier
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
Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change