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.v22.group; 035 036import ca.uhn.hl7v2.model.v22.segment.*; 037 038import java.util.List; 039 040import ca.uhn.hl7v2.HL7Exception; 041import ca.uhn.hl7v2.parser.ModelClassFactory; 042import ca.uhn.hl7v2.model.*; 043 044/** 045 * <p>Represents a ORM_O01_ORDER_DETAIL group structure (a Group object). 046 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together. 047 * This Group contains the following elements: 048 * </p> 049 * <ul> 050 * <li>1: OBR (OBSERVATION REQUEST) <b> </b></li> 051 * <li>2: RQD (REQUISITION DETAIL) <b> </b></li> 052 * <li>3: RQ1 (REQUISITION DETAIL-!) <b> </b></li> 053 * <li>4: RXO (PHARMACY PRESCRIPTION ORDER) <b> </b></li> 054 * <li>5: ODS (DIETARY ORDERS, SUPPLEMENTS, and PREFERENCES) <b> </b></li> 055 * <li>6: ODT (DIET TRAY INSTRUCTION) <b> </b></li> 056 * <li>7: NTE (NOTES AND COMMENTS) <b>optional repeating</b></li> 057 * <li>8: OBX (OBSERVATION RESULT) <b>optional repeating</b></li> 058 * <li>9: NTE (NOTES AND COMMENTS) <b> repeating</b></li> 059 * </ul> 060 */ 061@SuppressWarnings("unused") 062public class ORM_O01_ORDER_DETAIL extends AbstractGroup { 063 064 /** 065 * Creates a new ORM_O01_ORDER_DETAIL group 066 */ 067 public ORM_O01_ORDER_DETAIL(Group parent, ModelClassFactory factory) { 068 super(parent, factory); 069 init(factory); 070 } 071 072 private void init(ModelClassFactory factory) { 073 try { 074 this.add(OBR.class, true, false); 075 this.add(RQD.class, true, false); 076 this.add(RQ1.class, true, false); 077 this.add(RXO.class, true, false); 078 this.add(ODS.class, true, false); 079 this.add(ODT.class, true, false); 080 this.add(NTE.class, false, true); 081 this.add(OBX.class, false, true); 082 this.add(NTE.class, true, true); 083 } catch(HL7Exception e) { 084 log.error("Unexpected error creating ORM_O01_ORDER_DETAIL - this is probably a bug in the source code generator.", e); 085 } 086 } 087 088 /** 089 * Returns "2.2" 090 */ 091 public String getVersion() { 092 return "2.2"; 093 } 094 095 096 097 /** 098 * Returns 099 * OBR (OBSERVATION REQUEST) - creates it if necessary 100 */ 101 public OBR getOBR() { 102 OBR retVal = getTyped("OBR", OBR.class); 103 return retVal; 104 } 105 106 107 108 109 /** 110 * Returns 111 * RQD (REQUISITION DETAIL) - creates it if necessary 112 */ 113 public RQD getRQD() { 114 RQD retVal = getTyped("RQD", RQD.class); 115 return retVal; 116 } 117 118 119 120 121 /** 122 * Returns 123 * RQ1 (REQUISITION DETAIL-!) - creates it if necessary 124 */ 125 public RQ1 getRQ1() { 126 RQ1 retVal = getTyped("RQ1", RQ1.class); 127 return retVal; 128 } 129 130 131 132 133 /** 134 * Returns 135 * RXO (PHARMACY PRESCRIPTION ORDER) - creates it if necessary 136 */ 137 public RXO getRXO() { 138 RXO retVal = getTyped("RXO", RXO.class); 139 return retVal; 140 } 141 142 143 144 145 /** 146 * Returns 147 * ODS (DIETARY ORDERS, SUPPLEMENTS, and PREFERENCES) - creates it if necessary 148 */ 149 public ODS getODS() { 150 ODS retVal = getTyped("ODS", ODS.class); 151 return retVal; 152 } 153 154 155 156 157 /** 158 * Returns 159 * ODT (DIET TRAY INSTRUCTION) - creates it if necessary 160 */ 161 public ODT getODT() { 162 ODT retVal = getTyped("ODT", ODT.class); 163 return retVal; 164 } 165 166 167 168 169 /** 170 * Returns 171 * the first repetition of 172 * NTE (NOTES AND COMMENTS) - creates it if necessary 173 */ 174 public NTE getNTE() { 175 NTE retVal = getTyped("NTE", NTE.class); 176 return retVal; 177 } 178 179 180 /** 181 * Returns a specific repetition of 182 * NTE (NOTES AND COMMENTS) - creates it if necessary 183 * 184 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 185 * @throws HL7Exception if the repetition requested is more than one 186 * greater than the number of existing repetitions. 187 */ 188 public NTE getNTE(int rep) { 189 NTE retVal = getTyped("NTE", rep, NTE.class); 190 return retVal; 191 } 192 193 /** 194 * Returns the number of existing repetitions of NTE 195 */ 196 public int getNTEReps() { 197 return getReps("NTE"); 198 } 199 200 /** 201 * <p> 202 * Returns a non-modifiable List containing all current existing repetitions of NTE. 203 * <p> 204 * <p> 205 * Note that unlike {@link #getNTE()}, this method will not create any reps 206 * if none are already present, so an empty list may be returned. 207 * </p> 208 */ 209 public List<NTE> getNTEAll() throws HL7Exception { 210 return getAllAsList("NTE", NTE.class); 211 } 212 213 /** 214 * Inserts a specific repetition of NTE (NOTES AND COMMENTS) 215 * @see AbstractGroup#insertRepetition(Structure, int) 216 */ 217 public void insertNTE(NTE structure, int rep) throws HL7Exception { 218 super.insertRepetition("NTE", structure, rep); 219 } 220 221 222 /** 223 * Inserts a specific repetition of NTE (NOTES AND COMMENTS) 224 * @see AbstractGroup#insertRepetition(Structure, int) 225 */ 226 public NTE insertNTE(int rep) throws HL7Exception { 227 return (NTE)super.insertRepetition("NTE", rep); 228 } 229 230 231 /** 232 * Removes a specific repetition of NTE (NOTES AND COMMENTS) 233 * @see AbstractGroup#removeRepetition(String, int) 234 */ 235 public NTE removeNTE(int rep) throws HL7Exception { 236 return (NTE)super.removeRepetition("NTE", rep); 237 } 238 239 240 241 /** 242 * Returns 243 * the first repetition of 244 * OBX (OBSERVATION RESULT) - creates it if necessary 245 */ 246 public OBX getOBX() { 247 OBX retVal = getTyped("OBX", OBX.class); 248 return retVal; 249 } 250 251 252 /** 253 * Returns a specific repetition of 254 * OBX (OBSERVATION RESULT) - creates it if necessary 255 * 256 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 257 * @throws HL7Exception if the repetition requested is more than one 258 * greater than the number of existing repetitions. 259 */ 260 public OBX getOBX(int rep) { 261 OBX retVal = getTyped("OBX", rep, OBX.class); 262 return retVal; 263 } 264 265 /** 266 * Returns the number of existing repetitions of OBX 267 */ 268 public int getOBXReps() { 269 return getReps("OBX"); 270 } 271 272 /** 273 * <p> 274 * Returns a non-modifiable List containing all current existing repetitions of OBX. 275 * <p> 276 * <p> 277 * Note that unlike {@link #getOBX()}, this method will not create any reps 278 * if none are already present, so an empty list may be returned. 279 * </p> 280 */ 281 public List<OBX> getOBXAll() throws HL7Exception { 282 return getAllAsList("OBX", OBX.class); 283 } 284 285 /** 286 * Inserts a specific repetition of OBX (OBSERVATION RESULT) 287 * @see AbstractGroup#insertRepetition(Structure, int) 288 */ 289 public void insertOBX(OBX structure, int rep) throws HL7Exception { 290 super.insertRepetition("OBX", structure, rep); 291 } 292 293 294 /** 295 * Inserts a specific repetition of OBX (OBSERVATION RESULT) 296 * @see AbstractGroup#insertRepetition(Structure, int) 297 */ 298 public OBX insertOBX(int rep) throws HL7Exception { 299 return (OBX)super.insertRepetition("OBX", rep); 300 } 301 302 303 /** 304 * Removes a specific repetition of OBX (OBSERVATION RESULT) 305 * @see AbstractGroup#removeRepetition(String, int) 306 */ 307 public OBX removeOBX(int rep) throws HL7Exception { 308 return (OBX)super.removeRepetition("OBX", rep); 309 } 310 311 312 313 /** 314 * Returns 315 * the first repetition of 316 * NTE2 (NOTES AND COMMENTS) - creates it if necessary 317 */ 318 public NTE getNTE2() { 319 NTE retVal = getTyped("NTE2", NTE.class); 320 return retVal; 321 } 322 323 324 /** 325 * Returns a specific repetition of 326 * NTE (NOTES AND COMMENTS) - creates it if necessary 327 * 328 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 329 * @throws HL7Exception if the repetition requested is more than one 330 * greater than the number of existing repetitions. 331 */ 332 public NTE getNTE2(int rep) { 333 NTE retVal = getTyped("NTE2", rep, NTE.class); 334 return retVal; 335 } 336 337 /** 338 * Returns the number of existing repetitions of NTE2 339 */ 340 public int getNTE2Reps() { 341 return getReps("NTE2"); 342 } 343 344 /** 345 * <p> 346 * Returns a non-modifiable List containing all current existing repetitions of NTE2. 347 * <p> 348 * <p> 349 * Note that unlike {@link #getNTE2()}, this method will not create any reps 350 * if none are already present, so an empty list may be returned. 351 * </p> 352 */ 353 public List<NTE> getNTE2All() throws HL7Exception { 354 return getAllAsList("NTE2", NTE.class); 355 } 356 357 /** 358 * Inserts a specific repetition of NTE2 (NOTES AND COMMENTS) 359 * @see AbstractGroup#insertRepetition(Structure, int) 360 */ 361 public void insertNTE2(NTE structure, int rep) throws HL7Exception { 362 super.insertRepetition("NTE2", structure, rep); 363 } 364 365 366 /** 367 * Inserts a specific repetition of NTE2 (NOTES AND COMMENTS) 368 * @see AbstractGroup#insertRepetition(Structure, int) 369 */ 370 public NTE insertNTE2(int rep) throws HL7Exception { 371 return (NTE)super.insertRepetition("NTE2", rep); 372 } 373 374 375 /** 376 * Removes a specific repetition of NTE2 (NOTES AND COMMENTS) 377 * @see AbstractGroup#removeRepetition(String, int) 378 */ 379 public NTE removeNTE2(int rep) throws HL7Exception { 380 return (NTE)super.removeRepetition("NTE2", rep); 381 } 382 383 384 385} 386