Class PID

All Implemented Interfaces:
Segment, Structure, Visitable, Serializable

public class PID extends AbstractSegment

Represents an HL7 PID message segment (Patient Identification). This segment has the following fields:

  • PID-1: Set ID - Patient ID (SI) optional
  • PID-2: Patient ID (External ID) (CX) optional
  • PID-3: Patient ID (Internal ID) (CX) repeating
  • PID-4: Alternate Patient ID (CX) optional
  • PID-5: Patient Name (XPN) repeating
  • PID-6: Mother's Maiden Name (XPN) optional
  • PID-7: Date of Birth (TS) optional
  • PID-8: Sex (IS) optional
  • PID-9: Patient Alias (XPN) optional repeating
  • PID-10: Race (IS) optional
  • PID-11: Patient Address (XAD) optional repeating
  • PID-12: County Code (IS) optional
  • PID-13: Phone Number - Home (XTN) optional repeating
  • PID-14: Phone Number - Business (XTN) optional repeating
  • PID-15: Primary Language (CE) optional
  • PID-16: Marital Status (IS) optional repeating
  • PID-17: Religion (IS) optional
  • PID-18: Patient Account Number (CX) optional
  • PID-19: SSN Number - Patient (ST) optional
  • PID-20: Driver's License Number (DLN) optional
  • PID-21: Mother's Identifier (CX) optional
  • PID-22: Ethnic Group (IS) optional
  • PID-23: Birth Place (ST) optional
  • PID-24: Multiple Birth Indicator (ID) optional
  • PID-25: Birth Order (NM) optional
  • PID-26: Citizenship (IS) optional
  • PID-27: Veterans Military Status (CE) optional
  • PID-28: Nationality Code (CE) optional
  • PID-29: Patient Death Date and Time (TS) optional
  • PID-30: Patient Death Indicator (ID) optional
