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 * The contents of this file are subject to the Mozilla Public License Version 1.1 008 * (the "License"); you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 010 * Software distributed under the License is distributed on an "AS IS" basis, 011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 012 * specific language governing rights and limitations under the License. 013 * 014 * The Original Code is "[file_name]". Description: 015 * "[one_line_description]" 016 * 017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 018 * 2012. All Rights Reserved. 019 * 020 * Contributor(s): ______________________________________. 021 * 022 * Alternatively, the contents of this file may be used under the terms of the 023 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are 024 * applicable instead of those above. If you wish to allow use of your version of this 025 * file only under the terms of the GPL and not to allow others to use your version 026 * of this file under the MPL, indicate your decision by deleting the provisions above 027 * and replace them with the notice and other provisions required by the GPL License. 028 * If you do not delete the provisions above, a recipient may use your version of 029 * this file under either the MPL or the GPL. 030 * 031 */ 032 033 034package ca.uhn.hl7v2.model.v25.segment; 035 036// import ca.uhn.hl7v2.model.v25.group.*; 037import ca.uhn.hl7v2.model.v25.datatype.*; 038import ca.uhn.hl7v2.HL7Exception; 039import ca.uhn.hl7v2.parser.ModelClassFactory; 040import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 041import ca.uhn.hl7v2.model.AbstractMessage; 042import ca.uhn.hl7v2.model.Group; 043import ca.uhn.hl7v2.model.Type; 044import ca.uhn.hl7v2.model.AbstractSegment; 045import ca.uhn.hl7v2.model.Varies; 046 047/** 048 *<p>Represents an HL7 TCD message segment (Test Code Detail). 049 * This segment has the following fields:</p> 050 * <ul> 051 * <li>TCD-1: Universal Service Identifier (CE) <b> </b> 052 * <li>TCD-2: Auto-Dilution Factor (SN) <b>optional </b> 053 * <li>TCD-3: Rerun Dilution Factor (SN) <b>optional </b> 054 * <li>TCD-4: Pre-Dilution Factor (SN) <b>optional </b> 055 * <li>TCD-5: Endogenous Content of Pre-Dilution Diluent (SN) <b>optional </b> 056 * <li>TCD-6: Automatic Repeat Allowed (ID) <b>optional </b> 057 * <li>TCD-7: Reflex Allowed (ID) <b>optional </b> 058 * <li>TCD-8: Analyte Repeat Status (CE) <b>optional </b> 059 * </ul> 060 */ 061@SuppressWarnings("unused") 062public class TCD extends AbstractSegment { 063 064 /** 065 * Creates a new TCD segment 066 */ 067 public TCD(Group parent, ModelClassFactory factory) { 068 super(parent, factory); 069 init(factory); 070 } 071 072 private void init(ModelClassFactory factory) { 073 try { 074 this.add(CE.class, true, 1, 250, new Object[]{ getMessage() }, "Universal Service Identifier"); 075 this.add(SN.class, false, 1, 20, new Object[]{ getMessage() }, "Auto-Dilution Factor"); 076 this.add(SN.class, false, 1, 20, new Object[]{ getMessage() }, "Rerun Dilution Factor"); 077 this.add(SN.class, false, 1, 20, new Object[]{ getMessage() }, "Pre-Dilution Factor"); 078 this.add(SN.class, false, 1, 20, new Object[]{ getMessage() }, "Endogenous Content of Pre-Dilution Diluent"); 079 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Automatic Repeat Allowed"); 080 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Reflex Allowed"); 081 this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Analyte Repeat Status"); 082 } catch(HL7Exception e) { 083 log.error("Unexpected error creating TCD - this is probably a bug in the source code generator.", e); 084 } 085 } 086 087 088 089 /** 090 * Returns 091 * TCD-1: "Universal Service Identifier" - creates it if necessary 092 */ 093 public CE getUniversalServiceIdentifier() { 094 CE retVal = this.getTypedField(1, 0); 095 return retVal; 096 } 097 098 /** 099 * Returns 100 * TCD-1: "Universal Service Identifier" - creates it if necessary 101 */ 102 public CE getTcd1_UniversalServiceIdentifier() { 103 CE retVal = this.getTypedField(1, 0); 104 return retVal; 105 } 106 107 108 109 /** 110 * Returns 111 * TCD-2: "Auto-Dilution Factor" - creates it if necessary 112 */ 113 public SN getAutoDilutionFactor() { 114 SN retVal = this.getTypedField(2, 0); 115 return retVal; 116 } 117 118 /** 119 * Returns 120 * TCD-2: "Auto-Dilution Factor" - creates it if necessary 121 */ 122 public SN getTcd2_AutoDilutionFactor() { 123 SN retVal = this.getTypedField(2, 0); 124 return retVal; 125 } 126 127 128 129 /** 130 * Returns 131 * TCD-3: "Rerun Dilution Factor" - creates it if necessary 132 */ 133 public SN getRerunDilutionFactor() { 134 SN retVal = this.getTypedField(3, 0); 135 return retVal; 136 } 137 138 /** 139 * Returns 140 * TCD-3: "Rerun Dilution Factor" - creates it if necessary 141 */ 142 public SN getTcd3_RerunDilutionFactor() { 143 SN retVal = this.getTypedField(3, 0); 144 return retVal; 145 } 146 147 148 149 /** 150 * Returns 151 * TCD-4: "Pre-Dilution Factor" - creates it if necessary 152 */ 153 public SN getPreDilutionFactor() { 154 SN retVal = this.getTypedField(4, 0); 155 return retVal; 156 } 157 158 /** 159 * Returns 160 * TCD-4: "Pre-Dilution Factor" - creates it if necessary 161 */ 162 public SN getTcd4_PreDilutionFactor() { 163 SN retVal = this.getTypedField(4, 0); 164 return retVal; 165 } 166 167 168 169 /** 170 * Returns 171 * TCD-5: "Endogenous Content of Pre-Dilution Diluent" - creates it if necessary 172 */ 173 public SN getEndogenousContentOfPreDilutionDiluent() { 174 SN retVal = this.getTypedField(5, 0); 175 return retVal; 176 } 177 178 /** 179 * Returns 180 * TCD-5: "Endogenous Content of Pre-Dilution Diluent" - creates it if necessary 181 */ 182 public SN getTcd5_EndogenousContentOfPreDilutionDiluent() { 183 SN retVal = this.getTypedField(5, 0); 184 return retVal; 185 } 186 187 188 189 /** 190 * Returns 191 * TCD-6: "Automatic Repeat Allowed" - creates it if necessary 192 */ 193 public ID getAutomaticRepeatAllowed() { 194 ID retVal = this.getTypedField(6, 0); 195 return retVal; 196 } 197 198 /** 199 * Returns 200 * TCD-6: "Automatic Repeat Allowed" - creates it if necessary 201 */ 202 public ID getTcd6_AutomaticRepeatAllowed() { 203 ID retVal = this.getTypedField(6, 0); 204 return retVal; 205 } 206 207 208 209 /** 210 * Returns 211 * TCD-7: "Reflex Allowed" - creates it if necessary 212 */ 213 public ID getReflexAllowed() { 214 ID retVal = this.getTypedField(7, 0); 215 return retVal; 216 } 217 218 /** 219 * Returns 220 * TCD-7: "Reflex Allowed" - creates it if necessary 221 */ 222 public ID getTcd7_ReflexAllowed() { 223 ID retVal = this.getTypedField(7, 0); 224 return retVal; 225 } 226 227 228 229 /** 230 * Returns 231 * TCD-8: "Analyte Repeat Status" - creates it if necessary 232 */ 233 public CE getAnalyteRepeatStatus() { 234 CE retVal = this.getTypedField(8, 0); 235 return retVal; 236 } 237 238 /** 239 * Returns 240 * TCD-8: "Analyte Repeat Status" - creates it if necessary 241 */ 242 public CE getTcd8_AnalyteRepeatStatus() { 243 CE retVal = this.getTypedField(8, 0); 244 return retVal; 245 } 246 247 248 249 250 251 /** {@inheritDoc} */ 252 protected Type createNewTypeWithoutReflection(int field) { 253 switch (field) { 254 case 0: return new CE(getMessage()); 255 case 1: return new SN(getMessage()); 256 case 2: return new SN(getMessage()); 257 case 3: return new SN(getMessage()); 258 case 4: return new SN(getMessage()); 259 case 5: return new ID(getMessage(), new Integer( 136 )); 260 case 6: return new ID(getMessage(), new Integer( 136 )); 261 case 7: return new CE(getMessage()); 262 default: return null; 263 } 264 } 265 266 267} 268