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.v28.message; 035 036import ca.uhn.hl7v2.model.v28.group.*; 037import ca.uhn.hl7v2.model.v28.segment.*; 038 039import ca.uhn.hl7v2.HL7Exception; 040import ca.uhn.hl7v2.parser.ModelClassFactory; 041import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 042import ca.uhn.hl7v2.model.*; 043 044 045/** 046 * <p>Represents a SRM_S01 message structure (see chapter 10.3). This structure contains the 047 * following elements: </p> 048 * <ul> 049 * <li>1: MSH (Message Header) <b> </b> </li> 050 * <li>2: ARQ (Appointment Request) <b> </b> </li> 051 * <li>3: APR (Appointment Preferences) <b>optional </b> </li> 052 * <li>4: NTE (Notes and Comments) <b>optional repeating</b> </li> 053 * <li>5: SRM_S01_PATIENT (a Group object) <b>optional repeating</b> </li> 054 * <li>6: SRM_S01_RESOURCES (a Group object) <b> repeating</b> </li> 055 * </ul> 056 */ 057//@SuppressWarnings("unused") 058public class SRM_S01 extends AbstractMessage { 059 060 /** 061 * Creates a new SRM_S01 message with DefaultModelClassFactory. 062 */ 063 public SRM_S01() { 064 this(new DefaultModelClassFactory()); 065 } 066 067 /** 068 * Creates a new SRM_S01 message with custom ModelClassFactory. 069 */ 070 public SRM_S01(ModelClassFactory factory) { 071 super(factory); 072 init(factory); 073 } 074 075 private void init(ModelClassFactory factory) { 076 try { 077 this.add(MSH.class, true, false); 078 this.add(ARQ.class, true, false); 079 this.add(APR.class, false, false); 080 this.add(NTE.class, false, true); 081 this.add(SRM_S01_PATIENT.class, false, true); 082 this.add(SRM_S01_RESOURCES.class, true, true); 083 } catch(HL7Exception e) { 084 log.error("Unexpected error creating SRM_S01 - this is probably a bug in the source code generator.", e); 085 } 086 } 087 088 089 /** 090 * Returns "2.8" 091 */ 092 public String getVersion() { 093 return "2.8"; 094 } 095 096 097 098 099 /** 100 * <p> 101 * Returns 102 * MSH (Message Header) - creates it if necessary 103 * </p> 104 * 105 * 106 */ 107 public MSH getMSH() { 108 return getTyped("MSH", MSH.class); 109 } 110 111 112 113 114 115 /** 116 * <p> 117 * Returns 118 * ARQ (Appointment Request) - creates it if necessary 119 * </p> 120 * 121 * 122 */ 123 public ARQ getARQ() { 124 return getTyped("ARQ", ARQ.class); 125 } 126 127 128 129 130 131 /** 132 * <p> 133 * Returns 134 * APR (Appointment Preferences) - creates it if necessary 135 * </p> 136 * 137 * 138 */ 139 public APR getAPR() { 140 return getTyped("APR", APR.class); 141 } 142 143 144 145 146 147 /** 148 * <p> 149 * Returns 150 * the first repetition of 151 * NTE (Notes and Comments) - creates it if necessary 152 * </p> 153 * 154 * 155 */ 156 public NTE getNTE() { 157 return getTyped("NTE", NTE.class); 158 } 159 160 161 /** 162 * <p> 163 * Returns a specific repetition of 164 * NTE (Notes and Comments) - creates it if necessary 165 * </p> 166 * 167 * 168 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 169 * @throws HL7Exception if the repetition requested is more than one 170 * greater than the number of existing repetitions. 171 */ 172 public NTE getNTE(int rep) { 173 return getTyped("NTE", rep, NTE.class); 174 } 175 176 /** 177 * <p> 178 * Returns the number of existing repetitions of NTE 179 * </p> 180 * 181 */ 182 public int getNTEReps() { 183 return getReps("NTE"); 184 } 185 186 /** 187 * <p> 188 * Returns a non-modifiable List containing all current existing repetitions of NTE. 189 * <p> 190 * <p> 191 * Note that unlike {@link #getNTE()}, this method will not create any reps 192 * if none are already present, so an empty list may be returned. 193 * </p> 194 * 195 */ 196 public java.util.List<NTE> getNTEAll() throws HL7Exception { 197 return getAllAsList("NTE", NTE.class); 198 } 199 200 /** 201 * <p> 202 * Inserts a specific repetition of NTE (Notes and Comments) 203 * </p> 204 * 205 * 206 * @see AbstractGroup#insertRepetition(Structure, int) 207 */ 208 public void insertNTE(NTE structure, int rep) throws HL7Exception { 209 super.insertRepetition( "NTE", structure, rep); 210 } 211 212 213 /** 214 * <p> 215 * Inserts a specific repetition of NTE (Notes and Comments) 216 * </p> 217 * 218 * 219 * @see AbstractGroup#insertRepetition(Structure, int) 220 */ 221 public NTE insertNTE(int rep) throws HL7Exception { 222 return (NTE)super.insertRepetition("NTE", rep); 223 } 224 225 226 /** 227 * <p> 228 * Removes a specific repetition of NTE (Notes and Comments) 229 * </p> 230 * 231 * 232 * @see AbstractGroup#removeRepetition(String, int) 233 */ 234 public NTE removeNTE(int rep) throws HL7Exception { 235 return (NTE)super.removeRepetition("NTE", rep); 236 } 237 238 239 240 241 /** 242 * <p> 243 * Returns 244 * the first repetition of 245 * PATIENT (a Group object) - creates it if necessary 246 * </p> 247 * 248 * 249 */ 250 public SRM_S01_PATIENT getPATIENT() { 251 return getTyped("PATIENT", SRM_S01_PATIENT.class); 252 } 253 254 255 /** 256 * <p> 257 * Returns a specific repetition of 258 * PATIENT (a Group object) - creates it if necessary 259 * </p> 260 * 261 * 262 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 263 * @throws HL7Exception if the repetition requested is more than one 264 * greater than the number of existing repetitions. 265 */ 266 public SRM_S01_PATIENT getPATIENT(int rep) { 267 return getTyped("PATIENT", rep, SRM_S01_PATIENT.class); 268 } 269 270 /** 271 * <p> 272 * Returns the number of existing repetitions of PATIENT 273 * </p> 274 * 275 */ 276 public int getPATIENTReps() { 277 return getReps("PATIENT"); 278 } 279 280 /** 281 * <p> 282 * Returns a non-modifiable List containing all current existing repetitions of PATIENT. 283 * <p> 284 * <p> 285 * Note that unlike {@link #getPATIENT()}, this method will not create any reps 286 * if none are already present, so an empty list may be returned. 287 * </p> 288 * 289 */ 290 public java.util.List<SRM_S01_PATIENT> getPATIENTAll() throws HL7Exception { 291 return getAllAsList("PATIENT", SRM_S01_PATIENT.class); 292 } 293 294 /** 295 * <p> 296 * Inserts a specific repetition of PATIENT (a Group object) 297 * </p> 298 * 299 * 300 * @see AbstractGroup#insertRepetition(Structure, int) 301 */ 302 public void insertPATIENT(SRM_S01_PATIENT structure, int rep) throws HL7Exception { 303 super.insertRepetition( "PATIENT", structure, rep); 304 } 305 306 307 /** 308 * <p> 309 * Inserts a specific repetition of PATIENT (a Group object) 310 * </p> 311 * 312 * 313 * @see AbstractGroup#insertRepetition(Structure, int) 314 */ 315 public SRM_S01_PATIENT insertPATIENT(int rep) throws HL7Exception { 316 return (SRM_S01_PATIENT)super.insertRepetition("PATIENT", rep); 317 } 318 319 320 /** 321 * <p> 322 * Removes a specific repetition of PATIENT (a Group object) 323 * </p> 324 * 325 * 326 * @see AbstractGroup#removeRepetition(String, int) 327 */ 328 public SRM_S01_PATIENT removePATIENT(int rep) throws HL7Exception { 329 return (SRM_S01_PATIENT)super.removeRepetition("PATIENT", rep); 330 } 331 332 333 334 335 /** 336 * <p> 337 * Returns 338 * the first repetition of 339 * RESOURCES (a Group object) - creates it if necessary 340 * </p> 341 * 342 * 343 */ 344 public SRM_S01_RESOURCES getRESOURCES() { 345 return getTyped("RESOURCES", SRM_S01_RESOURCES.class); 346 } 347 348 349 /** 350 * <p> 351 * Returns a specific repetition of 352 * RESOURCES (a Group object) - creates it if necessary 353 * </p> 354 * 355 * 356 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 357 * @throws HL7Exception if the repetition requested is more than one 358 * greater than the number of existing repetitions. 359 */ 360 public SRM_S01_RESOURCES getRESOURCES(int rep) { 361 return getTyped("RESOURCES", rep, SRM_S01_RESOURCES.class); 362 } 363 364 /** 365 * <p> 366 * Returns the number of existing repetitions of RESOURCES 367 * </p> 368 * 369 */ 370 public int getRESOURCESReps() { 371 return getReps("RESOURCES"); 372 } 373 374 /** 375 * <p> 376 * Returns a non-modifiable List containing all current existing repetitions of RESOURCES. 377 * <p> 378 * <p> 379 * Note that unlike {@link #getRESOURCES()}, this method will not create any reps 380 * if none are already present, so an empty list may be returned. 381 * </p> 382 * 383 */ 384 public java.util.List<SRM_S01_RESOURCES> getRESOURCESAll() throws HL7Exception { 385 return getAllAsList("RESOURCES", SRM_S01_RESOURCES.class); 386 } 387 388 /** 389 * <p> 390 * Inserts a specific repetition of RESOURCES (a Group object) 391 * </p> 392 * 393 * 394 * @see AbstractGroup#insertRepetition(Structure, int) 395 */ 396 public void insertRESOURCES(SRM_S01_RESOURCES structure, int rep) throws HL7Exception { 397 super.insertRepetition( "RESOURCES", structure, rep); 398 } 399 400 401 /** 402 * <p> 403 * Inserts a specific repetition of RESOURCES (a Group object) 404 * </p> 405 * 406 * 407 * @see AbstractGroup#insertRepetition(Structure, int) 408 */ 409 public SRM_S01_RESOURCES insertRESOURCES(int rep) throws HL7Exception { 410 return (SRM_S01_RESOURCES)super.insertRepetition("RESOURCES", rep); 411 } 412 413 414 /** 415 * <p> 416 * Removes a specific repetition of RESOURCES (a Group object) 417 * </p> 418 * 419 * 420 * @see AbstractGroup#removeRepetition(String, int) 421 */ 422 public SRM_S01_RESOURCES removeRESOURCES(int rep) throws HL7Exception { 423 return (SRM_S01_RESOURCES)super.removeRepetition("RESOURCES", rep); 424 } 425 426 427 428} 429