Class PatientInfo
- java.lang.Object
-
- org.openehealth.ipf.commons.ihe.xds.core.metadata.PatientInfo
-
- All Implemented Interfaces:
Serializable
public class PatientInfo extends Object implements Serializable
Represents additional information about a patient, as an HL7v2 PID segment with the following specialities:- Fields PID-3 (patient IDs), PID-5 (patient names), PID-7 (birth date), and PID-8 (gender) can be manipulated both as HL7 strings and as XDS metadata objects.
- Fields PID-2, PID-4, PID-12 and PID-19 are prohibited by the XDS standard.
getIds()
,getNames()
, andgetAddresses()
will be not propagated to their HL7 string counterparts, thereforeListIterator.set(Object)
shall be used to properly update the both representations. For example,ListIterator<Name> iter = patientInfo.getNames(); Name name = iter.next(); name.setFamilyName("Krusenstern"); iter.set(name); // this statement is absolutely essential!
- Author:
- Jens Riemschneider, Dmytro Rud
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PatientInfo.Hl7FieldIdComparator
-
Constructor Summary
Constructors Constructor Description PatientInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
ListIterator<Address>
getAddresses()
Returns a snapshot of the list of patient addresses.Set<String>
getAllFieldIds()
Set<String>
getCustomFieldIds()
Timestamp
getDateOfBirth()
String
getGender()
ListIterator<String>
getHl7FieldIterator(String fieldId)
ListIterator<Identifiable>
getIds()
Returns a snapshot of list of patient IDs.ListIterator<Name>
getNames()
Returns a snapshot of the list of patient names.int
hashCode()
void
setDateOfBirth(String date)
void
setDateOfBirth(Timestamp date)
void
setGender(String gender)
String
toString()
-
-
-
Method Detail
-
getAllFieldIds
public Set<String> getAllFieldIds()
- Returns:
- IDs of HL7 fields which are currently present in this SourcePatientInfo instance (note: there can be present fields without any content)
-
getCustomFieldIds
public Set<String> getCustomFieldIds()
- Returns:
- IDs of HL7 fields which are currently present in this SourcePatientInfo instance and are not backed up by XDS metadata POJOs (note: there can be present fields without any content)
-
getHl7FieldIterator
public ListIterator<String> getHl7FieldIterator(String fieldId)
- Parameters:
fieldId
- HL7 field ID, e.g. "PID-3"- Returns:
- iterator over a list of raw HL7 strings representing repetitions of the given HL7 field
-
getIds
public ListIterator<Identifiable> getIds()
Returns a snapshot of list of patient IDs. See the note in the class javadoc.- Returns:
- iterator over the IDs of the patient (PID-3).
-
getNames
public ListIterator<Name> getNames()
Returns a snapshot of the list of patient names. See the note in the class javadoc.- Returns:
- iterator over the names of the patient (PID-5).
-
getDateOfBirth
public Timestamp getDateOfBirth()
- Returns:
- the date of birth of the patient (PID-7).
-
setDateOfBirth
public void setDateOfBirth(Timestamp date)
- Parameters:
date
- the date of birth of the patient (PID-7).
-
setDateOfBirth
public void setDateOfBirth(String date)
- Parameters:
date
- the date of birth of the patient (PID-7).
-
getGender
public String getGender()
- Returns:
- the gender of the patient (PID-8).
-
setGender
public void setGender(String gender)
- Parameters:
gender
- the gender of the patient (PID-8).
-
getAddresses
public ListIterator<Address> getAddresses()
Returns a snapshot of the list of patient addresses. See the note in the class javadoc.- Returns:
- iterator over thr addresses of the patient (PID-11).
-
canEqual
protected boolean canEqual(Object other)
-
-