001 /*
002 * This class is an auto-generated source file for a HAPI
003 * HL7 v2.x standard structure class.
004 *
005 * For more information, visit: http://hl7api.sourceforge.net/
006 */
007
008 package ca.uhn.hl7v2.model.v24.segment;
009
010 // import ca.uhn.hl7v2.model.v24.group.*;
011 import ca.uhn.hl7v2.model.v24.datatype.*;
012 import ca.uhn.log.HapiLogFactory;
013 import ca.uhn.hl7v2.HL7Exception;
014 import ca.uhn.hl7v2.parser.ModelClassFactory;
015 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016 import ca.uhn.hl7v2.model.AbstractMessage;
017 import ca.uhn.hl7v2.model.Group;
018 import ca.uhn.hl7v2.model.Type;
019 import ca.uhn.hl7v2.model.AbstractSegment;
020 import ca.uhn.hl7v2.model.Varies;
021
022 /**
023 *<p>Represents an HL7 RDT message segment (Table Row Data).
024 * This segment has the following fields:</p>
025 * <ul>
026 * <li>RDT-1: Column Value (Varies) <b> </b>
027 * </ul>
028 */
029 public class RDT extends AbstractSegment {
030
031 /**
032 * Creates a new RDT segment
033 */
034 public RDT(Group parent, ModelClassFactory factory) {
035 super(parent, factory);
036 init(factory);
037 }
038
039 private void init(ModelClassFactory factory) {
040 try {
041 this.add(Varies.class, true, 1, 0, new Object[]{ getMessage(), new Integer(0) }, "Column Value");
042 } catch(HL7Exception e) {
043 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating RDT - this is probably a bug in the source code generator.", e);
044 }
045 }
046
047
048
049 /**
050 * Returns
051 * RDT-1: "Column Value" - creates it if necessary
052 */
053 public Varies getColumnValue() {
054 Varies ret = null;
055 try {
056 Type t = this.getField(1, 0);
057 ret = (Varies)t;
058 } catch (ClassCastException cce) {
059 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
060 throw new RuntimeException(cce);
061 } catch (HL7Exception he) {
062 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
063 throw new RuntimeException(he);
064 }
065 return ret;
066 }
067
068
069 /**
070 * Returns
071 * RDT-1: "Column Value" - creates it if necessary
072 */
073 public Varies getRdt1_ColumnValue() {
074 Varies ret = null;
075 try {
076 Type t = this.getField(1, 0);
077 ret = (Varies)t;
078 } catch (ClassCastException cce) {
079 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
080 throw new RuntimeException(cce);
081 } catch (HL7Exception he) {
082 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
083 throw new RuntimeException(he);
084 }
085 return ret;
086 }
087
088
089
090
091
092 /** {@inheritDoc} */
093 protected Type createNewTypeWithoutReflection(int field) {
094 switch (field) {
095 case 0: return new Varies(getMessage());
096 default: return null;
097 }
098 }
099
100
101 }
102