|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openmrs.BaseOpenmrsObject org.openmrs.BaseOpenmrsData org.openmrs.Person org.openmrs.Patient
public class Patient
Defines a Patient in the system. A patient is simply an extension of a person and all that that implies.
Field Summary | |
---|---|
static long |
serialVersionUID
|
Fields inherited from class org.openmrs.Person |
---|
personId |
Fields inherited from class org.openmrs.BaseOpenmrsData |
---|
creator |
Constructor Summary | |
---|---|
Patient()
default constructor |
|
Patient(java.lang.Integer patientId)
Constructor with default patient id |
|
Patient(Person person)
This constructor creates a new Patient object from the given Person object. |
Method Summary | |
---|---|
void |
addIdentifier(PatientIdentifier patientIdentifier)
Will add this PatientIdentifier if the patient doesn't contain it already |
void |
addIdentifiers(java.util.Collection<PatientIdentifier> patientIdentifiers)
Will only add PatientIdentifiers in this list that this patient does not have already |
boolean |
equals(java.lang.Object obj)
Compares two objects for similarity This must pass through to the parent object (org.openmrs.Person) in order to get similarity of person/patient objects |
java.util.List<PatientIdentifier> |
getActiveIdentifiers()
Returns only the non-voided identifiers for this patient. |
java.lang.Integer |
getId()
|
java.util.Set<PatientIdentifier> |
getIdentifiers()
Get all of this patients identifiers -- both voided and non-voided ones. |
java.lang.Integer |
getPatientId()
|
PatientIdentifier |
getPatientIdentifier()
Convenience method to get the first "preferred" identifier for a patient. |
PatientIdentifier |
getPatientIdentifier(java.lang.Integer identifierTypeId)
Return's the first (preferred) patient identifier matching identifierTypeId |
PatientIdentifier |
getPatientIdentifier(PatientIdentifierType pit)
Returns the first (preferred) patient identifier matching a PatientIdentifierType Otherwise, returns the first non-voided identifier
Otherwise, null |
PatientIdentifier |
getPatientIdentifier(java.lang.String identifierTypeName)
Return's the (preferred) patient identifier matching identifierTypeName
Otherwise returns that last PatientIdenitifer |
java.util.List<PatientIdentifier> |
getPatientIdentifiers(PatientIdentifierType pit)
Returns only the non-voided identifiers for this patient. |
Tribe |
getTribe()
Deprecated. Tribe is not long a value on Patient. Install the Tribe module |
int |
hashCode()
The hashcode for a patient/person is used to index the objects in a tree This must pass through to the parent object (org.openmrs.Person) in order to get similarity of person/patient objects |
void |
removeIdentifier(PatientIdentifier patientIdentifier)
Convenience method to remove the given identifier from this patient's list of identifiers. |
void |
setId(java.lang.Integer id)
|
void |
setIdentifiers(java.util.Set<PatientIdentifier> identifiers)
Update all identifiers for patient |
void |
setPatientId(java.lang.Integer patientId)
Sets the internal identifier for a patient. |
void |
setPersonId(java.lang.Integer personId)
Overrides the parent setPersonId(Integer) so that we can be sure patient id is also set correctly. |
void |
setTribe(Tribe tribe)
Deprecated. Tribe is not long a value on Patient. Install the Tribe module |
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 |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public Patient()
public Patient(Person person)
Person
object. All
attributes are copied over to the new object. NOTE! All child collection objects are copied
as pointers, each individual element is not copied.
person
- the person object to copy onto a new PatientPerson.Person(Person)
public Patient(java.lang.Integer patientId)
patientId
- Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class Person
obj
-
Person.equals(java.lang.Object)
public int hashCode()
hashCode
in class Person
Person.hashCode()
public java.lang.Integer getPatientId()
public void setPatientId(java.lang.Integer patientId)
patientId
- public void setPersonId(java.lang.Integer personId)
setPersonId
in class Person
personId
- The personId to set.Person.setPersonId(java.lang.Integer)
@Deprecated public Tribe getTribe()
@Deprecated public void setTribe(Tribe tribe)
tribe
- patient's tribepublic java.util.Set<PatientIdentifier> getIdentifiers()
getActiveIdentifiers()
PatientIdentifier
,
getActiveIdentifiers()
public void setIdentifiers(java.util.Set<PatientIdentifier> identifiers)
identifiers
- SetPatientIdentifier
public void addIdentifiers(java.util.Collection<PatientIdentifier> patientIdentifiers)
patientIdentifiers
- public void addIdentifier(PatientIdentifier patientIdentifier)
patientIdentifier
- public void removeIdentifier(PatientIdentifier patientIdentifier)
patientIdentifier
is null, nothing is done.
patientIdentifier
- the identifier to removepublic PatientIdentifier getPatientIdentifier()
public PatientIdentifier getPatientIdentifier(PatientIdentifierType pit)
PatientIdentifierType
Otherwise, returns the first non-voided identifier
Otherwise, null
pit
- The PatientIdentifierType of which to return the PatientIdentifier
public PatientIdentifier getPatientIdentifier(java.lang.Integer identifierTypeId)
identifierTypeId
identifierTypeId
-
public PatientIdentifier getPatientIdentifier(java.lang.String identifierTypeName)
identifierTypeName
Otherwise returns that last PatientIdenitifer
identifierTypeName
-
public java.util.List<PatientIdentifier> getActiveIdentifiers()
getIdentifiers()
getIdentifiers()
public java.util.List<PatientIdentifier> getPatientIdentifiers(PatientIdentifierType pit)
getIdentifiers()
pit
- PatientIdentifierType
getIdentifiers()
public java.lang.String toString()
toString
in class Person
Object.toString()
public java.lang.Integer getId()
getId
in interface OpenmrsObject
getId
in class Person
OpenmrsObject.getId()
public void setId(java.lang.Integer id)
setId
in interface OpenmrsObject
setId
in class Person
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |