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

ca.uhn.hl7v2.model.v26.segment.LOC Maven / Gradle / Ivy

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

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

// import ca.uhn.hl7v2.model.v26.group.*;
import ca.uhn.hl7v2.model.v26.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 LOC message segment (Location Identification). * This segment has the following fields:

*
    *
  • LOC-1: Primary Key Value - LOC (PL) *
  • LOC-2: Location Description (ST) optional *
  • LOC-3: Location Type - LOC (IS) repeating *
  • LOC-4: Organization Name - LOC (XON) optional repeating *
  • LOC-5: Location Address (XAD) optional repeating *
  • LOC-6: Location Phone (XTN) optional repeating *
  • LOC-7: License Number (CWE) optional repeating *
  • LOC-8: Location Equipment (IS) optional repeating *
  • LOC-9: Location Service Code (IS) optional *
*/ public class LOC extends AbstractSegment { /** * Creates a new LOC segment */ public LOC(Group parent, ModelClassFactory factory) { super(parent, factory); init(factory); } private void init(ModelClassFactory factory) { try { this.add(PL.class, true, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Primary Key Value - LOC"); this.add(ST.class, false, 1, 48, new Object[]{ getMessage(), new Integer(0) }, "Location Description"); this.add(IS.class, true, 0, 2, new Object[]{ getMessage() }, "Location Type - LOC"); this.add(XON.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Organization Name - LOC"); this.add(XAD.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Location Address"); this.add(XTN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Location Phone"); this.add(CWE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(461) }, "License Number"); this.add(IS.class, false, 0, 3, new Object[]{ getMessage() }, "Location Equipment"); this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Location Service Code"); } catch(HL7Exception e) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating LOC - this is probably a bug in the source code generator.", e); } } /** * Returns * LOC-1: "Primary Key Value - LOC" - creates it if necessary */ public PL getPrimaryKeyValueLOC() { PL ret = null; try { Type t = this.getField(1, 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 * LOC-1: "Primary Key Value - LOC" - creates it if necessary */ public PL getLoc1_PrimaryKeyValueLOC() { PL ret = null; try { Type t = this.getField(1, 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 * LOC-2: "Location Description" - creates it if necessary */ public ST getLocationDescription() { ST ret = null; try { Type t = this.getField(2, 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 * LOC-2: "Location Description" - creates it if necessary */ public ST getLoc2_LocationDescription() { ST ret = null; try { Type t = this.getField(2, 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 Location Type - LOC (LOC-3). */ public IS[] getLocationTypeLOC() { IS[] ret = null; try { Type[] t = this.getField(3); 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 Location Type - LOC (LOC-3). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLocationTypeLOCReps() { IS[] 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 * LOC-3: "Location Type - LOC" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public IS getLocationTypeLOC(int rep) { IS ret = null; try { Type t = this.getField(3, 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 * LOC-3: "Location Type - LOC" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public IS getLoc3_LocationTypeLOC(int rep) { IS ret = null; try { Type t = this.getField(3, 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 Location Type - LOC (LOC-3). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLoc3_LocationTypeLOCReps() { IS[] 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 * LOC-3: "Location Type - LOC" 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 insertLocationTypeLOC(int rep) throws HL7Exception { return (IS) super.insertRepetition(3, rep); } /** * Inserts a repetition of * LOC-3: "Location Type - LOC" 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 insertLoc3_LocationTypeLOC(int rep) throws HL7Exception { return (IS) super.insertRepetition(3, rep); } /** * Removes a repetition of * LOC-3: "Location Type - LOC" 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 removeLocationTypeLOC(int rep) throws HL7Exception { return (IS) super.removeRepetition(3, rep); } /** * Removes a repetition of * LOC-3: "Location Type - LOC" 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 removeLoc3_LocationTypeLOC(int rep) throws HL7Exception { return (IS) super.removeRepetition(3, rep); } /** * Returns all repetitions of Organization Name - LOC (LOC-4). */ public XON[] getOrganizationNameLOC() { XON[] ret = null; try { Type[] t = this.getField(4); 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 Organization Name - LOC (LOC-4). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getOrganizationNameLOCReps() { XON[] 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 * LOC-4: "Organization Name - LOC" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public XON getOrganizationNameLOC(int rep) { XON ret = null; try { Type t = this.getField(4, 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 * LOC-4: "Organization Name - LOC" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public XON getLoc4_OrganizationNameLOC(int rep) { XON ret = null; try { Type t = this.getField(4, 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 Organization Name - LOC (LOC-4). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLoc4_OrganizationNameLOCReps() { XON[] 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 * LOC-4: "Organization Name - LOC" 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 insertOrganizationNameLOC(int rep) throws HL7Exception { return (XON) super.insertRepetition(4, rep); } /** * Inserts a repetition of * LOC-4: "Organization Name - LOC" 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 insertLoc4_OrganizationNameLOC(int rep) throws HL7Exception { return (XON) super.insertRepetition(4, rep); } /** * Removes a repetition of * LOC-4: "Organization Name - LOC" 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 removeOrganizationNameLOC(int rep) throws HL7Exception { return (XON) super.removeRepetition(4, rep); } /** * Removes a repetition of * LOC-4: "Organization Name - LOC" 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 removeLoc4_OrganizationNameLOC(int rep) throws HL7Exception { return (XON) super.removeRepetition(4, rep); } /** * Returns all repetitions of Location Address (LOC-5). */ public XAD[] getLocationAddress() { XAD[] ret = null; try { Type[] t = this.getField(5); ret = new XAD[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (XAD)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 Location Address (LOC-5). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLocationAddressReps() { XAD[] 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 * LOC-5: "Location Address" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public XAD getLocationAddress(int rep) { XAD ret = null; try { Type t = this.getField(5, rep); 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 a specific repetition of * LOC-5: "Location Address" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public XAD getLoc5_LocationAddress(int rep) { XAD ret = null; try { Type t = this.getField(5, rep); 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 a count of the current number of repetitions of Location Address (LOC-5). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLoc5_LocationAddressReps() { XAD[] 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 * LOC-5: "Location Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public XAD insertLocationAddress(int rep) throws HL7Exception { return (XAD) super.insertRepetition(5, rep); } /** * Inserts a repetition of * LOC-5: "Location Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public XAD insertLoc5_LocationAddress(int rep) throws HL7Exception { return (XAD) super.insertRepetition(5, rep); } /** * Removes a repetition of * LOC-5: "Location Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public XAD removeLocationAddress(int rep) throws HL7Exception { return (XAD) super.removeRepetition(5, rep); } /** * Removes a repetition of * LOC-5: "Location Address" at a specific index * * @param rep The repetition index (0-indexed) * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions) */ public XAD removeLoc5_LocationAddress(int rep) throws HL7Exception { return (XAD) super.removeRepetition(5, rep); } /** * Returns all repetitions of Location Phone (LOC-6). */ public XTN[] getLocationPhone() { XTN[] ret = null; try { Type[] t = this.getField(6); ret = new XTN[t.length]; for (int i = 0; i < ret.length; i++) { ret[i] = (XTN)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 Location Phone (LOC-6). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLocationPhoneReps() { XTN[] 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 * LOC-6: "Location Phone" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public XTN getLocationPhone(int rep) { XTN ret = null; try { Type t = this.getField(6, rep); ret = (XTN)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 * LOC-6: "Location Phone" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public XTN getLoc6_LocationPhone(int rep) { XTN ret = null; try { Type t = this.getField(6, rep); ret = (XTN)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 Location Phone (LOC-6). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLoc6_LocationPhoneReps() { XTN[] 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 * LOC-6: "Location Phone" 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 XTN insertLocationPhone(int rep) throws HL7Exception { return (XTN) super.insertRepetition(6, rep); } /** * Inserts a repetition of * LOC-6: "Location Phone" 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 XTN insertLoc6_LocationPhone(int rep) throws HL7Exception { return (XTN) super.insertRepetition(6, rep); } /** * Removes a repetition of * LOC-6: "Location Phone" 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 XTN removeLocationPhone(int rep) throws HL7Exception { return (XTN) super.removeRepetition(6, rep); } /** * Removes a repetition of * LOC-6: "Location Phone" 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 XTN removeLoc6_LocationPhone(int rep) throws HL7Exception { return (XTN) super.removeRepetition(6, rep); } /** * Returns all repetitions of License Number (LOC-7). */ public CWE[] getLicenseNumber() { CWE[] ret = null; try { Type[] t = this.getField(7); 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 License Number (LOC-7). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLicenseNumberReps() { CWE[] 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 * LOC-7: "License Number" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public CWE getLicenseNumber(int rep) { CWE ret = null; try { Type t = this.getField(7, 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 * LOC-7: "License Number" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public CWE getLoc7_LicenseNumber(int rep) { CWE ret = null; try { Type t = this.getField(7, 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 License Number (LOC-7). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLoc7_LicenseNumberReps() { CWE[] 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 * LOC-7: "License Number" 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 insertLicenseNumber(int rep) throws HL7Exception { return (CWE) super.insertRepetition(7, rep); } /** * Inserts a repetition of * LOC-7: "License Number" 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 insertLoc7_LicenseNumber(int rep) throws HL7Exception { return (CWE) super.insertRepetition(7, rep); } /** * Removes a repetition of * LOC-7: "License Number" 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 removeLicenseNumber(int rep) throws HL7Exception { return (CWE) super.removeRepetition(7, rep); } /** * Removes a repetition of * LOC-7: "License Number" 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 removeLoc7_LicenseNumber(int rep) throws HL7Exception { return (CWE) super.removeRepetition(7, rep); } /** * Returns all repetitions of Location Equipment (LOC-8). */ public IS[] getLocationEquipment() { IS[] ret = null; try { Type[] t = this.getField(8); 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 Location Equipment (LOC-8). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLocationEquipmentReps() { IS[] ret = null; try { Type[] t = this.getField(8); 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 * LOC-8: "Location Equipment" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public IS getLocationEquipment(int rep) { IS ret = null; try { Type t = this.getField(8, 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 * LOC-8: "Location Equipment" - creates it if necessary * * @param rep The repetition index (0-indexed) */ public IS getLoc8_LocationEquipment(int rep) { IS ret = null; try { Type t = this.getField(8, 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 Location Equipment (LOC-8). * This method does not create a repetition, so if no repetitions have currently been defined or accessed, * it will return zero. */ public int getLoc8_LocationEquipmentReps() { IS[] ret = null; try { Type[] t = this.getField(8); 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 * LOC-8: "Location Equipment" 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 insertLocationEquipment(int rep) throws HL7Exception { return (IS) super.insertRepetition(8, rep); } /** * Inserts a repetition of * LOC-8: "Location Equipment" 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 insertLoc8_LocationEquipment(int rep) throws HL7Exception { return (IS) super.insertRepetition(8, rep); } /** * Removes a repetition of * LOC-8: "Location Equipment" 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 removeLocationEquipment(int rep) throws HL7Exception { return (IS) super.removeRepetition(8, rep); } /** * Removes a repetition of * LOC-8: "Location Equipment" 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 removeLoc8_LocationEquipment(int rep) throws HL7Exception { return (IS) super.removeRepetition(8, rep); } /** * Returns * LOC-9: "Location Service Code" - creates it if necessary */ public IS getLocationServiceCode() { IS ret = null; try { Type t = this.getField(9, 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 * LOC-9: "Location Service Code" - creates it if necessary */ public IS getLoc9_LocationServiceCode() { IS ret = null; try { Type t = this.getField(9, 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; } /** {@inheritDoc} */ protected Type createNewTypeWithoutReflection(int field) { switch (field) { case 0: return new PL(getMessage()); case 1: return new ST(getMessage()); case 2: return new IS(getMessage(), new Integer( 260 )); case 3: return new XON(getMessage()); case 4: return new XAD(getMessage()); case 5: return new XTN(getMessage()); case 6: return new CWE(getMessage()); case 7: return new IS(getMessage(), new Integer( 261 )); case 8: return new IS(getMessage(), new Integer( 442 )); default: return null; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy