ca.uhn.hl7v2.model.v24.segment.PSH 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/
*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.mozilla.org/MPL/
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
* specific language governing rights and limitations under the License.
*
* The Original Code is "[file_name]". Description:
* "[one_line_description]"
*
* The Initial Developer of the Original Code is University Health Network. Copyright (C)
* 2002. All Rights Reserved.
*
* Contributor(s): ______________________________________.
*
* Alternatively, the contents of this file may be used under the terms of the
* GNU General Public License (the "GPL"), in which case the provisions of the GPL are
* applicable instead of those above. If you wish to allow use of your version of this
* file only under the terms of the GPL and not to allow others to use your version
* of this file under the MPL, indicate your decision by deleting the provisions above
* and replace them with the notice and other provisions required by the GPL License.
* If you do not delete the provisions above, a recipient may use your version of
* this file under either the MPL or the GPL.
*
*/
package ca.uhn.hl7v2.model.v24.segment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// import ca.uhn.hl7v2.model.v24.group.*;
import ca.uhn.hl7v2.model.v24.datatype.*;
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 PSH message segment (Product Summary Header).
* This segment has the following fields:
*
* - PSH-1: Report Type (ST)
*
- PSH-2: Report Form Identifier (ST) optional
*
- PSH-3: Report Date (TS)
*
- PSH-4: Report Interval Start Date (TS) optional
*
- PSH-5: Report Interval End Date (TS) optional
*
- PSH-6: Quantity Manufactured (CQ) optional
*
- PSH-7: Quantity Distributed (CQ) optional
*
- PSH-8: Quantity Distributed Method (ID) optional
*
- PSH-9: Quantity Distributed Comment (FT) optional
*
- PSH-10: Quantity in Use (CQ) optional
*
- PSH-11: Quantity in Use Method (ID) optional
*
- PSH-12: Quantity in Use Comment (FT) optional
*
- PSH-13: Number of Product Experience Reports Filed by Facility (NM) optional repeating
*
- PSH-14: Number of Product Experience Reports Filed by Distributor (NM) optional repeating
*
*/
@SuppressWarnings("unused")
public class PSH extends AbstractSegment {
/**
* Creates a new PSH segment
*/
public PSH(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(ST.class, true, 1, 60, new Object[]{ getMessage() }, "Report Type");
this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Report Form Identifier");
this.add(TS.class, true, 1, 26, new Object[]{ getMessage() }, "Report Date");
this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Report Interval Start Date");
this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Report Interval End Date");
this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Quantity Manufactured");
this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Quantity Distributed");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(329) }, "Quantity Distributed Method");
this.add(FT.class, false, 1, 600, new Object[]{ getMessage() }, "Quantity Distributed Comment");
this.add(CQ.class, false, 1, 12, new Object[]{ getMessage() }, "Quantity in Use");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(329) }, "Quantity in Use Method");
this.add(FT.class, false, 1, 600, new Object[]{ getMessage() }, "Quantity in Use Comment");
this.add(NM.class, false, 8, 2, new Object[]{ getMessage() }, "Number of Product Experience Reports Filed by Facility");
this.add(NM.class, false, 8, 2, new Object[]{ getMessage() }, "Number of Product Experience Reports Filed by Distributor");
} catch(HL7Exception e) {
LoggerFactory.getLogger(getClass()).error("Unexpected error creating PSH - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns
* PSH-1: "Report Type" - creates it if necessary
*/
public ST getReportType() {
ST ret = null;
try {
Type t = this.getField(1, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-1: "Report Type" - creates it if necessary
*/
public ST getPsh1_ReportType() {
ST ret = null;
try {
Type t = this.getField(1, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-2: "Report Form Identifier" - creates it if necessary
*/
public ST getReportFormIdentifier() {
ST ret = null;
try {
Type t = this.getField(2, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-2: "Report Form Identifier" - creates it if necessary
*/
public ST getPsh2_ReportFormIdentifier() {
ST ret = null;
try {
Type t = this.getField(2, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-3: "Report Date" - creates it if necessary
*/
public TS getReportDate() {
TS ret = null;
try {
Type t = this.getField(3, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-3: "Report Date" - creates it if necessary
*/
public TS getPsh3_ReportDate() {
TS ret = null;
try {
Type t = this.getField(3, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-4: "Report Interval Start Date" - creates it if necessary
*/
public TS getReportIntervalStartDate() {
TS ret = null;
try {
Type t = this.getField(4, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-4: "Report Interval Start Date" - creates it if necessary
*/
public TS getPsh4_ReportIntervalStartDate() {
TS ret = null;
try {
Type t = this.getField(4, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-5: "Report Interval End Date" - creates it if necessary
*/
public TS getReportIntervalEndDate() {
TS ret = null;
try {
Type t = this.getField(5, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-5: "Report Interval End Date" - creates it if necessary
*/
public TS getPsh5_ReportIntervalEndDate() {
TS ret = null;
try {
Type t = this.getField(5, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-6: "Quantity Manufactured" - creates it if necessary
*/
public CQ getQuantityManufactured() {
CQ ret = null;
try {
Type t = this.getField(6, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-6: "Quantity Manufactured" - creates it if necessary
*/
public CQ getPsh6_QuantityManufactured() {
CQ ret = null;
try {
Type t = this.getField(6, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-7: "Quantity Distributed" - creates it if necessary
*/
public CQ getQuantityDistributed() {
CQ ret = null;
try {
Type t = this.getField(7, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-7: "Quantity Distributed" - creates it if necessary
*/
public CQ getPsh7_QuantityDistributed() {
CQ ret = null;
try {
Type t = this.getField(7, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-8: "Quantity Distributed Method" - creates it if necessary
*/
public ID getQuantityDistributedMethod() {
ID ret = null;
try {
Type t = this.getField(8, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-8: "Quantity Distributed Method" - creates it if necessary
*/
public ID getPsh8_QuantityDistributedMethod() {
ID ret = null;
try {
Type t = this.getField(8, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-9: "Quantity Distributed Comment" - creates it if necessary
*/
public FT getQuantityDistributedComment() {
FT ret = null;
try {
Type t = this.getField(9, 0);
ret = (FT)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-9: "Quantity Distributed Comment" - creates it if necessary
*/
public FT getPsh9_QuantityDistributedComment() {
FT ret = null;
try {
Type t = this.getField(9, 0);
ret = (FT)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-10: "Quantity in Use" - creates it if necessary
*/
public CQ getQuantityInUse() {
CQ ret = null;
try {
Type t = this.getField(10, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-10: "Quantity in Use" - creates it if necessary
*/
public CQ getPsh10_QuantityInUse() {
CQ ret = null;
try {
Type t = this.getField(10, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-11: "Quantity in Use Method" - creates it if necessary
*/
public ID getQuantityInUseMethod() {
ID ret = null;
try {
Type t = this.getField(11, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-11: "Quantity in Use Method" - creates it if necessary
*/
public ID getPsh11_QuantityInUseMethod() {
ID ret = null;
try {
Type t = this.getField(11, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-12: "Quantity in Use Comment" - creates it if necessary
*/
public FT getQuantityInUseComment() {
FT ret = null;
try {
Type t = this.getField(12, 0);
ret = (FT)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* PSH-12: "Quantity in Use Comment" - creates it if necessary
*/
public FT getPsh12_QuantityInUseComment() {
FT ret = null;
try {
Type t = this.getField(12, 0);
ret = (FT)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns all repetitions of Number of Product Experience Reports Filed by Facility (PSH-13).
*/
public NM[] getNumberOfProductExperienceReportsFiledByFacility() {
NM[] ret = null;
try {
Type[] t = this.getField(13);
ret = new NM[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (NM)t[i];
}
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(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 Number of Product Experience Reports Filed by Facility (PSH-13).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getNumberOfProductExperienceReportsFiledByFacilityReps() {
NM[] ret = null;
try {
Type[] t = this.getField(13);
return t.length;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Returns a specific repetition of
* PSH-13: "Number of Product Experience Reports Filed by Facility" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public NM getNumberOfProductExperienceReportsFiledByFacility(int rep) {
NM ret = null;
try {
Type t = this.getField(13, rep);
ret = (NM)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a specific repetition of
* PSH-13: "Number of Product Experience Reports Filed by Facility" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public NM getPsh13_NumberOfProductExperienceReportsFiledByFacility(int rep) {
NM ret = null;
try {
Type t = this.getField(13, rep);
ret = (NM)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(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 Number of Product Experience Reports Filed by Facility (PSH-13).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPsh13_NumberOfProductExperienceReportsFiledByFacilityReps() {
NM[] ret = null;
try {
Type[] t = this.getField(13);
return t.length;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Inserts a repetition of
* PSH-13: "Number of Product Experience Reports Filed by 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 NM insertNumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception {
return (NM) super.insertRepetition(13, rep);
}
/**
* Inserts a repetition of
* PSH-13: "Number of Product Experience Reports Filed by 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 NM insertPsh13_NumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception {
return (NM) super.insertRepetition(13, rep);
}
/**
* Removes a repetition of
* PSH-13: "Number of Product Experience Reports Filed by 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 NM removeNumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception {
return (NM) super.removeRepetition(13, rep);
}
/**
* Removes a repetition of
* PSH-13: "Number of Product Experience Reports Filed by 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 NM removePsh13_NumberOfProductExperienceReportsFiledByFacility(int rep) throws HL7Exception {
return (NM) super.removeRepetition(13, rep);
}
/**
* Returns all repetitions of Number of Product Experience Reports Filed by Distributor (PSH-14).
*/
public NM[] getNumberOfProductExperienceReportsFiledByDistributor() {
NM[] ret = null;
try {
Type[] t = this.getField(14);
ret = new NM[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (NM)t[i];
}
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(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 Number of Product Experience Reports Filed by Distributor (PSH-14).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getNumberOfProductExperienceReportsFiledByDistributorReps() {
NM[] ret = null;
try {
Type[] t = this.getField(14);
return t.length;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Returns a specific repetition of
* PSH-14: "Number of Product Experience Reports Filed by Distributor" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public NM getNumberOfProductExperienceReportsFiledByDistributor(int rep) {
NM ret = null;
try {
Type t = this.getField(14, rep);
ret = (NM)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a specific repetition of
* PSH-14: "Number of Product Experience Reports Filed by Distributor" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public NM getPsh14_NumberOfProductExperienceReportsFiledByDistributor(int rep) {
NM ret = null;
try {
Type t = this.getField(14, rep);
ret = (NM)t;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(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 Number of Product Experience Reports Filed by Distributor (PSH-14).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getPsh14_NumberOfProductExperienceReportsFiledByDistributorReps() {
NM[] ret = null;
try {
Type[] t = this.getField(14);
return t.length;
} catch (ClassCastException cce) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Inserts a repetition of
* PSH-14: "Number of Product Experience Reports Filed by Distributor" 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 NM insertNumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception {
return (NM) super.insertRepetition(14, rep);
}
/**
* Inserts a repetition of
* PSH-14: "Number of Product Experience Reports Filed by Distributor" 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 NM insertPsh14_NumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception {
return (NM) super.insertRepetition(14, rep);
}
/**
* Removes a repetition of
* PSH-14: "Number of Product Experience Reports Filed by Distributor" 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 NM removeNumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception {
return (NM) super.removeRepetition(14, rep);
}
/**
* Removes a repetition of
* PSH-14: "Number of Product Experience Reports Filed by Distributor" 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 NM removePsh14_NumberOfProductExperienceReportsFiledByDistributor(int rep) throws HL7Exception {
return (NM) super.removeRepetition(14, rep);
}
/** {@inheritDoc} */
protected Type createNewTypeWithoutReflection(int field) {
switch (field) {
case 0: return new ST(getMessage());
case 1: return new ST(getMessage());
case 2: return new TS(getMessage());
case 3: return new TS(getMessage());
case 4: return new TS(getMessage());
case 5: return new CQ(getMessage());
case 6: return new CQ(getMessage());
case 7: return new ID(getMessage(), new Integer( 329 ));
case 8: return new FT(getMessage());
case 9: return new CQ(getMessage());
case 10: return new ID(getMessage(), new Integer( 329 ));
case 11: return new FT(getMessage());
case 12: return new NM(getMessage());
case 13: return new NM(getMessage());
default: return null;
}
}
}