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.group;
009
010 import ca.uhn.hl7v2.model.v24.segment.*;
011
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.AbstractGroup;
019 import ca.uhn.hl7v2.model.GenericSegment;
020
021 /**
022 * <p>Represents a PPT_PCL_GOAL group structure (a Group object).
023 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
024 * This Group contains the following elements:
025 * </p>
026 * <ul>
027 * <li>1: GOL (Goal Detail) <b> </b></li>
028 * <li>2: NTE (Notes and Comments) <b>optional repeating</b></li>
029 * <li>3: VAR (Variance) <b>optional repeating</b></li>
030 * <li>4: PPT_PCL_GOAL_ROLE (a Group object) <b>optional repeating</b></li>
031 * <li>5: PPT_PCL_GOAL_OBSERVATION (a Group object) <b>optional repeating</b></li>
032 * <li>6: PPT_PCL_PROBLEM (a Group object) <b>optional repeating</b></li>
033 * <li>7: PPT_PCL_ORDER (a Group object) <b>optional repeating</b></li>
034 * </ul>
035 */
036 public class PPT_PCL_GOAL extends AbstractGroup {
037
038 /**
039 * Creates a new PPT_PCL_GOAL group
040 */
041 public PPT_PCL_GOAL(Group parent, ModelClassFactory factory) {
042 super(parent, factory);
043 init(factory);
044 }
045
046 private void init(ModelClassFactory factory) {
047 try {
048 this.add(GOL.class, true, false);
049 this.add(NTE.class, false, true);
050 this.add(VAR.class, false, true);
051 this.add(PPT_PCL_GOAL_ROLE.class, false, true);
052 this.add(PPT_PCL_GOAL_OBSERVATION.class, false, true);
053 this.add(PPT_PCL_PROBLEM.class, false, true);
054 this.add(PPT_PCL_ORDER.class, false, true);
055 } catch(HL7Exception e) {
056 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PPT_PCL_GOAL - this is probably a bug in the source code generator.", e);
057 }
058 }
059
060 /**
061 * Returns "2.4"
062 */
063 public String getVersion() {
064 return "2.4";
065 }
066
067
068
069 /**
070 * Returns
071 * GOL (Goal Detail) - creates it if necessary
072 */
073 public GOL getGOL() {
074 GOL ret = null;
075 try {
076 ret = (GOL)this.get("GOL");
077 } catch(HL7Exception e) {
078 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
079 throw new RuntimeException(e);
080 }
081 return ret;
082 }
083
084
085
086
087 /**
088 * Returns
089 * the first repetition of
090 * NTE (Notes and Comments) - creates it if necessary
091 */
092 public NTE getNTE() {
093 NTE ret = null;
094 try {
095 ret = (NTE)this.get("NTE");
096 } catch(HL7Exception e) {
097 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
098 throw new RuntimeException(e);
099 }
100 return ret;
101 }
102
103
104 /**
105 * Returns a specific repetition of
106 * NTE (Notes and Comments) - creates it if necessary
107 *
108 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
109 * @throws HL7Exception if the repetition requested is more than one
110 * greater than the number of existing repetitions.
111 */
112 public NTE getNTE(int rep) {
113 NTE ret = null;
114 try {
115 ret = (NTE)this.get("NTE", rep);
116 } catch(HL7Exception e) {
117 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
118 throw new RuntimeException(e);
119 }
120 return ret;
121 }
122
123 /**
124 * Returns the number of existing repetitions of NTE
125 */
126 public int getNTEReps() {
127 int reps = -1;
128 try {
129 reps = this.getAll("NTE").length;
130 } catch (HL7Exception e) {
131 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
132 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
133 throw new RuntimeException(message);
134 }
135 return reps;
136 }
137
138 /**
139 * Inserts a specific repetition of NTE (Notes and Comments)
140 * @see AbstractGroup#insertRepetition(Structure, int)
141 */
142 public void insertNTE(NTE structure, int rep) throws HL7Exception {
143 super.insertRepetition("NTE", structure, rep);
144 }
145
146
147 /**
148 * Inserts a specific repetition of NTE (Notes and Comments)
149 * @see AbstractGroup#insertRepetition(Structure, int)
150 */
151 public NTE insertNTE(int rep) throws HL7Exception {
152 return (NTE)super.insertRepetition("NTE", rep);
153 }
154
155
156 /**
157 * Removes a specific repetition of NTE (Notes and Comments)
158 * @see AbstractGroup#removeRepetition(String, int)
159 */
160 public NTE removeNTE(int rep) throws HL7Exception {
161 return (NTE)super.removeRepetition("NTE", rep);
162 }
163
164
165
166 /**
167 * Returns
168 * the first repetition of
169 * VAR (Variance) - creates it if necessary
170 */
171 public VAR getVAR() {
172 VAR ret = null;
173 try {
174 ret = (VAR)this.get("VAR");
175 } catch(HL7Exception e) {
176 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
177 throw new RuntimeException(e);
178 }
179 return ret;
180 }
181
182
183 /**
184 * Returns a specific repetition of
185 * VAR (Variance) - creates it if necessary
186 *
187 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
188 * @throws HL7Exception if the repetition requested is more than one
189 * greater than the number of existing repetitions.
190 */
191 public VAR getVAR(int rep) {
192 VAR ret = null;
193 try {
194 ret = (VAR)this.get("VAR", rep);
195 } catch(HL7Exception e) {
196 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
197 throw new RuntimeException(e);
198 }
199 return ret;
200 }
201
202 /**
203 * Returns the number of existing repetitions of VAR
204 */
205 public int getVARReps() {
206 int reps = -1;
207 try {
208 reps = this.getAll("VAR").length;
209 } catch (HL7Exception e) {
210 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
211 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
212 throw new RuntimeException(message);
213 }
214 return reps;
215 }
216
217 /**
218 * Inserts a specific repetition of VAR (Variance)
219 * @see AbstractGroup#insertRepetition(Structure, int)
220 */
221 public void insertVAR(VAR structure, int rep) throws HL7Exception {
222 super.insertRepetition("VAR", structure, rep);
223 }
224
225
226 /**
227 * Inserts a specific repetition of VAR (Variance)
228 * @see AbstractGroup#insertRepetition(Structure, int)
229 */
230 public VAR insertVAR(int rep) throws HL7Exception {
231 return (VAR)super.insertRepetition("VAR", rep);
232 }
233
234
235 /**
236 * Removes a specific repetition of VAR (Variance)
237 * @see AbstractGroup#removeRepetition(String, int)
238 */
239 public VAR removeVAR(int rep) throws HL7Exception {
240 return (VAR)super.removeRepetition("VAR", rep);
241 }
242
243
244
245 /**
246 * Returns
247 * the first repetition of
248 * GOAL_ROLE (a Group object) - creates it if necessary
249 */
250 public PPT_PCL_GOAL_ROLE getGOAL_ROLE() {
251 PPT_PCL_GOAL_ROLE ret = null;
252 try {
253 ret = (PPT_PCL_GOAL_ROLE)this.get("GOAL_ROLE");
254 } catch(HL7Exception e) {
255 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
256 throw new RuntimeException(e);
257 }
258 return ret;
259 }
260
261
262 /**
263 * Returns a specific repetition of
264 * GOAL_ROLE (a Group object) - creates it if necessary
265 *
266 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
267 * @throws HL7Exception if the repetition requested is more than one
268 * greater than the number of existing repetitions.
269 */
270 public PPT_PCL_GOAL_ROLE getGOAL_ROLE(int rep) {
271 PPT_PCL_GOAL_ROLE ret = null;
272 try {
273 ret = (PPT_PCL_GOAL_ROLE)this.get("GOAL_ROLE", rep);
274 } catch(HL7Exception e) {
275 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
276 throw new RuntimeException(e);
277 }
278 return ret;
279 }
280
281 /**
282 * Returns the number of existing repetitions of GOAL_ROLE
283 */
284 public int getGOAL_ROLEReps() {
285 int reps = -1;
286 try {
287 reps = this.getAll("GOAL_ROLE").length;
288 } catch (HL7Exception e) {
289 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
290 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
291 throw new RuntimeException(message);
292 }
293 return reps;
294 }
295
296 /**
297 * Inserts a specific repetition of GOAL_ROLE (a Group object)
298 * @see AbstractGroup#insertRepetition(Structure, int)
299 */
300 public void insertGOAL_ROLE(PPT_PCL_GOAL_ROLE structure, int rep) throws HL7Exception {
301 super.insertRepetition("GOAL_ROLE", structure, rep);
302 }
303
304
305 /**
306 * Inserts a specific repetition of GOAL_ROLE (a Group object)
307 * @see AbstractGroup#insertRepetition(Structure, int)
308 */
309 public PPT_PCL_GOAL_ROLE insertGOAL_ROLE(int rep) throws HL7Exception {
310 return (PPT_PCL_GOAL_ROLE)super.insertRepetition("GOAL_ROLE", rep);
311 }
312
313
314 /**
315 * Removes a specific repetition of GOAL_ROLE (a Group object)
316 * @see AbstractGroup#removeRepetition(String, int)
317 */
318 public PPT_PCL_GOAL_ROLE removeGOAL_ROLE(int rep) throws HL7Exception {
319 return (PPT_PCL_GOAL_ROLE)super.removeRepetition("GOAL_ROLE", rep);
320 }
321
322
323
324 /**
325 * Returns
326 * the first repetition of
327 * GOAL_OBSERVATION (a Group object) - creates it if necessary
328 */
329 public PPT_PCL_GOAL_OBSERVATION getGOAL_OBSERVATION() {
330 PPT_PCL_GOAL_OBSERVATION ret = null;
331 try {
332 ret = (PPT_PCL_GOAL_OBSERVATION)this.get("GOAL_OBSERVATION");
333 } catch(HL7Exception e) {
334 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
335 throw new RuntimeException(e);
336 }
337 return ret;
338 }
339
340
341 /**
342 * Returns a specific repetition of
343 * GOAL_OBSERVATION (a Group object) - creates it if necessary
344 *
345 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
346 * @throws HL7Exception if the repetition requested is more than one
347 * greater than the number of existing repetitions.
348 */
349 public PPT_PCL_GOAL_OBSERVATION getGOAL_OBSERVATION(int rep) {
350 PPT_PCL_GOAL_OBSERVATION ret = null;
351 try {
352 ret = (PPT_PCL_GOAL_OBSERVATION)this.get("GOAL_OBSERVATION", rep);
353 } catch(HL7Exception e) {
354 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
355 throw new RuntimeException(e);
356 }
357 return ret;
358 }
359
360 /**
361 * Returns the number of existing repetitions of GOAL_OBSERVATION
362 */
363 public int getGOAL_OBSERVATIONReps() {
364 int reps = -1;
365 try {
366 reps = this.getAll("GOAL_OBSERVATION").length;
367 } catch (HL7Exception e) {
368 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
369 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
370 throw new RuntimeException(message);
371 }
372 return reps;
373 }
374
375 /**
376 * Inserts a specific repetition of GOAL_OBSERVATION (a Group object)
377 * @see AbstractGroup#insertRepetition(Structure, int)
378 */
379 public void insertGOAL_OBSERVATION(PPT_PCL_GOAL_OBSERVATION structure, int rep) throws HL7Exception {
380 super.insertRepetition("GOAL_OBSERVATION", structure, rep);
381 }
382
383
384 /**
385 * Inserts a specific repetition of GOAL_OBSERVATION (a Group object)
386 * @see AbstractGroup#insertRepetition(Structure, int)
387 */
388 public PPT_PCL_GOAL_OBSERVATION insertGOAL_OBSERVATION(int rep) throws HL7Exception {
389 return (PPT_PCL_GOAL_OBSERVATION)super.insertRepetition("GOAL_OBSERVATION", rep);
390 }
391
392
393 /**
394 * Removes a specific repetition of GOAL_OBSERVATION (a Group object)
395 * @see AbstractGroup#removeRepetition(String, int)
396 */
397 public PPT_PCL_GOAL_OBSERVATION removeGOAL_OBSERVATION(int rep) throws HL7Exception {
398 return (PPT_PCL_GOAL_OBSERVATION)super.removeRepetition("GOAL_OBSERVATION", rep);
399 }
400
401
402
403 /**
404 * Returns
405 * the first repetition of
406 * PROBLEM (a Group object) - creates it if necessary
407 */
408 public PPT_PCL_PROBLEM getPROBLEM() {
409 PPT_PCL_PROBLEM ret = null;
410 try {
411 ret = (PPT_PCL_PROBLEM)this.get("PROBLEM");
412 } catch(HL7Exception e) {
413 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
414 throw new RuntimeException(e);
415 }
416 return ret;
417 }
418
419
420 /**
421 * Returns a specific repetition of
422 * PROBLEM (a Group object) - creates it if necessary
423 *
424 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
425 * @throws HL7Exception if the repetition requested is more than one
426 * greater than the number of existing repetitions.
427 */
428 public PPT_PCL_PROBLEM getPROBLEM(int rep) {
429 PPT_PCL_PROBLEM ret = null;
430 try {
431 ret = (PPT_PCL_PROBLEM)this.get("PROBLEM", rep);
432 } catch(HL7Exception e) {
433 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
434 throw new RuntimeException(e);
435 }
436 return ret;
437 }
438
439 /**
440 * Returns the number of existing repetitions of PROBLEM
441 */
442 public int getPROBLEMReps() {
443 int reps = -1;
444 try {
445 reps = this.getAll("PROBLEM").length;
446 } catch (HL7Exception e) {
447 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
448 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
449 throw new RuntimeException(message);
450 }
451 return reps;
452 }
453
454 /**
455 * Inserts a specific repetition of PROBLEM (a Group object)
456 * @see AbstractGroup#insertRepetition(Structure, int)
457 */
458 public void insertPROBLEM(PPT_PCL_PROBLEM structure, int rep) throws HL7Exception {
459 super.insertRepetition("PROBLEM", structure, rep);
460 }
461
462
463 /**
464 * Inserts a specific repetition of PROBLEM (a Group object)
465 * @see AbstractGroup#insertRepetition(Structure, int)
466 */
467 public PPT_PCL_PROBLEM insertPROBLEM(int rep) throws HL7Exception {
468 return (PPT_PCL_PROBLEM)super.insertRepetition("PROBLEM", rep);
469 }
470
471
472 /**
473 * Removes a specific repetition of PROBLEM (a Group object)
474 * @see AbstractGroup#removeRepetition(String, int)
475 */
476 public PPT_PCL_PROBLEM removePROBLEM(int rep) throws HL7Exception {
477 return (PPT_PCL_PROBLEM)super.removeRepetition("PROBLEM", rep);
478 }
479
480
481
482 /**
483 * Returns
484 * the first repetition of
485 * ORDER (a Group object) - creates it if necessary
486 */
487 public PPT_PCL_ORDER getORDER() {
488 PPT_PCL_ORDER ret = null;
489 try {
490 ret = (PPT_PCL_ORDER)this.get("ORDER");
491 } catch(HL7Exception e) {
492 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
493 throw new RuntimeException(e);
494 }
495 return ret;
496 }
497
498
499 /**
500 * Returns a specific repetition of
501 * ORDER (a Group object) - creates it if necessary
502 *
503 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
504 * @throws HL7Exception if the repetition requested is more than one
505 * greater than the number of existing repetitions.
506 */
507 public PPT_PCL_ORDER getORDER(int rep) {
508 PPT_PCL_ORDER ret = null;
509 try {
510 ret = (PPT_PCL_ORDER)this.get("ORDER", rep);
511 } catch(HL7Exception e) {
512 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
513 throw new RuntimeException(e);
514 }
515 return ret;
516 }
517
518 /**
519 * Returns the number of existing repetitions of ORDER
520 */
521 public int getORDERReps() {
522 int reps = -1;
523 try {
524 reps = this.getAll("ORDER").length;
525 } catch (HL7Exception e) {
526 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
527 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
528 throw new RuntimeException(message);
529 }
530 return reps;
531 }
532
533 /**
534 * Inserts a specific repetition of ORDER (a Group object)
535 * @see AbstractGroup#insertRepetition(Structure, int)
536 */
537 public void insertORDER(PPT_PCL_ORDER structure, int rep) throws HL7Exception {
538 super.insertRepetition("ORDER", structure, rep);
539 }
540
541
542 /**
543 * Inserts a specific repetition of ORDER (a Group object)
544 * @see AbstractGroup#insertRepetition(Structure, int)
545 */
546 public PPT_PCL_ORDER insertORDER(int rep) throws HL7Exception {
547 return (PPT_PCL_ORDER)super.insertRepetition("ORDER", rep);
548 }
549
550
551 /**
552 * Removes a specific repetition of ORDER (a Group object)
553 * @see AbstractGroup#removeRepetition(String, int)
554 */
555 public PPT_PCL_ORDER removeORDER(int rep) throws HL7Exception {
556 return (PPT_PCL_ORDER)super.removeRepetition("ORDER", rep);
557 }
558
559
560
561 }
562