1 /*
2 * This class is an auto-generated source file for a HAPI
3 * HL7 v2.x standard structure class.
4 *
5 * For more information, visit: http://hl7api.sourceforge.net/
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * (the "License"); you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
12 * specific language governing rights and limitations under the License.
13 *
14 * The Original Code is "[file_name]". Description:
15 * "[one_line_description]"
16 *
17 * The Initial Developer of the Original Code is University Health Network. Copyright (C)
18 * 2012. All Rights Reserved.
19 *
20 * Contributor(s): ______________________________________.
21 *
22 * Alternatively, the contents of this file may be used under the terms of the
23 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are
24 * applicable instead of those above. If you wish to allow use of your version of this
25 * file only under the terms of the GPL and not to allow others to use your version
26 * of this file under the MPL, indicate your decision by deleting the provisions above
27 * and replace them with the notice and other provisions required by the GPL License.
28 * If you do not delete the provisions above, a recipient may use your version of
29 * this file under either the MPL or the GPL.
30 *
31 */
32
33
34 package ca.uhn.hl7v2.model.v281.message;
35
36 import ca.uhn.hl7v2.model.v281.group.*;
37 import ca.uhn.hl7v2.model.v281.segment.*;
38
39 import ca.uhn.hl7v2.HL7Exception;
40 import ca.uhn.hl7v2.parser.ModelClassFactory;
41 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
42 import ca.uhn.hl7v2.model.*;
43
44
45 /**
46 * <p>Represents a EHC_E12 message structure (see chapter 16.3.7). This structure contains the
47 * following elements: </p>
48 * <ul>
49 * <li>1: MSH (Message Header) <b> </b> </li>
50 * <li>2: SFT (Software Segment) <b>optional repeating</b> </li>
51 * <li>3: UAC (User Authentication Credential Segment) <b>optional repeating</b> </li>
52 * <li>4: RFI (Request for Information) <b> </b> </li>
53 * <li>5: CTD (Contact Data) <b>optional repeating</b> </li>
54 * <li>6: IVC (Invoice Segment) <b> </b> </li>
55 * <li>7: PSS (Product/Service Section) <b> </b> </li>
56 * <li>8: PSG (Product/Service Group) <b> </b> </li>
57 * <li>9: PID (Patient Identification) <b>optional </b> </li>
58 * <li>10: PSL (Product/Service Line Item) <b>optional repeating</b> </li>
59 * <li>11: EHC_E12_REQUEST (a Group object) <b> repeating</b> </li>
60 * </ul>
61 */
62 //@SuppressWarnings("unused")
63 public class EHC_E12 extends AbstractMessage {
64
65 /**
66 * Creates a new EHC_E12 message with DefaultModelClassFactory.
67 */
68 public EHC_E12() {
69 this(new DefaultModelClassFactory());
70 }
71
72 /**
73 * Creates a new EHC_E12 message with custom ModelClassFactory.
74 */
75 public EHC_E12(ModelClassFactory factory) {
76 super(factory);
77 init(factory);
78 }
79
80 private void init(ModelClassFactory factory) {
81 try {
82 this.add(MSH.class, true, false);
83 this.add(SFT.class, false, true);
84 this.add(UAC.class, false, true);
85 this.add(RFI.class, true, false);
86 this.add(CTD.class, false, true);
87 this.add(IVC.class, true, false);
88 this.add(PSS.class, true, false);
89 this.add(PSG.class, true, false);
90 this.add(PID.class, false, false);
91 this.add(PSL.class, false, true);
92 this.add(EHC_E12_REQUEST.class, true, true);
93 } catch(HL7Exception e) {
94 log.error("Unexpected error creating EHC_E12 - this is probably a bug in the source code generator.", e);
95 }
96 }
97
98
99 /**
100 * Returns "2.8.1"
101 */
102 public String getVersion() {
103 return "2.8.1";
104 }
105
106
107
108
109 /**
110 * <p>
111 * Returns
112 * MSH (Message Header) - creates it if necessary
113 * </p>
114 *
115 *
116 */
117 public MSH getMSH() {
118 return getTyped("MSH", MSH.class);
119 }
120
121
122
123
124
125 /**
126 * <p>
127 * Returns
128 * the first repetition of
129 * SFT (Software Segment) - creates it if necessary
130 * </p>
131 *
132 *
133 */
134 public SFT getSFT() {
135 return getTyped("SFT", SFT.class);
136 }
137
138
139 /**
140 * <p>
141 * Returns a specific repetition of
142 * SFT (Software Segment) - creates it if necessary
143 * </p>
144 *
145 *
146 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
147 * @throws HL7Exception if the repetition requested is more than one
148 * greater than the number of existing repetitions.
149 */
150 public SFT getSFT(int rep) {
151 return getTyped("SFT", rep, SFT.class);
152 }
153
154 /**
155 * <p>
156 * Returns the number of existing repetitions of SFT
157 * </p>
158 *
159 */
160 public int getSFTReps() {
161 return getReps("SFT");
162 }
163
164 /**
165 * <p>
166 * Returns a non-modifiable List containing all current existing repetitions of SFT.
167 * <p>
168 * <p>
169 * Note that unlike {@link #getSFT()}, this method will not create any reps
170 * if none are already present, so an empty list may be returned.
171 * </p>
172 *
173 */
174 public java.util.List<SFT> getSFTAll() throws HL7Exception {
175 return getAllAsList("SFT", SFT.class);
176 }
177
178 /**
179 * <p>
180 * Inserts a specific repetition of SFT (Software Segment)
181 * </p>
182 *
183 *
184 * @see AbstractGroup#insertRepetition(Structure, int)
185 */
186 public void insertSFT(SFT structure, int rep) throws HL7Exception {
187 super.insertRepetition( "SFT", structure, rep);
188 }
189
190
191 /**
192 * <p>
193 * Inserts a specific repetition of SFT (Software Segment)
194 * </p>
195 *
196 *
197 * @see AbstractGroup#insertRepetition(Structure, int)
198 */
199 public SFT insertSFT(int rep) throws HL7Exception {
200 return (SFT)super.insertRepetition("SFT", rep);
201 }
202
203
204 /**
205 * <p>
206 * Removes a specific repetition of SFT (Software Segment)
207 * </p>
208 *
209 *
210 * @see AbstractGroup#removeRepetition(String, int)
211 */
212 public SFT removeSFT(int rep) throws HL7Exception {
213 return (SFT)super.removeRepetition("SFT", rep);
214 }
215
216
217
218
219 /**
220 * <p>
221 * Returns
222 * the first repetition of
223 * UAC (User Authentication Credential Segment) - creates it if necessary
224 * </p>
225 *
226 *
227 */
228 public UAC getUAC() {
229 return getTyped("UAC", UAC.class);
230 }
231
232
233 /**
234 * <p>
235 * Returns a specific repetition of
236 * UAC (User Authentication Credential Segment) - creates it if necessary
237 * </p>
238 *
239 *
240 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
241 * @throws HL7Exception if the repetition requested is more than one
242 * greater than the number of existing repetitions.
243 */
244 public UAC getUAC(int rep) {
245 return getTyped("UAC", rep, UAC.class);
246 }
247
248 /**
249 * <p>
250 * Returns the number of existing repetitions of UAC
251 * </p>
252 *
253 */
254 public int getUACReps() {
255 return getReps("UAC");
256 }
257
258 /**
259 * <p>
260 * Returns a non-modifiable List containing all current existing repetitions of UAC.
261 * <p>
262 * <p>
263 * Note that unlike {@link #getUAC()}, this method will not create any reps
264 * if none are already present, so an empty list may be returned.
265 * </p>
266 *
267 */
268 public java.util.List<UAC> getUACAll() throws HL7Exception {
269 return getAllAsList("UAC", UAC.class);
270 }
271
272 /**
273 * <p>
274 * Inserts a specific repetition of UAC (User Authentication Credential Segment)
275 * </p>
276 *
277 *
278 * @see AbstractGroup#insertRepetition(Structure, int)
279 */
280 public void insertUAC(UAC structure, int rep) throws HL7Exception {
281 super.insertRepetition( "UAC", structure, rep);
282 }
283
284
285 /**
286 * <p>
287 * Inserts a specific repetition of UAC (User Authentication Credential Segment)
288 * </p>
289 *
290 *
291 * @see AbstractGroup#insertRepetition(Structure, int)
292 */
293 public UAC insertUAC(int rep) throws HL7Exception {
294 return (UAC)super.insertRepetition("UAC", rep);
295 }
296
297
298 /**
299 * <p>
300 * Removes a specific repetition of UAC (User Authentication Credential Segment)
301 * </p>
302 *
303 *
304 * @see AbstractGroup#removeRepetition(String, int)
305 */
306 public UAC removeUAC(int rep) throws HL7Exception {
307 return (UAC)super.removeRepetition("UAC", rep);
308 }
309
310
311
312
313 /**
314 * <p>
315 * Returns
316 * RFI (Request for Information) - creates it if necessary
317 * </p>
318 *
319 *
320 */
321 public RFI getRFI() {
322 return getTyped("RFI", RFI.class);
323 }
324
325
326
327
328
329 /**
330 * <p>
331 * Returns
332 * the first repetition of
333 * CTD (Contact Data) - creates it if necessary
334 * </p>
335 *
336 *
337 */
338 public CTD getCTD() {
339 return getTyped("CTD", CTD.class);
340 }
341
342
343 /**
344 * <p>
345 * Returns a specific repetition of
346 * CTD (Contact Data) - creates it if necessary
347 * </p>
348 *
349 *
350 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
351 * @throws HL7Exception if the repetition requested is more than one
352 * greater than the number of existing repetitions.
353 */
354 public CTD getCTD(int rep) {
355 return getTyped("CTD", rep, CTD.class);
356 }
357
358 /**
359 * <p>
360 * Returns the number of existing repetitions of CTD
361 * </p>
362 *
363 */
364 public int getCTDReps() {
365 return getReps("CTD");
366 }
367
368 /**
369 * <p>
370 * Returns a non-modifiable List containing all current existing repetitions of CTD.
371 * <p>
372 * <p>
373 * Note that unlike {@link #getCTD()}, this method will not create any reps
374 * if none are already present, so an empty list may be returned.
375 * </p>
376 *
377 */
378 public java.util.List<CTD> getCTDAll() throws HL7Exception {
379 return getAllAsList("CTD", CTD.class);
380 }
381
382 /**
383 * <p>
384 * Inserts a specific repetition of CTD (Contact Data)
385 * </p>
386 *
387 *
388 * @see AbstractGroup#insertRepetition(Structure, int)
389 */
390 public void insertCTD(CTD structure, int rep) throws HL7Exception {
391 super.insertRepetition( "CTD", structure, rep);
392 }
393
394
395 /**
396 * <p>
397 * Inserts a specific repetition of CTD (Contact Data)
398 * </p>
399 *
400 *
401 * @see AbstractGroup#insertRepetition(Structure, int)
402 */
403 public CTD insertCTD(int rep) throws HL7Exception {
404 return (CTD)super.insertRepetition("CTD", rep);
405 }
406
407
408 /**
409 * <p>
410 * Removes a specific repetition of CTD (Contact Data)
411 * </p>
412 *
413 *
414 * @see AbstractGroup#removeRepetition(String, int)
415 */
416 public CTD removeCTD(int rep) throws HL7Exception {
417 return (CTD)super.removeRepetition("CTD", rep);
418 }
419
420
421
422
423 /**
424 * <p>
425 * Returns
426 * IVC (Invoice Segment) - creates it if necessary
427 * </p>
428 *
429 *
430 */
431 public IVC getIVC() {
432 return getTyped("IVC", IVC.class);
433 }
434
435
436
437
438
439 /**
440 * <p>
441 * Returns
442 * PSS (Product/Service Section) - creates it if necessary
443 * </p>
444 *
445 *
446 */
447 public PSS getPSS() {
448 return getTyped("PSS", PSS.class);
449 }
450
451
452
453
454
455 /**
456 * <p>
457 * Returns
458 * PSG (Product/Service Group) - creates it if necessary
459 * </p>
460 *
461 *
462 */
463 public PSG getPSG() {
464 return getTyped("PSG", PSG.class);
465 }
466
467
468
469
470
471 /**
472 * <p>
473 * Returns
474 * PID (Patient Identification) - creates it if necessary
475 * </p>
476 *
477 *
478 */
479 public PID getPID() {
480 return getTyped("PID", PID.class);
481 }
482
483
484
485
486
487 /**
488 * <p>
489 * Returns
490 * the first repetition of
491 * PSL (Product/Service Line Item) - creates it if necessary
492 * </p>
493 *
494 *
495 */
496 public PSL getPSL() {
497 return getTyped("PSL", PSL.class);
498 }
499
500
501 /**
502 * <p>
503 * Returns a specific repetition of
504 * PSL (Product/Service Line Item) - creates it if necessary
505 * </p>
506 *
507 *
508 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
509 * @throws HL7Exception if the repetition requested is more than one
510 * greater than the number of existing repetitions.
511 */
512 public PSL getPSL(int rep) {
513 return getTyped("PSL", rep, PSL.class);
514 }
515
516 /**
517 * <p>
518 * Returns the number of existing repetitions of PSL
519 * </p>
520 *
521 */
522 public int getPSLReps() {
523 return getReps("PSL");
524 }
525
526 /**
527 * <p>
528 * Returns a non-modifiable List containing all current existing repetitions of PSL.
529 * <p>
530 * <p>
531 * Note that unlike {@link #getPSL()}, this method will not create any reps
532 * if none are already present, so an empty list may be returned.
533 * </p>
534 *
535 */
536 public java.util.List<PSL> getPSLAll() throws HL7Exception {
537 return getAllAsList("PSL", PSL.class);
538 }
539
540 /**
541 * <p>
542 * Inserts a specific repetition of PSL (Product/Service Line Item)
543 * </p>
544 *
545 *
546 * @see AbstractGroup#insertRepetition(Structure, int)
547 */
548 public void insertPSL(PSL structure, int rep) throws HL7Exception {
549 super.insertRepetition( "PSL", structure, rep);
550 }
551
552
553 /**
554 * <p>
555 * Inserts a specific repetition of PSL (Product/Service Line Item)
556 * </p>
557 *
558 *
559 * @see AbstractGroup#insertRepetition(Structure, int)
560 */
561 public PSL insertPSL(int rep) throws HL7Exception {
562 return (PSL)super.insertRepetition("PSL", rep);
563 }
564
565
566 /**
567 * <p>
568 * Removes a specific repetition of PSL (Product/Service Line Item)
569 * </p>
570 *
571 *
572 * @see AbstractGroup#removeRepetition(String, int)
573 */
574 public PSL removePSL(int rep) throws HL7Exception {
575 return (PSL)super.removeRepetition("PSL", rep);
576 }
577
578
579
580
581 /**
582 * <p>
583 * Returns
584 * the first repetition of
585 * REQUEST (a Group object) - creates it if necessary
586 * </p>
587 *
588 *
589 */
590 public EHC_E12_REQUEST getREQUEST() {
591 return getTyped("REQUEST", EHC_E12_REQUEST.class);
592 }
593
594
595 /**
596 * <p>
597 * Returns a specific repetition of
598 * REQUEST (a Group object) - creates it if necessary
599 * </p>
600 *
601 *
602 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
603 * @throws HL7Exception if the repetition requested is more than one
604 * greater than the number of existing repetitions.
605 */
606 public EHC_E12_REQUEST getREQUEST(int rep) {
607 return getTyped("REQUEST", rep, EHC_E12_REQUEST.class);
608 }
609
610 /**
611 * <p>
612 * Returns the number of existing repetitions of REQUEST
613 * </p>
614 *
615 */
616 public int getREQUESTReps() {
617 return getReps("REQUEST");
618 }
619
620 /**
621 * <p>
622 * Returns a non-modifiable List containing all current existing repetitions of REQUEST.
623 * <p>
624 * <p>
625 * Note that unlike {@link #getREQUEST()}, this method will not create any reps
626 * if none are already present, so an empty list may be returned.
627 * </p>
628 *
629 */
630 public java.util.List<EHC_E12_REQUEST> getREQUESTAll() throws HL7Exception {
631 return getAllAsList("REQUEST", EHC_E12_REQUEST.class);
632 }
633
634 /**
635 * <p>
636 * Inserts a specific repetition of REQUEST (a Group object)
637 * </p>
638 *
639 *
640 * @see AbstractGroup#insertRepetition(Structure, int)
641 */
642 public void insertREQUEST(EHC_E12_REQUEST structure, int rep) throws HL7Exception {
643 super.insertRepetition( "REQUEST", structure, rep);
644 }
645
646
647 /**
648 * <p>
649 * Inserts a specific repetition of REQUEST (a Group object)
650 * </p>
651 *
652 *
653 * @see AbstractGroup#insertRepetition(Structure, int)
654 */
655 public EHC_E12_REQUEST insertREQUEST(int rep) throws HL7Exception {
656 return (EHC_E12_REQUEST)super.insertRepetition("REQUEST", rep);
657 }
658
659
660 /**
661 * <p>
662 * Removes a specific repetition of REQUEST (a Group object)
663 * </p>
664 *
665 *
666 * @see AbstractGroup#removeRepetition(String, int)
667 */
668 public EHC_E12_REQUEST removeREQUEST(int rep) throws HL7Exception {
669 return (EHC_E12_REQUEST)super.removeRepetition("REQUEST", rep);
670 }
671
672
673
674 }
675