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) (CK) optional
  • PID-3: Patient ID (Internal ID) (CM_PAT_ID) repeating
  • PID-4: Alternate Patient ID (ST) optional
  • PID-5: Patient Name (PN)
  • PID-6: Mother's Maiden Name (ST) optional
  • PID-7: Date of Birth (TS) optional
  • PID-8: Sex (ID) optional
  • PID-9: Patient Alias (PN) optional repeating
  • PID-10: Race (ID) optional
  • PID-11: Patient Address (AD) optional repeating
  • PID-12: County code (ID) optional
  • PID-13: Phone Number - Home (TN) optional repeating
  • PID-14: Phone Number - Business (TN) optional repeating
  • PID-15: Language - Patient (ST) optional
  • PID-16: Marital Status (ID) optional
  • PID-17: Religion (ID) optional
  • PID-18: Patient Account Number (CK) optional
  • PID-19: Social security number - patient (ST) optional
  • PID-20: Driver's license number - patient (CM_LICENSE_NO) optional
  • PID-21: Mother's Identifier (CK) optional
  • PID-22: Ethnic Group (ID) optional
  • PID-23: Birth Place (ST) optional
  • PID-24: Multiple Birth Indicator (ID) optional
  • PID-25: Birth Order (NM) optional
  • PID-26: Citizenship (ID) optional repeating
  • PID-27: Veterans Military Status (ST) 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

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

      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

      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

      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 PN getPatientName()
      Returns PID-5: "Patient Name" - creates it if necessary
    • getPid5_PatientName

      Returns PID-5: "Patient Name" - creates it if necessary
    • 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 ID getSex()
      Returns PID-8: "Sex" - creates it if necessary
    • getPid8_Sex

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

      public PN[] 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 PN 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 PN 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 PN 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 PN 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 PN 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 PN 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 ID getRace()
      Returns PID-10: "Race" - creates it if necessary
    • getPid10_Race

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

      public AD[] 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 AD 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 AD 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 AD 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 AD 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 AD 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 AD 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 ID getCountyCode()
      Returns PID-12: "County code" - creates it if necessary
    • getPid12_CountyCode

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

      public TN[] 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 TN 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 TN 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 TN 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 TN 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 TN 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 TN 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 TN 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

      public TN getPid14_PhoneNumberBusiness(int rep)
      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 TN 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 TN 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)
    • getLanguagePatient

      Returns PID-15: "Language - Patient" - creates it if necessary
    • getPid15_LanguagePatient

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

      public ID getMaritalStatus()
      Returns PID-16: "Marital Status" - creates it if necessary
    • getPid16_MaritalStatus

      Returns PID-16: "Marital Status" - creates it if necessary
    • getReligion

      public ID 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
    • getSocialSecurityNumberPatient

      Returns PID-19: "Social security number - patient" - creates it if necessary
    • getPid19_SocialSecurityNumberPatient

      Returns PID-19: "Social security number - patient" - creates it if necessary
    • getDriverSLicenseNumberPatient

      Returns PID-20: "Driver's license number - patient" - creates it if necessary
    • getPid20_DriverSLicenseNumberPatient

      Returns PID-20: "Driver's license number - patient" - 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 ID 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 ID[] getCitizenship()
      Returns all repetitions of Citizenship (PID-26).
    • getPid26_Citizenship

      Returns all repetitions of Citizenship (PID-26).
    • getCitizenshipReps

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

      public ID getCitizenship(int rep)
      Returns a specific repetition of PID-26: "Citizenship" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid26_Citizenship

      public ID getPid26_Citizenship(int rep)
      Returns a specific repetition of PID-26: "Citizenship" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getPid26_CitizenshipReps

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

      public ID insertCitizenship(int rep) throws HL7Exception
      Inserts a repetition of PID-26: "Citizenship" 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)
    • insertPid26_Citizenship

      public ID insertPid26_Citizenship(int rep) throws HL7Exception
      Inserts a repetition of PID-26: "Citizenship" 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)
    • removeCitizenship

      public ID removeCitizenship(int rep) throws HL7Exception
      Removes a repetition of PID-26: "Citizenship" 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)
    • removePid26_Citizenship

      public ID removePid26_Citizenship(int rep) throws HL7Exception
      Removes a repetition of PID-26: "Citizenship" 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)
    • getVeteransMilitaryStatus

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

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

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