public class Patient extends Person
Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
creator
Constructor and Description |
---|
Patient()
default constructor
|
Patient(Integer patientId)
Constructor with default patient id
|
Patient(Patient patient)
This constructor creates a new Patient object from the given
Patient object. |
Patient(Person person)
This constructor creates a new Patient object from the given
Person object. |
Modifier and Type | Method and Description |
---|---|
void |
addIdentifier(PatientIdentifier patientIdentifier)
Will add this PatientIdentifier if the patient doesn't contain it already
|
void |
addIdentifiers(Collection<PatientIdentifier> patientIdentifiers)
Will only add PatientIdentifiers in this list that this patient does not have already
|
List<PatientIdentifier> |
getActiveIdentifiers()
Returns only the non-voided identifiers for this patient.
|
String |
getAllergyStatus()
Returns allergy status maintained by the supporting infrastructure.
|
Integer |
getId() |
Set<PatientIdentifier> |
getIdentifiers()
Get all of this patients identifiers -- both voided and non-voided ones.
|
Integer |
getPatientId() |
PatientIdentifier |
getPatientIdentifier()
Convenience method to get the first "preferred" identifier for a patient.
|
PatientIdentifier |
getPatientIdentifier(Integer identifierTypeId)
Returns 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(String identifierTypeName)
Returns the (preferred) patient identifier matching
identifierTypeName Otherwise
returns that last PatientIdenitifer |
List<PatientIdentifier> |
getPatientIdentifiers(PatientIdentifierType pit)
Returns only the non-voided identifiers for this patient.
|
Person |
getPerson()
Returns the person represented
|
void |
removeIdentifier(PatientIdentifier patientIdentifier)
Convenience method to remove the given identifier from this patient's list of identifiers.
|
void |
setAllergyStatus(String allergyStatus)
Sets the allergy status for a patient.
|
void |
setId(Integer id) |
void |
setIdentifiers(Set<PatientIdentifier> identifiers)
Update all identifiers for patient
|
void |
setPatientId(Integer patientId)
Sets the internal identifier for a patient.
|
void |
setPersonId(Integer personId)
Overrides the parent setPersonId(Integer) so that we can be sure patient id is also set
correctly.
|
String |
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
addAddress, addAttribute, addName, getActiveAttributes, getAddresses, getAge, getAge, getAllAttributeMap, getAttribute, getAttribute, getAttribute, getAttributeMap, getAttributes, getAttributes, getAttributes, getAttributes, getBirthdate, getBirthdateEstimated, getBirthDateTime, getBirthtime, getCauseOfDeath, getCauseOfDeathNonCoded, getDead, getDeathDate, getDeathdateEstimated, getFamilyName, getGender, getGivenName, getIsPatient, getMiddleName, getNames, getPersonAddress, getPersonChangedBy, getPersonCreator, getPersonDateChanged, getPersonDateCreated, getPersonDateVoided, getPersonId, getPersonName, getPersonVoided, getPersonVoidedBy, getPersonVoidReason, isBirthdateEstimated, isDead, isPatient, isPersonVoided, printAttributes, removeAddress, removeAttribute, removeName, setAddresses, setAttributes, setBirthdate, setBirthdateEstimated, setBirthdateFromAge, setBirthtime, setCauseOfDeath, setCauseOfDeathNonCoded, setDead, setDeathDate, setDeathdateEstimated, setGender, setNames, setPatient, setPersonChangedBy, setPersonCreator, setPersonDateChanged, setPersonDateCreated, setPersonDateVoided, setPersonVoided, setPersonVoidedBy, setPersonVoidReason
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public static final long serialVersionUID
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)
public Patient(Integer patientId)
patientId
- public Integer getPatientId()
public void setPatientId(Integer patientId)
patientId
- public String getAllergyStatus()
public void setAllergyStatus(String allergyStatus)
allergyStatus
- public void setPersonId(Integer personId)
setPersonId
in class Person
personId
- The personId to set.Person.setPersonId(java.lang.Integer)
public Set<PatientIdentifier> getIdentifiers()
getActiveIdentifiers()
PatientIdentifier
,
Should not return null
public void setIdentifiers(Set<PatientIdentifier> identifiers)
identifiers
- Set<PatientIdentifier> to set as update all known identifiers for
patientPatientIdentifier
public void addIdentifiers(Collection<PatientIdentifier> patientIdentifiers)
patientIdentifiers
- public void addIdentifier(PatientIdentifier patientIdentifier)
patientIdentifier
- Should not fail with null identifiers list
Should add identifier to current list
Should not add identifier that is in list alreadypublic void removeIdentifier(PatientIdentifier patientIdentifier)
patientIdentifier
is null, nothing is done.patientIdentifier
- the identifier to remove
Should remove identifier if existspublic PatientIdentifier getPatientIdentifier()
public PatientIdentifier getPatientIdentifier(PatientIdentifierType pit)
PatientIdentifierType
Otherwise, returns the first non-voided identifier
Otherwise, nullpit
- The PatientIdentifierType of which to return the PatientIdentifierpublic PatientIdentifier getPatientIdentifier(Integer identifierTypeId)
identifierTypeId
identifierTypeId
- public PatientIdentifier getPatientIdentifier(String identifierTypeName)
identifierTypeName
Otherwise
returns that last PatientIdenitifer
identifierTypeName
- public List<PatientIdentifier> getActiveIdentifiers()
getIdentifiers()
Should return preferred identifiers first in the list
public List<PatientIdentifier> getPatientIdentifiers(PatientIdentifierType pit)
getIdentifiers()
pit
- PatientIdentifierTypegetIdentifiers()
public String toString()
BaseOpenmrsObject
ClassName{hashCode=..., uuid=...}
If the uuid
field is null
, it returns:
ClassName{hashCode=...}Should include hashCode if uuid is null Should include uuid if not null
toString
in class Person
Object.toString()
public Integer getId()
getId
in interface OpenmrsObject
getId
in class Person
OpenmrsObject.getId()
public void setId(Integer id)
setId
in interface OpenmrsObject
setId
in class Person
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
public Person getPerson()
Copyright © 2024 OpenMRS Inc.. All rights reserved.