ca.uhn.hl7v2.model.v231.segment.PD1 Maven / Gradle / Ivy
/*
* 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.v231.segment;
// import ca.uhn.hl7v2.model.v231.group.*;
import ca.uhn.hl7v2.model.v231.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 PD1 message segment (PD1 - patient additional demographic segment).
* This segment has the following fields:
*
* - PD1-1: Living Dependency (IS) optional repeating
*
- PD1-2: Living Arrangement (IS) optional
*
- PD1-3: Patient Primary Facility (XON) optional repeating
*
- PD1-4: Patient Primary Care Provider Name & ID No. (XCN) optional repeating
*
- PD1-5: Student Indicator (IS) optional
*
- PD1-6: Handicap (IS) optional
*
- PD1-7: Living Will (IS) optional
*
- PD1-8: Organ Donor (IS) optional
*
- PD1-9: Separate Bill (ID) optional
*
- PD1-10: Duplicate Patient (CX) optional repeating
*
- PD1-11: Publicity Code (CE) optional
*
- PD1-12: Protection Indicator (ID) optional
*
*/
public class PD1 extends AbstractSegment {
/**
* Creates a new PD1 segment
*/
public PD1(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(IS.class, false, 0, 2, new Object[]{ getMessage() }, "Living Dependency");
this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Living Arrangement");
this.add(XON.class, false, 0, 90, new Object[]{ getMessage(), new Integer(0) }, "Patient Primary Facility");
this.add(XCN.class, false, 0, 90, new Object[]{ getMessage(), new Integer(0) }, "Patient Primary Care Provider Name & ID No.");
this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Student Indicator");
this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Handicap");
this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Living Will");
this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Organ Donor");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Separate Bill");
this.add(CX.class, false, 0, 20, new Object[]{ getMessage(), new Integer(0) }, "Duplicate Patient");
this.add(CE.class, false, 1, 80, new Object[]{ getMessage(), new Integer(215) }, "Publicity Code");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Protection Indicator");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PD1 - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns all repetitions of Living Dependency (PD1-1).
*/
public IS[] getLivingDependency() {
IS[] ret = null;
try {
Type[] t = this.getField(1);
ret = new IS[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (IS)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 Living Dependency (PD1-1).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getLivingDependencyReps() {
IS[] ret = null;
try {
Type[] t = this.getField(1);
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
* PD1-1: "Living Dependency" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public IS getLivingDependency(int rep) {
IS ret = null;
try {
Type t = this.getField(1, rep);
ret = (IS)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
* PD1-1: "Living Dependency" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public IS getPd11_LivingDependency(int rep) {
IS ret = null;
try {
Type t = this.getField(1, rep);
ret = (IS)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 Living Dependency (PD1-1).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPd11_LivingDependencyReps() {
IS[] ret = null;
try {
Type[] t = this.getField(1);
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
* PD1-1: "Living Dependency" 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 IS insertLivingDependency(int rep) throws HL7Exception {
return (IS) super.insertRepetition(1, rep);
}
/**
* Inserts a repetition of
* PD1-1: "Living Dependency" 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 IS insertPd11_LivingDependency(int rep) throws HL7Exception {
return (IS) super.insertRepetition(1, rep);
}
/**
* Removes a repetition of
* PD1-1: "Living Dependency" 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 IS removeLivingDependency(int rep) throws HL7Exception {
return (IS) super.removeRepetition(1, rep);
}
/**
* Removes a repetition of
* PD1-1: "Living Dependency" 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 IS removePd11_LivingDependency(int rep) throws HL7Exception {
return (IS) super.removeRepetition(1, rep);
}
/**
* Returns
* PD1-2: "Living Arrangement" - creates it if necessary
*/
public IS getLivingArrangement() {
IS ret = null;
try {
Type t = this.getField(2, 0);
ret = (IS)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
* PD1-2: "Living Arrangement" - creates it if necessary
*/
public IS getPd12_LivingArrangement() {
IS ret = null;
try {
Type t = this.getField(2, 0);
ret = (IS)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 Primary Facility (PD1-3).
*/
public XON[] getPatientPrimaryFacility() {
XON[] ret = null;
try {
Type[] t = this.getField(3);
ret = new XON[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (XON)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 Primary Facility (PD1-3).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPatientPrimaryFacilityReps() {
XON[] 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
* PD1-3: "Patient Primary Facility" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public XON getPatientPrimaryFacility(int rep) {
XON ret = null;
try {
Type t = this.getField(3, rep);
ret = (XON)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
* PD1-3: "Patient Primary Facility" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public XON getPd13_PatientPrimaryFacility(int rep) {
XON ret = null;
try {
Type t = this.getField(3, rep);
ret = (XON)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 Primary Facility (PD1-3).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPd13_PatientPrimaryFacilityReps() {
XON[] 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
* PD1-3: "Patient Primary Facility" 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 XON insertPatientPrimaryFacility(int rep) throws HL7Exception {
return (XON) super.insertRepetition(3, rep);
}
/**
* Inserts a repetition of
* PD1-3: "Patient Primary Facility" 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 XON insertPd13_PatientPrimaryFacility(int rep) throws HL7Exception {
return (XON) super.insertRepetition(3, rep);
}
/**
* Removes a repetition of
* PD1-3: "Patient Primary Facility" 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 XON removePatientPrimaryFacility(int rep) throws HL7Exception {
return (XON) super.removeRepetition(3, rep);
}
/**
* Removes a repetition of
* PD1-3: "Patient Primary Facility" 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 XON removePd13_PatientPrimaryFacility(int rep) throws HL7Exception {
return (XON) super.removeRepetition(3, rep);
}
/**
* Returns all repetitions of Patient Primary Care Provider Name & ID No. (PD1-4).
*/
public XCN[] getPatientPrimaryCareProviderNameIDNo() {
XCN[] ret = null;
try {
Type[] t = this.getField(4);
ret = new XCN[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (XCN)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 Primary Care Provider Name & ID No. (PD1-4).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPatientPrimaryCareProviderNameIDNoReps() {
XCN[] ret = null;
try {
Type[] t = this.getField(4);
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
* PD1-4: "Patient Primary Care Provider Name & ID No." - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public XCN getPatientPrimaryCareProviderNameIDNo(int rep) {
XCN ret = null;
try {
Type t = this.getField(4, rep);
ret = (XCN)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
* PD1-4: "Patient Primary Care Provider Name & ID No." - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public XCN getPd14_PatientPrimaryCareProviderNameIDNo(int rep) {
XCN ret = null;
try {
Type t = this.getField(4, rep);
ret = (XCN)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 Primary Care Provider Name & ID No. (PD1-4).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPd14_PatientPrimaryCareProviderNameIDNoReps() {
XCN[] ret = null;
try {
Type[] t = this.getField(4);
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
* PD1-4: "Patient Primary Care Provider Name & ID No." 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 XCN insertPatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception {
return (XCN) super.insertRepetition(4, rep);
}
/**
* Inserts a repetition of
* PD1-4: "Patient Primary Care Provider Name & ID No." 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 XCN insertPd14_PatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception {
return (XCN) super.insertRepetition(4, rep);
}
/**
* Removes a repetition of
* PD1-4: "Patient Primary Care Provider Name & ID No." 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 XCN removePatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception {
return (XCN) super.removeRepetition(4, rep);
}
/**
* Removes a repetition of
* PD1-4: "Patient Primary Care Provider Name & ID No." 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 XCN removePd14_PatientPrimaryCareProviderNameIDNo(int rep) throws HL7Exception {
return (XCN) super.removeRepetition(4, rep);
}
/**
* Returns
* PD1-5: "Student Indicator" - creates it if necessary
*/
public IS getStudentIndicator() {
IS ret = null;
try {
Type t = this.getField(5, 0);
ret = (IS)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
* PD1-5: "Student Indicator" - creates it if necessary
*/
public IS getPd15_StudentIndicator() {
IS ret = null;
try {
Type t = this.getField(5, 0);
ret = (IS)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
* PD1-6: "Handicap" - creates it if necessary
*/
public IS getHandicap() {
IS ret = null;
try {
Type t = this.getField(6, 0);
ret = (IS)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
* PD1-6: "Handicap" - creates it if necessary
*/
public IS getPd16_Handicap() {
IS ret = null;
try {
Type t = this.getField(6, 0);
ret = (IS)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
* PD1-7: "Living Will" - creates it if necessary
*/
public IS getLivingWill() {
IS ret = null;
try {
Type t = this.getField(7, 0);
ret = (IS)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
* PD1-7: "Living Will" - creates it if necessary
*/
public IS getPd17_LivingWill() {
IS ret = null;
try {
Type t = this.getField(7, 0);
ret = (IS)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
* PD1-8: "Organ Donor" - creates it if necessary
*/
public IS getOrganDonor() {
IS ret = null;
try {
Type t = this.getField(8, 0);
ret = (IS)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
* PD1-8: "Organ Donor" - creates it if necessary
*/
public IS getPd18_OrganDonor() {
IS ret = null;
try {
Type t = this.getField(8, 0);
ret = (IS)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
* PD1-9: "Separate Bill" - creates it if necessary
*/
public ID getSeparateBill() {
ID ret = null;
try {
Type t = this.getField(9, 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
* PD1-9: "Separate Bill" - creates it if necessary
*/
public ID getPd19_SeparateBill() {
ID ret = null;
try {
Type t = this.getField(9, 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 Duplicate Patient (PD1-10).
*/
public CX[] getDuplicatePatient() {
CX[] ret = null;
try {
Type[] t = this.getField(10);
ret = new CX[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CX)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 Duplicate Patient (PD1-10).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getDuplicatePatientReps() {
CX[] ret = null;
try {
Type[] t = this.getField(10);
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
* PD1-10: "Duplicate Patient" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CX getDuplicatePatient(int rep) {
CX ret = null;
try {
Type t = this.getField(10, rep);
ret = (CX)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
* PD1-10: "Duplicate Patient" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CX getPd110_DuplicatePatient(int rep) {
CX ret = null;
try {
Type t = this.getField(10, rep);
ret = (CX)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 Duplicate Patient (PD1-10).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPd110_DuplicatePatientReps() {
CX[] ret = null;
try {
Type[] t = this.getField(10);
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
* PD1-10: "Duplicate Patient" 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 CX insertDuplicatePatient(int rep) throws HL7Exception {
return (CX) super.insertRepetition(10, rep);
}
/**
* Inserts a repetition of
* PD1-10: "Duplicate Patient" 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 CX insertPd110_DuplicatePatient(int rep) throws HL7Exception {
return (CX) super.insertRepetition(10, rep);
}
/**
* Removes a repetition of
* PD1-10: "Duplicate Patient" 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 CX removeDuplicatePatient(int rep) throws HL7Exception {
return (CX) super.removeRepetition(10, rep);
}
/**
* Removes a repetition of
* PD1-10: "Duplicate Patient" 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 CX removePd110_DuplicatePatient(int rep) throws HL7Exception {
return (CX) super.removeRepetition(10, rep);
}
/**
* Returns
* PD1-11: "Publicity Code" - creates it if necessary
*/
public CE getPublicityCode() {
CE ret = null;
try {
Type t = this.getField(11, 0);
ret = (CE)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
* PD1-11: "Publicity Code" - creates it if necessary
*/
public CE getPd111_PublicityCode() {
CE ret = null;
try {
Type t = this.getField(11, 0);
ret = (CE)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
* PD1-12: "Protection Indicator" - creates it if necessary
*/
public ID getProtectionIndicator() {
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
* PD1-12: "Protection Indicator" - creates it if necessary
*/
public ID getPd112_ProtectionIndicator() {
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;
}
/** {@inheritDoc} */
protected Type createNewTypeWithoutReflection(int field) {
switch (field) {
case 0: return new IS(getMessage(), new Integer( 223 ));
case 1: return new IS(getMessage(), new Integer( 220 ));
case 2: return new XON(getMessage());
case 3: return new XCN(getMessage());
case 4: return new IS(getMessage(), new Integer( 231 ));
case 5: return new IS(getMessage(), new Integer( 295 ));
case 6: return new IS(getMessage(), new Integer( 315 ));
case 7: return new IS(getMessage(), new Integer( 316 ));
case 8: return new ID(getMessage(), new Integer( 136 ));
case 9: return new CX(getMessage());
case 10: return new CE(getMessage());
case 11: return new ID(getMessage(), new Integer( 136 ));
default: return null;
}
}
}