See Also:
  • Constructor Details

  • Method Details

    • getSetIDPatientID

      Returns PID-1: "Set ID - Patient ID" - creates it if necessary
    • getPid1_SetIDPatientID

      Returns PID-1: "Set ID - Patient ID" - creates it if necessary
    • getPatientIDExternalID

      Returns PID-2: "Patient ID (External ID)" - creates it if necessary
    • getPid2_PatientIDExternalID

      Returns PID-2: "Patient ID (External ID)" - creates it if necessary
    • getPatientIDInternalID

      Returns all repetitions of Patient ID (Internal ID) (PID-3).
    • getPid3_PatientIDInternalID

      Returns all repetitions of Patient ID (Internal ID) (PID-3).
    • getPatientIDInternalIDReps

      Returns a count of the current number of repetitions of Patient ID (Internal ID) (PID-3). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getPatientIDInternalID

      public CX getPatientIDInternalID(int rep)
      Returns a specific repetition of PID-3: "Patient ID (Internal ID)" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid3_PatientIDInternalID

      public CX getPid3_PatientIDInternalID(int rep)
      Returns a specific repetition of PID-3: "Patient ID (Internal ID)" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid3_PatientIDInternalIDReps

      Returns a count of the current number of repetitions of Patient ID (Internal ID) (PID-3). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertPatientIDInternalID

      public CX insertPatientIDInternalID(int rep) throws HL7Exception
      Inserts a repetition of PID-3: "Patient ID (Internal ID)" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertPid3_PatientIDInternalID

      Inserts a repetition of PID-3: "Patient ID (Internal ID)" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePatientIDInternalID

      public CX removePatientIDInternalID(int rep) throws HL7Exception
      Removes a repetition of PID-3: "Patient ID (Internal ID)" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePid3_PatientIDInternalID

      Removes a repetition of PID-3: "Patient ID (Internal ID)" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getAlternatePatientID

      Returns PID-4: "Alternate Patient ID" - creates it if necessary
    • getPid4_AlternatePatientID

      Returns PID-4: "Alternate Patient ID" - creates it if necessary
    • getPatientName

      public XPN[] getPatientName()
      Returns all repetitions of Patient Name (PID-5).
    • getPid5_PatientName

      Returns all repetitions of Patient Name (PID-5).
    • getPatientNameReps

      public int getPatientNameReps()
      Returns a count of the current number of repetitions of Patient Name (PID-5). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getPatientName

      public XPN getPatientName(int rep)
      Returns a specific repetition of PID-5: "Patient Name" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid5_PatientName

      public XPN getPid5_PatientName(int rep)
      Returns a specific repetition of PID-5: "Patient Name" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid5_PatientNameReps

      Returns a count of the current number of repetitions of Patient Name (PID-5). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertPatientName

      public XPN insertPatientName(int rep) throws HL7Exception
      Inserts a repetition of PID-5: "Patient Name" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertPid5_PatientName

      public XPN insertPid5_PatientName(int rep) throws HL7Exception
      Inserts a repetition of PID-5: "Patient Name" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePatientName

      public XPN removePatientName(int rep) throws HL7Exception
      Removes a repetition of PID-5: "Patient Name" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePid5_PatientName

      public XPN removePid5_PatientName(int rep) throws HL7Exception
      Removes a repetition of PID-5: "Patient Name" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getMotherSMaidenName

      Returns PID-6: "Mother's Maiden Name" - creates it if necessary
    • getPid6_MotherSMaidenName

      Returns PID-6: "Mother's Maiden Name" - creates it if necessary
    • getDateOfBirth

      public TS getDateOfBirth()
      Returns PID-7: "Date of Birth" - creates it if necessary
    • getPid7_DateOfBirth

      Returns PID-7: "Date of Birth" - creates it if necessary
    • getSex

      public IS getSex()
      Returns PID-8: "Sex" - creates it if necessary
    • getPid8_Sex

      public IS getPid8_Sex()
      Returns PID-8: "Sex" - creates it if necessary
    • getPatientAlias

      public XPN[] getPatientAlias()
      Returns all repetitions of Patient Alias (PID-9).
    • getPid9_PatientAlias

      Returns all repetitions of Patient Alias (PID-9).
    • getPatientAliasReps

      public int getPatientAliasReps()
      Returns a count of the current number of repetitions of Patient Alias (PID-9). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getPatientAlias

      public XPN getPatientAlias(int rep)
      Returns a specific repetition of PID-9: "Patient Alias" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid9_PatientAlias

      public XPN getPid9_PatientAlias(int rep)
      Returns a specific repetition of PID-9: "Patient Alias" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid9_PatientAliasReps

      Returns a count of the current number of repetitions of Patient Alias (PID-9). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertPatientAlias

      public XPN insertPatientAlias(int rep) throws HL7Exception
      Inserts a repetition of PID-9: "Patient Alias" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertPid9_PatientAlias

      public XPN insertPid9_PatientAlias(int rep) throws HL7Exception
      Inserts a repetition of PID-9: "Patient Alias" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePatientAlias

      public XPN removePatientAlias(int rep) throws HL7Exception
      Removes a repetition of PID-9: "Patient Alias" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePid9_PatientAlias

      public XPN removePid9_PatientAlias(int rep) throws HL7Exception
      Removes a repetition of PID-9: "Patient Alias" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getRace

      public IS getRace()
      Returns PID-10: "Race" - creates it if necessary
    • getPid10_Race

      public IS getPid10_Race()
      Returns PID-10: "Race" - creates it if necessary
    • getPatientAddress

      public XAD[] getPatientAddress()
      Returns all repetitions of Patient Address (PID-11).
    • getPid11_PatientAddress

      Returns all repetitions of Patient Address (PID-11).
    • getPatientAddressReps

      public int getPatientAddressReps()
      Returns a count of the current number of repetitions of Patient Address (PID-11). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getPatientAddress

      public XAD getPatientAddress(int rep)
      Returns a specific repetition of PID-11: "Patient Address" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid11_PatientAddress

      public XAD getPid11_PatientAddress(int rep)
      Returns a specific repetition of PID-11: "Patient Address" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid11_PatientAddressReps

      Returns a count of the current number of repetitions of Patient Address (PID-11). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertPatientAddress

      public XAD insertPatientAddress(int rep) throws HL7Exception
      Inserts a repetition of PID-11: "Patient Address" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertPid11_PatientAddress

      public XAD insertPid11_PatientAddress(int rep) throws HL7Exception
      Inserts a repetition of PID-11: "Patient Address" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePatientAddress

      public XAD removePatientAddress(int rep) throws HL7Exception
      Removes a repetition of PID-11: "Patient Address" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePid11_PatientAddress

      public XAD removePid11_PatientAddress(int rep) throws HL7Exception
      Removes a repetition of PID-11: "Patient Address" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getCountyCode

      public IS getCountyCode()
      Returns PID-12: "County Code" - creates it if necessary
    • getPid12_CountyCode

      Returns PID-12: "County Code" - creates it if necessary
    • getPhoneNumberHome

      public XTN[] getPhoneNumberHome()
      Returns all repetitions of Phone Number - Home (PID-13).
    • getPid13_PhoneNumberHome

      Returns all repetitions of Phone Number - Home (PID-13).
    • getPhoneNumberHomeReps

      public int getPhoneNumberHomeReps()
      Returns a count of the current number of repetitions of Phone Number - Home (PID-13). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getPhoneNumberHome

      public XTN getPhoneNumberHome(int rep)
      Returns a specific repetition of PID-13: "Phone Number - Home" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid13_PhoneNumberHome

      public XTN getPid13_PhoneNumberHome(int rep)
      Returns a specific repetition of PID-13: "Phone Number - Home" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid13_PhoneNumberHomeReps

      Returns a count of the current number of repetitions of Phone Number - Home (PID-13). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertPhoneNumberHome

      public XTN insertPhoneNumberHome(int rep) throws HL7Exception
      Inserts a repetition of PID-13: "Phone Number - Home" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertPid13_PhoneNumberHome

      public XTN insertPid13_PhoneNumberHome(int rep) throws HL7Exception
      Inserts a repetition of PID-13: "Phone Number - Home" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePhoneNumberHome

      public XTN removePhoneNumberHome(int rep) throws HL7Exception
      Removes a repetition of PID-13: "Phone Number - Home" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePid13_PhoneNumberHome

      public XTN removePid13_PhoneNumberHome(int rep) throws HL7Exception
      Removes a repetition of PID-13: "Phone Number - Home" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getPhoneNumberBusiness

      Returns all repetitions of Phone Number - Business (PID-14).
    • getPid14_PhoneNumberBusiness

      Returns all repetitions of Phone Number - Business (PID-14).
    • getPhoneNumberBusinessReps

      Returns a count of the current number of repetitions of Phone Number - Business (PID-14). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getPhoneNumberBusiness

      public XTN getPhoneNumberBusiness(int rep)
      Returns a specific repetition of PID-14: "Phone Number - Business" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid14_PhoneNumberBusiness

      Returns a specific repetition of PID-14: "Phone Number - Business" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid14_PhoneNumberBusinessReps

      Returns a count of the current number of repetitions of Phone Number - Business (PID-14). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertPhoneNumberBusiness

      public XTN insertPhoneNumberBusiness(int rep) throws HL7Exception
      Inserts a repetition of PID-14: "Phone Number - Business" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertPid14_PhoneNumberBusiness

      Inserts a repetition of PID-14: "Phone Number - Business" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePhoneNumberBusiness

      public XTN removePhoneNumberBusiness(int rep) throws HL7Exception
      Removes a repetition of PID-14: "Phone Number - Business" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePid14_PhoneNumberBusiness

      Removes a repetition of PID-14: "Phone Number - Business" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getPrimaryLanguage

      Returns PID-15: "Primary Language" - creates it if necessary
    • getPid15_PrimaryLanguage

      Returns PID-15: "Primary Language" - creates it if necessary
    • getMaritalStatus

      public IS[] getMaritalStatus()
      Returns all repetitions of Marital Status (PID-16).
    • getPid16_MaritalStatus

      Returns all repetitions of Marital Status (PID-16).
    • getMaritalStatusReps

      public int getMaritalStatusReps()
      Returns a count of the current number of repetitions of Marital Status (PID-16). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getMaritalStatus

      public IS getMaritalStatus(int rep)
      Returns a specific repetition of PID-16: "Marital Status" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid16_MaritalStatus

      public IS getPid16_MaritalStatus(int rep)
      Returns a specific repetition of PID-16: "Marital Status" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid16_MaritalStatusReps

      Returns a count of the current number of repetitions of Marital Status (PID-16). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertMaritalStatus

      public IS insertMaritalStatus(int rep) throws HL7Exception
      Inserts a repetition of PID-16: "Marital Status" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertPid16_MaritalStatus

      public IS insertPid16_MaritalStatus(int rep) throws HL7Exception
      Inserts a repetition of PID-16: "Marital Status" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removeMaritalStatus

      public IS removeMaritalStatus(int rep) throws HL7Exception
      Removes a repetition of PID-16: "Marital Status" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removePid16_MaritalStatus

      public IS removePid16_MaritalStatus(int rep) throws HL7Exception
      Removes a repetition of PID-16: "Marital Status" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getReligion

      public IS getReligion()
      Returns PID-17: "Religion" - creates it if necessary
    • getPid17_Religion

      Returns PID-17: "Religion" - creates it if necessary
    • getPatientAccountNumber

      Returns PID-18: "Patient Account Number" - creates it if necessary
    • getPid18_PatientAccountNumber

      Returns PID-18: "Patient Account Number" - creates it if necessary
    • getSSNNumberPatient

      Returns PID-19: "SSN Number - Patient" - creates it if necessary
    • getPid19_SSNNumberPatient

      Returns PID-19: "SSN Number - Patient" - creates it if necessary
    • getDriverSLicenseNumber

      Returns PID-20: "Driver's License Number" - creates it if necessary
    • getPid20_DriverSLicenseNumber

      Returns PID-20: "Driver's License Number" - creates it if necessary
    • getMotherSIdentifier

      Returns PID-21: "Mother's Identifier" - creates it if necessary
    • getPid21_MotherSIdentifier

      Returns PID-21: "Mother's Identifier" - creates it if necessary
    • getEthnicGroup

      public IS getEthnicGroup()
      Returns PID-22: "Ethnic Group" - creates it if necessary
    • getPid22_EthnicGroup

      Returns PID-22: "Ethnic Group" - creates it if necessary
    • getBirthPlace

      public ST getBirthPlace()
      Returns PID-23: "Birth Place" - creates it if necessary
    • getPid23_BirthPlace

      Returns PID-23: "Birth Place" - creates it if necessary
    • getMultipleBirthIndicator

      Returns PID-24: "Multiple Birth Indicator" - creates it if necessary
    • getPid24_MultipleBirthIndicator

      Returns PID-24: "Multiple Birth Indicator" - creates it if necessary
    • getBirthOrder

      public NM getBirthOrder()
      Returns PID-25: "Birth Order" - creates it if necessary
    • getPid25_BirthOrder

      Returns PID-25: "Birth Order" - creates it if necessary
    • getCitizenship

      public IS getCitizenship()
      Returns PID-26: "Citizenship" - creates it if necessary
    • getPid26_Citizenship

      Returns PID-26: "Citizenship" - creates it if necessary
    • getVeteransMilitaryStatus

      Returns PID-27: "Veterans Military Status" - creates it if necessary
    • getPid27_VeteransMilitaryStatus

      Returns PID-27: "Veterans Military Status" - creates it if necessary
    • getNationalityCode

      Returns PID-28: "Nationality Code" - creates it if necessary
    • getPid28_NationalityCode

      Returns PID-28: "Nationality Code" - creates it if necessary
    • getPatientDeathDateAndTime

      Returns PID-29: "Patient Death Date and Time" - creates it if necessary
    • getPid29_PatientDeathDateAndTime

      Returns PID-29: "Patient Death Date and Time" - creates it if necessary
    • getPatientDeathIndicator

      Returns PID-30: "Patient Death Indicator" - creates it if necessary
    • getPid30_PatientDeathIndicator

      Returns PID-30: "Patient Death Indicator" - creates it if necessary
    • createNewTypeWithoutReflection

      protected Type createNewTypeWithoutReflection(int field)
      Overrides:
      createNewTypeWithoutReflection in class AbstractSegment