ca.uhn.hl7v2.model.v25.segment.BPO 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.v25.segment;
// import ca.uhn.hl7v2.model.v25.group.*;
import ca.uhn.hl7v2.model.v25.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 BPO message segment (Blood product order).
* This segment has the following fields:
*
* - BPO-1: Set ID _ BPO (SI)
*
- BPO-2: BP Universal Service ID (CWE)
*
- BPO-3: BP Processing Requirements (CWE) optional repeating
*
- BPO-4: BP Quantity (NM)
*
- BPO-5: BP Amount (NM) optional
*
- BPO-6: BP Units (CE) optional
*
- BPO-7: BP Intended Use Date/Time (TS) optional
*
- BPO-8: BP Intended Dispense From Location (PL) optional
*
- BPO-9: BP Intended Dispense From Address (XAD) optional
*
- BPO-10: BP Requested Dispense Date/Time (TS) optional
*
- BPO-11: BP Requested Dispense To Location (PL) optional
*
- BPO-12: BP Requested Dispense To Address (XAD) optional
*
- BPO-13: BP Indication for Use (CWE) optional repeating
*
- BPO-14: BP Informed Consent Indicator (ID) optional
*
*/
public class BPO extends AbstractSegment {
/**
* Creates a new BPO segment
*/
public BPO(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(SI.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID _ BPO");
this.add(CWE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "BP Universal Service ID");
this.add(CWE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(508) }, "BP Processing Requirements");
this.add(NM.class, true, 1, 5, new Object[]{ getMessage(), new Integer(0) }, "BP Quantity");
this.add(NM.class, false, 1, 5, new Object[]{ getMessage(), new Integer(0) }, "BP Amount");
this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "BP Units");
this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "BP Intended Use Date/Time");
this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "BP Intended Dispense From Location");
this.add(XAD.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "BP Intended Dispense From Address");
this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "BP Requested Dispense Date/Time");
this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "BP Requested Dispense To Location");
this.add(XAD.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "BP Requested Dispense To Address");
this.add(CWE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(509) }, "BP Indication for Use");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "BP Informed Consent Indicator");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating BPO - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns
* BPO-1: "Set ID _ BPO" - creates it if necessary
*/
public SI getSetIDBPO() {
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
* BPO-1: "Set ID _ BPO" - creates it if necessary
*/
public SI getBpo1_SetIDBPO() {
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
* BPO-2: "BP Universal Service ID" - creates it if necessary
*/
public CWE getBPUniversalServiceID() {
CWE ret = null;
try {
Type t = this.getField(2, 0);
ret = (CWE)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
* BPO-2: "BP Universal Service ID" - creates it if necessary
*/
public CWE getBpo2_BPUniversalServiceID() {
CWE ret = null;
try {
Type t = this.getField(2, 0);
ret = (CWE)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 BP Processing Requirements (BPO-3).
*/
public CWE[] getBPProcessingRequirements() {
CWE[] ret = null;
try {
Type[] t = this.getField(3);
ret = new CWE[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CWE)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 BP Processing Requirements (BPO-3).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getBPProcessingRequirementsReps() {
CWE[] 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
* BPO-3: "BP Processing Requirements" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CWE getBPProcessingRequirements(int rep) {
CWE ret = null;
try {
Type t = this.getField(3, rep);
ret = (CWE)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
* BPO-3: "BP Processing Requirements" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CWE getBpo3_BPProcessingRequirements(int rep) {
CWE ret = null;
try {
Type t = this.getField(3, rep);
ret = (CWE)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 BP Processing Requirements (BPO-3).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getBpo3_BPProcessingRequirementsReps() {
CWE[] 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
* BPO-3: "BP Processing Requirements" 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 CWE insertBPProcessingRequirements(int rep) throws HL7Exception {
return (CWE) super.insertRepetition(3, rep);
}
/**
* Inserts a repetition of
* BPO-3: "BP Processing Requirements" 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 CWE insertBpo3_BPProcessingRequirements(int rep) throws HL7Exception {
return (CWE) super.insertRepetition(3, rep);
}
/**
* Removes a repetition of
* BPO-3: "BP Processing Requirements" 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 CWE removeBPProcessingRequirements(int rep) throws HL7Exception {
return (CWE) super.removeRepetition(3, rep);
}
/**
* Removes a repetition of
* BPO-3: "BP Processing Requirements" 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 CWE removeBpo3_BPProcessingRequirements(int rep) throws HL7Exception {
return (CWE) super.removeRepetition(3, rep);
}
/**
* Returns
* BPO-4: "BP Quantity" - creates it if necessary
*/
public NM getBPQuantity() {
NM ret = null;
try {
Type t = this.getField(4, 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
* BPO-4: "BP Quantity" - creates it if necessary
*/
public NM getBpo4_BPQuantity() {
NM ret = null;
try {
Type t = this.getField(4, 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
* BPO-5: "BP Amount" - creates it if necessary
*/
public NM getBPAmount() {
NM ret = null;
try {
Type t = this.getField(5, 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
* BPO-5: "BP Amount" - creates it if necessary
*/
public NM getBpo5_BPAmount() {
NM ret = null;
try {
Type t = this.getField(5, 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
* BPO-6: "BP Units" - creates it if necessary
*/
public CE getBPUnits() {
CE ret = null;
try {
Type t = this.getField(6, 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
* BPO-6: "BP Units" - creates it if necessary
*/
public CE getBpo6_BPUnits() {
CE ret = null;
try {
Type t = this.getField(6, 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
* BPO-7: "BP Intended Use Date/Time" - creates it if necessary
*/
public TS getBPIntendedUseDateTime() {
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
* BPO-7: "BP Intended Use Date/Time" - creates it if necessary
*/
public TS getBpo7_BPIntendedUseDateTime() {
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
* BPO-8: "BP Intended Dispense From Location" - creates it if necessary
*/
public PL getBPIntendedDispenseFromLocation() {
PL ret = null;
try {
Type t = this.getField(8, 0);
ret = (PL)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
* BPO-8: "BP Intended Dispense From Location" - creates it if necessary
*/
public PL getBpo8_BPIntendedDispenseFromLocation() {
PL ret = null;
try {
Type t = this.getField(8, 0);
ret = (PL)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
* BPO-9: "BP Intended Dispense From Address" - creates it if necessary
*/
public XAD getBPIntendedDispenseFromAddress() {
XAD ret = null;
try {
Type t = this.getField(9, 0);
ret = (XAD)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
* BPO-9: "BP Intended Dispense From Address" - creates it if necessary
*/
public XAD getBpo9_BPIntendedDispenseFromAddress() {
XAD ret = null;
try {
Type t = this.getField(9, 0);
ret = (XAD)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
* BPO-10: "BP Requested Dispense Date/Time" - creates it if necessary
*/
public TS getBPRequestedDispenseDateTime() {
TS ret = null;
try {
Type t = this.getField(10, 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
* BPO-10: "BP Requested Dispense Date/Time" - creates it if necessary
*/
public TS getBpo10_BPRequestedDispenseDateTime() {
TS ret = null;
try {
Type t = this.getField(10, 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
* BPO-11: "BP Requested Dispense To Location" - creates it if necessary
*/
public PL getBPRequestedDispenseToLocation() {
PL ret = null;
try {
Type t = this.getField(11, 0);
ret = (PL)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
* BPO-11: "BP Requested Dispense To Location" - creates it if necessary
*/
public PL getBpo11_BPRequestedDispenseToLocation() {
PL ret = null;
try {
Type t = this.getField(11, 0);
ret = (PL)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
* BPO-12: "BP Requested Dispense To Address" - creates it if necessary
*/
public XAD getBPRequestedDispenseToAddress() {
XAD ret = null;
try {
Type t = this.getField(12, 0);
ret = (XAD)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
* BPO-12: "BP Requested Dispense To Address" - creates it if necessary
*/
public XAD getBpo12_BPRequestedDispenseToAddress() {
XAD ret = null;
try {
Type t = this.getField(12, 0);
ret = (XAD)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 BP Indication for Use (BPO-13).
*/
public CWE[] getBPIndicationForUse() {
CWE[] ret = null;
try {
Type[] t = this.getField(13);
ret = new CWE[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CWE)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 BP Indication for Use (BPO-13).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getBPIndicationForUseReps() {
CWE[] 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
* BPO-13: "BP Indication for Use" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CWE getBPIndicationForUse(int rep) {
CWE ret = null;
try {
Type t = this.getField(13, rep);
ret = (CWE)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
* BPO-13: "BP Indication for Use" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CWE getBpo13_BPIndicationForUse(int rep) {
CWE ret = null;
try {
Type t = this.getField(13, rep);
ret = (CWE)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 BP Indication for Use (BPO-13).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getBpo13_BPIndicationForUseReps() {
CWE[] 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
* BPO-13: "BP Indication for Use" 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 CWE insertBPIndicationForUse(int rep) throws HL7Exception {
return (CWE) super.insertRepetition(13, rep);
}
/**
* Inserts a repetition of
* BPO-13: "BP Indication for Use" 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 CWE insertBpo13_BPIndicationForUse(int rep) throws HL7Exception {
return (CWE) super.insertRepetition(13, rep);
}
/**
* Removes a repetition of
* BPO-13: "BP Indication for Use" 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 CWE removeBPIndicationForUse(int rep) throws HL7Exception {
return (CWE) super.removeRepetition(13, rep);
}
/**
* Removes a repetition of
* BPO-13: "BP Indication for Use" 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 CWE removeBpo13_BPIndicationForUse(int rep) throws HL7Exception {
return (CWE) super.removeRepetition(13, rep);
}
/**
* Returns
* BPO-14: "BP Informed Consent Indicator" - creates it if necessary
*/
public ID getBPInformedConsentIndicator() {
ID ret = null;
try {
Type t = this.getField(14, 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
* BPO-14: "BP Informed Consent Indicator" - creates it if necessary
*/
public ID getBpo14_BPInformedConsentIndicator() {
ID ret = null;
try {
Type t = this.getField(14, 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 SI(getMessage());
case 1: return new CWE(getMessage());
case 2: return new CWE(getMessage());
case 3: return new NM(getMessage());
case 4: return new NM(getMessage());
case 5: return new CE(getMessage());
case 6: return new TS(getMessage());
case 7: return new PL(getMessage());
case 8: return new XAD(getMessage());
case 9: return new TS(getMessage());
case 10: return new PL(getMessage());
case 11: return new XAD(getMessage());
case 12: return new CWE(getMessage());
case 13: return new ID(getMessage(), new Integer( 136 ));
default: return null;
}
}
}