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.
IMPORTANT NOTE: in-place modifications of the XDS metadata objects contained in the lists returned by getIds(), getNames(), and getAddresses() will be not propagated to their HL7 string counterparts, therefore ListIterator.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:
  • Constructor Details

    • PatientInfo

      public PatientInfo()
  • Method Details

    • 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).
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object