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