ca.uhn.hl7v2.model.v26.segment.ILT 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.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 ILT message segment (Material Lot).
* This segment has the following fields:
*
* - ILT-1: Set Id - ILT (SI)
*
- ILT-2: Inventory Lot Number (ST)
*
- ILT-3: Inventory Expiration Date (DTM) optional
*
- ILT-4: Inventory Received Date (DTM) optional
*
- ILT-5: Inventory Received Quantity (NM) optional
*
- ILT-6: Inventory Received Quantity Unit (CWE) optional
*
- ILT-7: Inventory Received Item Cost (MO) optional
*
- ILT-8: Inventory On Hand Date (DTM) optional
*
- ILT-9: Inventory On Hand Quantity (NM) optional
*
- ILT-10: Inventory On Hand Quantity Unit (CWE) optional
*
*/
public class ILT extends AbstractSegment {
/**
* Creates a new ILT segment
*/
public ILT(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 - ILT");
this.add(ST.class, true, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Inventory Lot Number");
this.add(DTM.class, false, 1, 24, new Object[]{ getMessage(), new Integer(0) }, "Inventory Expiration Date");
this.add(DTM.class, false, 1, 24, new Object[]{ getMessage(), new Integer(0) }, "Inventory Received Date");
this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Inventory Received Quantity");
this.add(CWE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Inventory Received Quantity Unit");
this.add(MO.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Inventory Received Item Cost");
this.add(DTM.class, false, 1, 24, new Object[]{ getMessage(), new Integer(0) }, "Inventory On Hand Date");
this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Inventory On Hand Quantity");
this.add(CWE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Inventory On Hand Quantity Unit");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating ILT - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns
* ILT-1: "Set Id - ILT" - creates it if necessary
*/
public SI getSetIdILT() {
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
* ILT-1: "Set Id - ILT" - creates it if necessary
*/
public SI getIlt1_SetIdILT() {
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
* ILT-2: "Inventory Lot Number" - creates it if necessary
*/
public ST getInventoryLotNumber() {
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
* ILT-2: "Inventory Lot Number" - creates it if necessary
*/
public ST getIlt2_InventoryLotNumber() {
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
* ILT-3: "Inventory Expiration Date" - creates it if necessary
*/
public DTM getInventoryExpirationDate() {
DTM ret = null;
try {
Type t = this.getField(3, 0);
ret = (DTM)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
* ILT-3: "Inventory Expiration Date" - creates it if necessary
*/
public DTM getIlt3_InventoryExpirationDate() {
DTM ret = null;
try {
Type t = this.getField(3, 0);
ret = (DTM)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
* ILT-4: "Inventory Received Date" - creates it if necessary
*/
public DTM getInventoryReceivedDate() {
DTM ret = null;
try {
Type t = this.getField(4, 0);
ret = (DTM)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
* ILT-4: "Inventory Received Date" - creates it if necessary
*/
public DTM getIlt4_InventoryReceivedDate() {
DTM ret = null;
try {
Type t = this.getField(4, 0);
ret = (DTM)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
* ILT-5: "Inventory Received Quantity" - creates it if necessary
*/
public NM getInventoryReceivedQuantity() {
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
* ILT-5: "Inventory Received Quantity" - creates it if necessary
*/
public NM getIlt5_InventoryReceivedQuantity() {
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
* ILT-6: "Inventory Received Quantity Unit" - creates it if necessary
*/
public CWE getInventoryReceivedQuantityUnit() {
CWE ret = null;
try {
Type t = this.getField(6, 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
* ILT-6: "Inventory Received Quantity Unit" - creates it if necessary
*/
public CWE getIlt6_InventoryReceivedQuantityUnit() {
CWE ret = null;
try {
Type t = this.getField(6, 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
* ILT-7: "Inventory Received Item Cost" - creates it if necessary
*/
public MO getInventoryReceivedItemCost() {
MO ret = null;
try {
Type t = this.getField(7, 0);
ret = (MO)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
* ILT-7: "Inventory Received Item Cost" - creates it if necessary
*/
public MO getIlt7_InventoryReceivedItemCost() {
MO ret = null;
try {
Type t = this.getField(7, 0);
ret = (MO)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
* ILT-8: "Inventory On Hand Date" - creates it if necessary
*/
public DTM getInventoryOnHandDate() {
DTM ret = null;
try {
Type t = this.getField(8, 0);
ret = (DTM)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
* ILT-8: "Inventory On Hand Date" - creates it if necessary
*/
public DTM getIlt8_InventoryOnHandDate() {
DTM ret = null;
try {
Type t = this.getField(8, 0);
ret = (DTM)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
* ILT-9: "Inventory On Hand Quantity" - creates it if necessary
*/
public NM getInventoryOnHandQuantity() {
NM ret = null;
try {
Type t = this.getField(9, 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
* ILT-9: "Inventory On Hand Quantity" - creates it if necessary
*/
public NM getIlt9_InventoryOnHandQuantity() {
NM ret = null;
try {
Type t = this.getField(9, 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
* ILT-10: "Inventory On Hand Quantity Unit" - creates it if necessary
*/
public CWE getInventoryOnHandQuantityUnit() {
CWE ret = null;
try {
Type t = this.getField(10, 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
* ILT-10: "Inventory On Hand Quantity Unit" - creates it if necessary
*/
public CWE getIlt10_InventoryOnHandQuantityUnit() {
CWE ret = null;
try {
Type t = this.getField(10, 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;
}
/** {@inheritDoc} */
protected Type createNewTypeWithoutReflection(int field) {
switch (field) {
case 0: return new SI(getMessage());
case 1: return new ST(getMessage());
case 2: return new DTM(getMessage());
case 3: return new DTM(getMessage());
case 4: return new NM(getMessage());
case 5: return new CWE(getMessage());
case 6: return new MO(getMessage());
case 7: return new DTM(getMessage());
case 8: return new NM(getMessage());
case 9: return new CWE(getMessage());
default: return null;
}
}
}