All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.uhn.hl7v2.model.v22.segment.PID Maven / Gradle / Ivy

There is a newer version: 2.3
Show newest version
/*
 * This class is an auto-generated source file for a HAPI
 * HL7 v2.x standard structure class.
 *
 * For more information, visit: http://hl7api.sourceforge.net/
 */

package ca.uhn.hl7v2.model.v22.segment;

// import ca.uhn.hl7v2.model.v22.group.*;
import ca.uhn.hl7v2.model.v22.datatype.*;
import ca.uhn.log.HapiLogFactory;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.parser.ModelClassFactory;
import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
import ca.uhn.hl7v2.model.AbstractMessage;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Varies;

/**
 *

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 *
*/ public class PID extends AbstractSegment { /** * Creates a new PID segment */ public PID(Group parent, ModelClassFactory factory) { super(parent, factory); init(factory); } private void init(ModelClassFactory factory) { try { this.add(SI.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - Patient ID"); this.add(CK.class, false, 1, 16, new Object[]{ getMessage(), new Integer(0) }, "Patient ID (External ID)"); this.add(CM_PAT_ID.class, true, 0, 20, new Object[]{ getMessage(), new Integer(0) }, "Patient ID (Internal ID)"); this.add(ST.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Alternate Patient ID"); this.add(PN.class, true, 1, 48, new Object[]{ getMessage(), new Integer(0) }, "Patient Name"); this.add(ST.class, false, 1, 30, new Object[]{ getMessage(), new Integer(0) }, "Mother's Maiden Name"); this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date of Birth"); this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Sex"); this.add(PN.class, false, 0, 48, new Object[]{ getMessage(), new Integer(0) }, "Patient Alias"); this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Race"); this.add(AD.class, false, 3, 106, new Object[]{ getMessage(), new Integer(0) }, "Patient Address"); this.add(ID.class, false, 1, 4, new Object[]{ getMessage() }, "County code"); this.add(TN.class, false, 3, 40, new Object[]{ getMessage(), new Integer(0) }, "Phone Number - Home"); this.add(TN.class, false, 3, 40, new Object[]{ getMessage(), new Integer(0) }, "Phone Number - Business"); this.add(ST.class, false, 1, 25, new Object[]{ getMessage(), new Integer(0) }, "Language - Patient"); this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Marital Status"); this.add(ID.class, false, 1, 3, new Object[]{ getMessage() }, "Religion"); this.add(CK.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Patient Account Number"); this.add(ST.class, false, 1, 16, new Object[]{ getMessage(), new Integer(0) }, "Social security number - patient"); this.add(CM_LICENSE_NO.class, false, 1, 25, new Object[]{ getMessage(), new Integer(0) }, "Driver's license number - patient"); this.add(CK.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Mother's Identifier"); this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Ethnic Group"); this.add(ST.class, false, 1, 25, new Object[]{ getMessage(), new Integer(0) }, "Birth Place"); this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Multiple Birth Indicator"); this.add(NM.class, false, 1, 2, new Object[]{ getMessage(), new Integer(0) }, "Birth Order"); this.add(ID.class, false, 0, 3, new Object[]{ getMessage() }, "Citizenship"); this.add(ST.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Veterans Military Status"); } catch(HL7Exception e) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PID - this is probably a bug in the source code generator.", e); } } /** * Returns * PID-1: "Set ID - Patient ID" - creates it if necessary */ public SI getSetIDPatientID() { SI ret = null; try { Type t = this.getField(1, 0); ret = (SI)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-1: "Set ID - Patient ID" - creates it if necessary */ public SI getPid1_SetIDPatientID() { SI ret = null; try { Type t = this.getField(1, 0); ret = (SI)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-2: "Patient ID (External ID)" - creates it if necessary */ public CK getPatientIDExternalID() { CK ret = null; try { Type t = this.getField(2, 0); ret = (CK)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-2: "Patient ID (External ID)" - creates it if necessary */ public CK getPid2_PatientIDExternalID() { CK ret = null; try { Type t = this.getField(2, 0); ret = (CK)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns all repetitions of Patient ID (Internal ID) (PID-3). */ public CM_PAT_ID[] getPatientIDInternalID() { CM_PAT_ID[] ret = null; try { Type[] t = this.getField(3); ret = new CM_PAT_ID[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (CM_PAT_ID)t[i]; } } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPatientIDInternalIDReps() { CM_PAT_ID[] ret = null; try { Type[] t = this.getField(3); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Returns a specific repetition of * PID-3: "Patient ID (Internal ID)" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public CM_PAT_ID getPatientIDInternalID(int rep) { CM_PAT_ID ret = null; try { Type t = this.getField(3, rep); ret = (CM_PAT_ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns a specific repetition of * PID-3: "Patient ID (Internal ID)" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public CM_PAT_ID getPid3_PatientIDInternalID(int rep) { CM_PAT_ID ret = null; try { Type t = this.getField(3, rep); ret = (CM_PAT_ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPid3_PatientIDInternalIDReps() { CM_PAT_ID[] ret = null; try { Type[] t = this.getField(3); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Inserts a repetition of * PID-3: "Patient ID (Internal ID)" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public CM_PAT_ID insertPatientIDInternalID(int rep) throws HL7Exception { return (CM_PAT_ID) super.insertRepetition(3, rep); } /** * Inserts a repetition of * PID-3: "Patient ID (Internal ID)" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public CM_PAT_ID insertPid3_PatientIDInternalID(int rep) throws HL7Exception { return (CM_PAT_ID) super.insertRepetition(3, rep); } /** * Removes a repetition of * PID-3: "Patient ID (Internal ID)" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public CM_PAT_ID removePatientIDInternalID(int rep) throws HL7Exception { return (CM_PAT_ID) super.removeRepetition(3, rep); } /** * Removes a repetition of * PID-3: "Patient ID (Internal ID)" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public CM_PAT_ID removePid3_PatientIDInternalID(int rep) throws HL7Exception { return (CM_PAT_ID) super.removeRepetition(3, rep); } /** * Returns * PID-4: "Alternate Patient ID" - creates it if necessary */ public ST getAlternatePatientID() { ST ret = null; try { Type t = this.getField(4, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-4: "Alternate Patient ID" - creates it if necessary */ public ST getPid4_AlternatePatientID() { ST ret = null; try { Type t = this.getField(4, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-5: "Patient Name" - creates it if necessary */ public PN getPatientName() { PN ret = null; try { Type t = this.getField(5, 0); ret = (PN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-5: "Patient Name" - creates it if necessary */ public PN getPid5_PatientName() { PN ret = null; try { Type t = this.getField(5, 0); ret = (PN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-6: "Mother's Maiden Name" - creates it if necessary */ public ST getMotherSMaidenName() { ST ret = null; try { Type t = this.getField(6, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-6: "Mother's Maiden Name" - creates it if necessary */ public ST getPid6_MotherSMaidenName() { ST ret = null; try { Type t = this.getField(6, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-7: "Date of Birth" - creates it if necessary */ public TS getDateOfBirth() { TS ret = null; try { Type t = this.getField(7, 0); ret = (TS)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-7: "Date of Birth" - creates it if necessary */ public TS getPid7_DateOfBirth() { TS ret = null; try { Type t = this.getField(7, 0); ret = (TS)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-8: "Sex" - creates it if necessary */ public ID getSex() { ID ret = null; try { Type t = this.getField(8, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-8: "Sex" - creates it if necessary */ public ID getPid8_Sex() { ID ret = null; try { Type t = this.getField(8, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns all repetitions of Patient Alias (PID-9). */ public PN[] getPatientAlias() { PN[] ret = null; try { Type[] t = this.getField(9); ret = new PN[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (PN)t[i]; } } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPatientAliasReps() { PN[] ret = null; try { Type[] t = this.getField(9); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Returns a specific repetition of * PID-9: "Patient Alias" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public PN getPatientAlias(int rep) { PN ret = null; try { Type t = this.getField(9, rep); ret = (PN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns a specific repetition of * PID-9: "Patient Alias" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public PN getPid9_PatientAlias(int rep) { PN ret = null; try { Type t = this.getField(9, rep); ret = (PN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPid9_PatientAliasReps() { PN[] ret = null; try { Type[] t = this.getField(9); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Inserts a repetition of * PID-9: "Patient Alias" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public PN insertPatientAlias(int rep) throws HL7Exception { return (PN) super.insertRepetition(9, rep); } /** * Inserts a repetition of * PID-9: "Patient Alias" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public PN insertPid9_PatientAlias(int rep) throws HL7Exception { return (PN) super.insertRepetition(9, rep); } /** * Removes a repetition of * PID-9: "Patient Alias" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public PN removePatientAlias(int rep) throws HL7Exception { return (PN) super.removeRepetition(9, rep); } /** * Removes a repetition of * PID-9: "Patient Alias" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public PN removePid9_PatientAlias(int rep) throws HL7Exception { return (PN) super.removeRepetition(9, rep); } /** * Returns * PID-10: "Race" - creates it if necessary */ public ID getRace() { ID ret = null; try { Type t = this.getField(10, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-10: "Race" - creates it if necessary */ public ID getPid10_Race() { ID ret = null; try { Type t = this.getField(10, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns all repetitions of Patient Address (PID-11). */ public AD[] getPatientAddress() { AD[] ret = null; try { Type[] t = this.getField(11); ret = new AD[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (AD)t[i]; } } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPatientAddressReps() { AD[] ret = null; try { Type[] t = this.getField(11); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Returns a specific repetition of * PID-11: "Patient Address" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public AD getPatientAddress(int rep) { AD ret = null; try { Type t = this.getField(11, rep); ret = (AD)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns a specific repetition of * PID-11: "Patient Address" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public AD getPid11_PatientAddress(int rep) { AD ret = null; try { Type t = this.getField(11, rep); ret = (AD)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPid11_PatientAddressReps() { AD[] ret = null; try { Type[] t = this.getField(11); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Inserts a repetition of * PID-11: "Patient Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public AD insertPatientAddress(int rep) throws HL7Exception { return (AD) super.insertRepetition(11, rep); } /** * Inserts a repetition of * PID-11: "Patient Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public AD insertPid11_PatientAddress(int rep) throws HL7Exception { return (AD) super.insertRepetition(11, rep); } /** * Removes a repetition of * PID-11: "Patient Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public AD removePatientAddress(int rep) throws HL7Exception { return (AD) super.removeRepetition(11, rep); } /** * Removes a repetition of * PID-11: "Patient Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public AD removePid11_PatientAddress(int rep) throws HL7Exception { return (AD) super.removeRepetition(11, rep); } /** * Returns * PID-12: "County code" - creates it if necessary */ public ID getCountyCode() { ID ret = null; try { Type t = this.getField(12, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-12: "County code" - creates it if necessary */ public ID getPid12_CountyCode() { ID ret = null; try { Type t = this.getField(12, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns all repetitions of Phone Number - Home (PID-13). */ public TN[] getPhoneNumberHome() { TN[] ret = null; try { Type[] t = this.getField(13); ret = new TN[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (TN)t[i]; } } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPhoneNumberHomeReps() { TN[] ret = null; try { Type[] t = this.getField(13); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Returns a specific repetition of * PID-13: "Phone Number - Home" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public TN getPhoneNumberHome(int rep) { TN ret = null; try { Type t = this.getField(13, rep); ret = (TN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns a specific repetition of * PID-13: "Phone Number - Home" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public TN getPid13_PhoneNumberHome(int rep) { TN ret = null; try { Type t = this.getField(13, rep); ret = (TN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPid13_PhoneNumberHomeReps() { TN[] ret = null; try { Type[] t = this.getField(13); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Inserts a repetition of * PID-13: "Phone Number - Home" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN insertPhoneNumberHome(int rep) throws HL7Exception { return (TN) super.insertRepetition(13, rep); } /** * Inserts a repetition of * PID-13: "Phone Number - Home" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN insertPid13_PhoneNumberHome(int rep) throws HL7Exception { return (TN) super.insertRepetition(13, rep); } /** * Removes a repetition of * PID-13: "Phone Number - Home" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN removePhoneNumberHome(int rep) throws HL7Exception { return (TN) super.removeRepetition(13, rep); } /** * Removes a repetition of * PID-13: "Phone Number - Home" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN removePid13_PhoneNumberHome(int rep) throws HL7Exception { return (TN) super.removeRepetition(13, rep); } /** * Returns all repetitions of Phone Number - Business (PID-14). */ public TN[] getPhoneNumberBusiness() { TN[] ret = null; try { Type[] t = this.getField(14); ret = new TN[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (TN)t[i]; } } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPhoneNumberBusinessReps() { TN[] ret = null; try { Type[] t = this.getField(14); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Returns a specific repetition of * PID-14: "Phone Number - Business" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public TN getPhoneNumberBusiness(int rep) { TN ret = null; try { Type t = this.getField(14, rep); ret = (TN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns a specific repetition of * PID-14: "Phone Number - Business" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public TN getPid14_PhoneNumberBusiness(int rep) { TN ret = null; try { Type t = this.getField(14, rep); ret = (TN)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPid14_PhoneNumberBusinessReps() { TN[] ret = null; try { Type[] t = this.getField(14); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Inserts a repetition of * PID-14: "Phone Number - Business" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN insertPhoneNumberBusiness(int rep) throws HL7Exception { return (TN) super.insertRepetition(14, rep); } /** * Inserts a repetition of * PID-14: "Phone Number - Business" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN insertPid14_PhoneNumberBusiness(int rep) throws HL7Exception { return (TN) super.insertRepetition(14, rep); } /** * Removes a repetition of * PID-14: "Phone Number - Business" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN removePhoneNumberBusiness(int rep) throws HL7Exception { return (TN) super.removeRepetition(14, rep); } /** * Removes a repetition of * PID-14: "Phone Number - Business" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public TN removePid14_PhoneNumberBusiness(int rep) throws HL7Exception { return (TN) super.removeRepetition(14, rep); } /** * Returns * PID-15: "Language - Patient" - creates it if necessary */ public ST getLanguagePatient() { ST ret = null; try { Type t = this.getField(15, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-15: "Language - Patient" - creates it if necessary */ public ST getPid15_LanguagePatient() { ST ret = null; try { Type t = this.getField(15, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-16: "Marital Status" - creates it if necessary */ public ID getMaritalStatus() { ID ret = null; try { Type t = this.getField(16, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-16: "Marital Status" - creates it if necessary */ public ID getPid16_MaritalStatus() { ID ret = null; try { Type t = this.getField(16, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-17: "Religion" - creates it if necessary */ public ID getReligion() { ID ret = null; try { Type t = this.getField(17, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-17: "Religion" - creates it if necessary */ public ID getPid17_Religion() { ID ret = null; try { Type t = this.getField(17, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-18: "Patient Account Number" - creates it if necessary */ public CK getPatientAccountNumber() { CK ret = null; try { Type t = this.getField(18, 0); ret = (CK)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-18: "Patient Account Number" - creates it if necessary */ public CK getPid18_PatientAccountNumber() { CK ret = null; try { Type t = this.getField(18, 0); ret = (CK)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-19: "Social security number - patient" - creates it if necessary */ public ST getSocialSecurityNumberPatient() { ST ret = null; try { Type t = this.getField(19, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-19: "Social security number - patient" - creates it if necessary */ public ST getPid19_SocialSecurityNumberPatient() { ST ret = null; try { Type t = this.getField(19, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-20: "Driver's license number - patient" - creates it if necessary */ public CM_LICENSE_NO getDriverSLicenseNumberPatient() { CM_LICENSE_NO ret = null; try { Type t = this.getField(20, 0); ret = (CM_LICENSE_NO)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-20: "Driver's license number - patient" - creates it if necessary */ public CM_LICENSE_NO getPid20_DriverSLicenseNumberPatient() { CM_LICENSE_NO ret = null; try { Type t = this.getField(20, 0); ret = (CM_LICENSE_NO)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-21: "Mother's Identifier" - creates it if necessary */ public CK getMotherSIdentifier() { CK ret = null; try { Type t = this.getField(21, 0); ret = (CK)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-21: "Mother's Identifier" - creates it if necessary */ public CK getPid21_MotherSIdentifier() { CK ret = null; try { Type t = this.getField(21, 0); ret = (CK)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-22: "Ethnic Group" - creates it if necessary */ public ID getEthnicGroup() { ID ret = null; try { Type t = this.getField(22, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-22: "Ethnic Group" - creates it if necessary */ public ID getPid22_EthnicGroup() { ID ret = null; try { Type t = this.getField(22, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-23: "Birth Place" - creates it if necessary */ public ST getBirthPlace() { ST ret = null; try { Type t = this.getField(23, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-23: "Birth Place" - creates it if necessary */ public ST getPid23_BirthPlace() { ST ret = null; try { Type t = this.getField(23, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-24: "Multiple Birth Indicator" - creates it if necessary */ public ID getMultipleBirthIndicator() { ID ret = null; try { Type t = this.getField(24, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-24: "Multiple Birth Indicator" - creates it if necessary */ public ID getPid24_MultipleBirthIndicator() { ID ret = null; try { Type t = this.getField(24, 0); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-25: "Birth Order" - creates it if necessary */ public NM getBirthOrder() { NM ret = null; try { Type t = this.getField(25, 0); ret = (NM)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-25: "Birth Order" - creates it if necessary */ public NM getPid25_BirthOrder() { NM ret = null; try { Type t = this.getField(25, 0); ret = (NM)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns all repetitions of Citizenship (PID-26). */ public ID[] getCitizenship() { ID[] ret = null; try { Type[] t = this.getField(26); ret = new ID[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (ID)t[i]; } } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getCitizenshipReps() { ID[] ret = null; try { Type[] t = this.getField(26); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Returns a specific repetition of * PID-26: "Citizenship" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public ID getCitizenship(int rep) { ID ret = null; try { Type t = this.getField(26, rep); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns a specific repetition of * PID-26: "Citizenship" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public ID getPid26_Citizenship(int rep) { ID ret = null; try { Type t = this.getField(26, rep); ret = (ID)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * 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. */ public int getPid26_CitizenshipReps() { ID[] ret = null; try { Type[] t = this.getField(26); return t.length; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } } /** * Inserts a repetition of * PID-26: "Citizenship" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public ID insertCitizenship(int rep) throws HL7Exception { return (ID) super.insertRepetition(26, rep); } /** * Inserts a repetition of * PID-26: "Citizenship" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public ID insertPid26_Citizenship(int rep) throws HL7Exception { return (ID) super.insertRepetition(26, rep); } /** * Removes a repetition of * PID-26: "Citizenship" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public ID removeCitizenship(int rep) throws HL7Exception { return (ID) super.removeRepetition(26, rep); } /** * Removes a repetition of * PID-26: "Citizenship" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public ID removePid26_Citizenship(int rep) throws HL7Exception { return (ID) super.removeRepetition(26, rep); } /** * Returns * PID-27: "Veterans Military Status" - creates it if necessary */ public ST getVeteransMilitaryStatus() { ST ret = null; try { Type t = this.getField(27, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * PID-27: "Veterans Military Status" - creates it if necessary */ public ST getPid27_VeteransMilitaryStatus() { ST ret = null; try { Type t = this.getField(27, 0); ret = (ST)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** {@inheritDoc} */ protected Type createNewTypeWithoutReflection(int field) { switch (field) { case 0: return new SI(getMessage()); case 1: return new CK(getMessage()); case 2: return new CM_PAT_ID(getMessage()); case 3: return new ST(getMessage()); case 4: return new PN(getMessage()); case 5: return new ST(getMessage()); case 6: return new TS(getMessage()); case 7: return new ID(getMessage(), new Integer( 1 )); case 8: return new PN(getMessage()); case 9: return new ID(getMessage(), new Integer( 5 )); case 10: return new AD(getMessage()); case 11: return new ID(getMessage(), new Integer( 0 )); case 12: return new TN(getMessage()); case 13: return new TN(getMessage()); case 14: return new ST(getMessage()); case 15: return new ID(getMessage(), new Integer( 2 )); case 16: return new ID(getMessage(), new Integer( 6 )); case 17: return new CK(getMessage()); case 18: return new ST(getMessage()); case 19: return new CM_LICENSE_NO(getMessage()); case 20: return new CK(getMessage()); case 21: return new ID(getMessage(), new Integer( 189 )); case 22: return new ST(getMessage()); case 23: return new ID(getMessage(), new Integer( 0 )); case 24: return new NM(getMessage()); case 25: return new ID(getMessage(), new Integer( 171 )); case 26: return new ST(getMessage()); default: return null; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy