ca.uhn.hl7v2.model.v23.segment.PRA 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.v23.segment;
// import ca.uhn.hl7v2.model.v23.group.*;
import ca.uhn.hl7v2.model.v23.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 PRA message segment (Practitioner detail segment).
* This segment has the following fields:
*
* - PRA-1: PRA - Primary Key Value (ST)
*
- PRA-2: Practioner Group (CE) optional repeating
*
- PRA-3: Practioner Category (ID) optional repeating
*
- PRA-4: Provider Billing (ID) optional
*
- PRA-5: Specialty (CM_SPD) optional repeating
*
- PRA-6: Practitioner ID Numbers (CM_PLN) optional repeating
*
- PRA-7: Privileges (CM_PIP) optional repeating
*
*/
public class PRA extends AbstractSegment {
/**
* Creates a new PRA segment
*/
public PRA(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(ST.class, true, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "PRA - Primary Key Value");
this.add(CE.class, false, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "Practioner Group");
this.add(ID.class, false, 0, 3, new Object[]{ getMessage() }, "Practioner Category");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Provider Billing");
this.add(CM_SPD.class, false, 0, 100, new Object[]{ getMessage(), new Integer(187) }, "Specialty");
this.add(CM_PLN.class, false, 0, 100, new Object[]{ getMessage(), new Integer(0) }, "Practitioner ID Numbers");
this.add(CM_PIP.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Privileges");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PRA - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns
* PRA-1: "PRA - Primary Key Value" - creates it if necessary
*/
public ST getPRAPrimaryKeyValue() {
ST ret = null;
try {
Type t = this.getField(1, 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
* PRA-1: "PRA - Primary Key Value" - creates it if necessary
*/
public ST getPra1_PRAPrimaryKeyValue() {
ST ret = null;
try {
Type t = this.getField(1, 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 all repetitions of Practioner Group (PRA-2).
*/
public CE[] getPractionerGroup() {
CE[] ret = null;
try {
Type[] t = this.getField(2);
ret = new CE[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CE)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 Practioner Group (PRA-2).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPractionerGroupReps() {
CE[] ret = null;
try {
Type[] t = this.getField(2);
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
* PRA-2: "Practioner Group" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CE getPractionerGroup(int rep) {
CE ret = null;
try {
Type t = this.getField(2, rep);
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 a specific repetition of
* PRA-2: "Practioner Group" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CE getPra2_PractionerGroup(int rep) {
CE ret = null;
try {
Type t = this.getField(2, rep);
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 a count of the current number of repetitions of Practioner Group (PRA-2).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPra2_PractionerGroupReps() {
CE[] ret = null;
try {
Type[] t = this.getField(2);
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
* PRA-2: "Practioner Group" 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 CE insertPractionerGroup(int rep) throws HL7Exception {
return (CE) super.insertRepetition(2, rep);
}
/**
* Inserts a repetition of
* PRA-2: "Practioner Group" 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 CE insertPra2_PractionerGroup(int rep) throws HL7Exception {
return (CE) super.insertRepetition(2, rep);
}
/**
* Removes a repetition of
* PRA-2: "Practioner Group" 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 CE removePractionerGroup(int rep) throws HL7Exception {
return (CE) super.removeRepetition(2, rep);
}
/**
* Removes a repetition of
* PRA-2: "Practioner Group" 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 CE removePra2_PractionerGroup(int rep) throws HL7Exception {
return (CE) super.removeRepetition(2, rep);
}
/**
* Returns all repetitions of Practioner Category (PRA-3).
*/
public ID[] getPractionerCategory() {
ID[] ret = null;
try {
Type[] t = this.getField(3);
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 Practioner Category (PRA-3).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPractionerCategoryReps() {
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
* PRA-3: "Practioner Category" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public ID getPractionerCategory(int rep) {
ID ret = null;
try {
Type t = this.getField(3, 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
* PRA-3: "Practioner Category" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public ID getPra3_PractionerCategory(int rep) {
ID ret = null;
try {
Type t = this.getField(3, 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 Practioner Category (PRA-3).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPra3_PractionerCategoryReps() {
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
* PRA-3: "Practioner Category" 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 insertPractionerCategory(int rep) throws HL7Exception {
return (ID) super.insertRepetition(3, rep);
}
/**
* Inserts a repetition of
* PRA-3: "Practioner Category" 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 insertPra3_PractionerCategory(int rep) throws HL7Exception {
return (ID) super.insertRepetition(3, rep);
}
/**
* Removes a repetition of
* PRA-3: "Practioner Category" 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 removePractionerCategory(int rep) throws HL7Exception {
return (ID) super.removeRepetition(3, rep);
}
/**
* Removes a repetition of
* PRA-3: "Practioner Category" 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 removePra3_PractionerCategory(int rep) throws HL7Exception {
return (ID) super.removeRepetition(3, rep);
}
/**
* Returns
* PRA-4: "Provider Billing" - creates it if necessary
*/
public ID getProviderBilling() {
ID ret = null;
try {
Type t = this.getField(4, 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
* PRA-4: "Provider Billing" - creates it if necessary
*/
public ID getPra4_ProviderBilling() {
ID ret = null;
try {
Type t = this.getField(4, 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 Specialty (PRA-5).
*/
public CM_SPD[] getSpecialty() {
CM_SPD[] ret = null;
try {
Type[] t = this.getField(5);
ret = new CM_SPD[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CM_SPD)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 Specialty (PRA-5).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getSpecialtyReps() {
CM_SPD[] ret = null;
try {
Type[] t = this.getField(5);
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
* PRA-5: "Specialty" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_SPD getSpecialty(int rep) {
CM_SPD ret = null;
try {
Type t = this.getField(5, rep);
ret = (CM_SPD)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
* PRA-5: "Specialty" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_SPD getPra5_Specialty(int rep) {
CM_SPD ret = null;
try {
Type t = this.getField(5, rep);
ret = (CM_SPD)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 Specialty (PRA-5).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPra5_SpecialtyReps() {
CM_SPD[] ret = null;
try {
Type[] t = this.getField(5);
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
* PRA-5: "Specialty" 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_SPD insertSpecialty(int rep) throws HL7Exception {
return (CM_SPD) super.insertRepetition(5, rep);
}
/**
* Inserts a repetition of
* PRA-5: "Specialty" 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_SPD insertPra5_Specialty(int rep) throws HL7Exception {
return (CM_SPD) super.insertRepetition(5, rep);
}
/**
* Removes a repetition of
* PRA-5: "Specialty" 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_SPD removeSpecialty(int rep) throws HL7Exception {
return (CM_SPD) super.removeRepetition(5, rep);
}
/**
* Removes a repetition of
* PRA-5: "Specialty" 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_SPD removePra5_Specialty(int rep) throws HL7Exception {
return (CM_SPD) super.removeRepetition(5, rep);
}
/**
* Returns all repetitions of Practitioner ID Numbers (PRA-6).
*/
public CM_PLN[] getPractitionerIDNumbers() {
CM_PLN[] ret = null;
try {
Type[] t = this.getField(6);
ret = new CM_PLN[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CM_PLN)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 Practitioner ID Numbers (PRA-6).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPractitionerIDNumbersReps() {
CM_PLN[] ret = null;
try {
Type[] t = this.getField(6);
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
* PRA-6: "Practitioner ID Numbers" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_PLN getPractitionerIDNumbers(int rep) {
CM_PLN ret = null;
try {
Type t = this.getField(6, rep);
ret = (CM_PLN)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
* PRA-6: "Practitioner ID Numbers" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_PLN getPra6_PractitionerIDNumbers(int rep) {
CM_PLN ret = null;
try {
Type t = this.getField(6, rep);
ret = (CM_PLN)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 Practitioner ID Numbers (PRA-6).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPra6_PractitionerIDNumbersReps() {
CM_PLN[] ret = null;
try {
Type[] t = this.getField(6);
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
* PRA-6: "Practitioner ID Numbers" 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_PLN insertPractitionerIDNumbers(int rep) throws HL7Exception {
return (CM_PLN) super.insertRepetition(6, rep);
}
/**
* Inserts a repetition of
* PRA-6: "Practitioner ID Numbers" 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_PLN insertPra6_PractitionerIDNumbers(int rep) throws HL7Exception {
return (CM_PLN) super.insertRepetition(6, rep);
}
/**
* Removes a repetition of
* PRA-6: "Practitioner ID Numbers" 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_PLN removePractitionerIDNumbers(int rep) throws HL7Exception {
return (CM_PLN) super.removeRepetition(6, rep);
}
/**
* Removes a repetition of
* PRA-6: "Practitioner ID Numbers" 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_PLN removePra6_PractitionerIDNumbers(int rep) throws HL7Exception {
return (CM_PLN) super.removeRepetition(6, rep);
}
/**
* Returns all repetitions of Privileges (PRA-7).
*/
public CM_PIP[] getPrivileges() {
CM_PIP[] ret = null;
try {
Type[] t = this.getField(7);
ret = new CM_PIP[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CM_PIP)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 Privileges (PRA-7).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPrivilegesReps() {
CM_PIP[] ret = null;
try {
Type[] t = this.getField(7);
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
* PRA-7: "Privileges" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_PIP getPrivileges(int rep) {
CM_PIP ret = null;
try {
Type t = this.getField(7, rep);
ret = (CM_PIP)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
* PRA-7: "Privileges" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_PIP getPra7_Privileges(int rep) {
CM_PIP ret = null;
try {
Type t = this.getField(7, rep);
ret = (CM_PIP)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 Privileges (PRA-7).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPra7_PrivilegesReps() {
CM_PIP[] ret = null;
try {
Type[] t = this.getField(7);
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
* PRA-7: "Privileges" 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_PIP insertPrivileges(int rep) throws HL7Exception {
return (CM_PIP) super.insertRepetition(7, rep);
}
/**
* Inserts a repetition of
* PRA-7: "Privileges" 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_PIP insertPra7_Privileges(int rep) throws HL7Exception {
return (CM_PIP) super.insertRepetition(7, rep);
}
/**
* Removes a repetition of
* PRA-7: "Privileges" 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_PIP removePrivileges(int rep) throws HL7Exception {
return (CM_PIP) super.removeRepetition(7, rep);
}
/**
* Removes a repetition of
* PRA-7: "Privileges" 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_PIP removePra7_Privileges(int rep) throws HL7Exception {
return (CM_PIP) super.removeRepetition(7, rep);
}
/** {@inheritDoc} */
protected Type createNewTypeWithoutReflection(int field) {
switch (field) {
case 0: return new ST(getMessage());
case 1: return new CE(getMessage());
case 2: return new ID(getMessage(), new Integer( 0 ));
case 3: return new ID(getMessage(), new Integer( 186 ));
case 4: return new CM_SPD(getMessage());
case 5: return new CM_PLN(getMessage());
case 6: return new CM_PIP(getMessage());
default: return null;
}
}
}