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.v21.group;
35
36 import ca.uhn.hl7v2.model.v21.segment.*;
37
38 import ca.uhn.hl7v2.HL7Exception;
39 import ca.uhn.hl7v2.parser.ModelClassFactory;
40 import ca.uhn.hl7v2.model.*;
41
42 /**
43 * <p>Represents a BAR_P01_VISIT group structure (a Group object).
44 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
45 * This Group contains the following elements:
46 * </p>
47 * <ul>
48 * <li>1: PV1 (PATIENT VISIT) <b>optional </b></li>
49 * <li>2: DG1 (DIAGNOSIS) <b>optional repeating </b></li>
50 * <li>3: PR1 (PROCEDURES) <b>optional repeating </b></li>
51 * <li>4: GT1 (GUARANTOR) <b>optional repeating </b></li>
52 * <li>5: NK1 (NEXT OF KIN) <b>optional repeating </b></li>
53 * <li>6: IN1 (INSURANCE) <b>optional repeating </b></li>
54 * <li>7: ACC (ACCIDENT) <b>optional </b></li>
55 * <li>8: UB1 (UB82 DATA) <b>optional </b></li>
56 * </ul>
57 */
58 //@SuppressWarnings("unused")
59 public class BAR_P01_VISIT extends AbstractGroup {
60
61 /**
62 * Creates a new BAR_P01_VISIT group
63 */
64 public BAR_P01_VISIT(Group parent, ModelClassFactory factory) {
65 super(parent, factory);
66 init(factory);
67 }
68
69 private void init(ModelClassFactory factory) {
70 try {
71 this.add(PV1.class, false, false, false);
72 this.add(DG1.class, false, true, false);
73 this.add(PR1.class, false, true, false);
74 this.add(GT1.class, false, true, false);
75 this.add(NK1.class, false, true, false);
76 this.add(IN1.class, false, true, false);
77 this.add(ACC.class, false, false, false);
78 this.add(UB1.class, false, false, false);
79 } catch(HL7Exception e) {
80 log.error("Unexpected error creating BAR_P01_VISIT - this is probably a bug in the source code generator.", e);
81 }
82 }
83
84 /**
85 * Returns "2.1"
86 */
87 public String getVersion() {
88 return "2.1";
89 }
90
91
92
93 /**
94 * Returns
95 * PV1 (PATIENT VISIT) - creates it if necessary
96 */
97 public PV1 getPV1() {
98 PV1 retVal = getTyped("PV1", PV1.class);
99 return retVal;
100 }
101
102
103
104
105 /**
106 * Returns
107 * the first repetition of
108 * DG1 (DIAGNOSIS) - creates it if necessary
109 */
110 public DG1 getDG1() {
111 DG1 retVal = getTyped("DG1", DG1.class);
112 return retVal;
113 }
114
115
116 /**
117 * Returns a specific repetition of
118 * DG1 (DIAGNOSIS) - creates it if necessary
119 *
120 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
121 * @throws HL7Exception if the repetition requested is more than one
122 * greater than the number of existing repetitions.
123 */
124 public DG1 getDG1(int rep) {
125 DG1 retVal = getTyped("DG1", rep, DG1.class);
126 return retVal;
127 }
128
129 /**
130 * Returns the number of existing repetitions of DG1
131 */
132 public int getDG1Reps() {
133 return getReps("DG1");
134 }
135
136 /**
137 * <p>
138 * Returns a non-modifiable List containing all current existing repetitions of DG1.
139 * <p>
140 * <p>
141 * Note that unlike {@link #getDG1()}, this method will not create any reps
142 * if none are already present, so an empty list may be returned.
143 * </p>
144 */
145 public java.util.List<DG1> getDG1All() throws HL7Exception {
146 return getAllAsList("DG1", DG1.class);
147 }
148
149 /**
150 * Inserts a specific repetition of DG1 (DIAGNOSIS)
151 * @see AbstractGroup#insertRepetition(Structure, int)
152 */
153 public void insertDG1(DG1 structure, int rep) throws HL7Exception {
154 super.insertRepetition("DG1", structure, rep);
155 }
156
157
158 /**
159 * Inserts a specific repetition of DG1 (DIAGNOSIS)
160 * @see AbstractGroup#insertRepetition(Structure, int)
161 */
162 public DG1 insertDG1(int rep) throws HL7Exception {
163 return (DG1)super.insertRepetition("DG1", rep);
164 }
165
166
167 /**
168 * Removes a specific repetition of DG1 (DIAGNOSIS)
169 * @see AbstractGroup#removeRepetition(String, int)
170 */
171 public DG1 removeDG1(int rep) throws HL7Exception {
172 return (DG1)super.removeRepetition("DG1", rep);
173 }
174
175
176
177 /**
178 * Returns
179 * the first repetition of
180 * PR1 (PROCEDURES) - creates it if necessary
181 */
182 public PR1 getPR1() {
183 PR1 retVal = getTyped("PR1", PR1.class);
184 return retVal;
185 }
186
187
188 /**
189 * Returns a specific repetition of
190 * PR1 (PROCEDURES) - creates it if necessary
191 *
192 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
193 * @throws HL7Exception if the repetition requested is more than one
194 * greater than the number of existing repetitions.
195 */
196 public PR1 getPR1(int rep) {
197 PR1 retVal = getTyped("PR1", rep, PR1.class);
198 return retVal;
199 }
200
201 /**
202 * Returns the number of existing repetitions of PR1
203 */
204 public int getPR1Reps() {
205 return getReps("PR1");
206 }
207
208 /**
209 * <p>
210 * Returns a non-modifiable List containing all current existing repetitions of PR1.
211 * <p>
212 * <p>
213 * Note that unlike {@link #getPR1()}, this method will not create any reps
214 * if none are already present, so an empty list may be returned.
215 * </p>
216 */
217 public java.util.List<PR1> getPR1All() throws HL7Exception {
218 return getAllAsList("PR1", PR1.class);
219 }
220
221 /**
222 * Inserts a specific repetition of PR1 (PROCEDURES)
223 * @see AbstractGroup#insertRepetition(Structure, int)
224 */
225 public void insertPR1(PR1 structure, int rep) throws HL7Exception {
226 super.insertRepetition("PR1", structure, rep);
227 }
228
229
230 /**
231 * Inserts a specific repetition of PR1 (PROCEDURES)
232 * @see AbstractGroup#insertRepetition(Structure, int)
233 */
234 public PR1 insertPR1(int rep) throws HL7Exception {
235 return (PR1)super.insertRepetition("PR1", rep);
236 }
237
238
239 /**
240 * Removes a specific repetition of PR1 (PROCEDURES)
241 * @see AbstractGroup#removeRepetition(String, int)
242 */
243 public PR1 removePR1(int rep) throws HL7Exception {
244 return (PR1)super.removeRepetition("PR1", rep);
245 }
246
247
248
249 /**
250 * Returns
251 * the first repetition of
252 * GT1 (GUARANTOR) - creates it if necessary
253 */
254 public GT1 getGT1() {
255 GT1 retVal = getTyped("GT1", GT1.class);
256 return retVal;
257 }
258
259
260 /**
261 * Returns a specific repetition of
262 * GT1 (GUARANTOR) - creates it if necessary
263 *
264 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
265 * @throws HL7Exception if the repetition requested is more than one
266 * greater than the number of existing repetitions.
267 */
268 public GT1 getGT1(int rep) {
269 GT1 retVal = getTyped("GT1", rep, GT1.class);
270 return retVal;
271 }
272
273 /**
274 * Returns the number of existing repetitions of GT1
275 */
276 public int getGT1Reps() {
277 return getReps("GT1");
278 }
279
280 /**
281 * <p>
282 * Returns a non-modifiable List containing all current existing repetitions of GT1.
283 * <p>
284 * <p>
285 * Note that unlike {@link #getGT1()}, this method will not create any reps
286 * if none are already present, so an empty list may be returned.
287 * </p>
288 */
289 public java.util.List<GT1> getGT1All() throws HL7Exception {
290 return getAllAsList("GT1", GT1.class);
291 }
292
293 /**
294 * Inserts a specific repetition of GT1 (GUARANTOR)
295 * @see AbstractGroup#insertRepetition(Structure, int)
296 */
297 public void insertGT1(GT1 structure, int rep) throws HL7Exception {
298 super.insertRepetition("GT1", structure, rep);
299 }
300
301
302 /**
303 * Inserts a specific repetition of GT1 (GUARANTOR)
304 * @see AbstractGroup#insertRepetition(Structure, int)
305 */
306 public GT1 insertGT1(int rep) throws HL7Exception {
307 return (GT1)super.insertRepetition("GT1", rep);
308 }
309
310
311 /**
312 * Removes a specific repetition of GT1 (GUARANTOR)
313 * @see AbstractGroup#removeRepetition(String, int)
314 */
315 public GT1 removeGT1(int rep) throws HL7Exception {
316 return (GT1)super.removeRepetition("GT1", rep);
317 }
318
319
320
321 /**
322 * Returns
323 * the first repetition of
324 * NK1 (NEXT OF KIN) - creates it if necessary
325 */
326 public NK1 getNK1() {
327 NK1 retVal = getTyped("NK1", NK1.class);
328 return retVal;
329 }
330
331
332 /**
333 * Returns a specific repetition of
334 * NK1 (NEXT OF KIN) - creates it if necessary
335 *
336 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
337 * @throws HL7Exception if the repetition requested is more than one
338 * greater than the number of existing repetitions.
339 */
340 public NK1 getNK1(int rep) {
341 NK1 retVal = getTyped("NK1", rep, NK1.class);
342 return retVal;
343 }
344
345 /**
346 * Returns the number of existing repetitions of NK1
347 */
348 public int getNK1Reps() {
349 return getReps("NK1");
350 }
351
352 /**
353 * <p>
354 * Returns a non-modifiable List containing all current existing repetitions of NK1.
355 * <p>
356 * <p>
357 * Note that unlike {@link #getNK1()}, this method will not create any reps
358 * if none are already present, so an empty list may be returned.
359 * </p>
360 */
361 public java.util.List<NK1> getNK1All() throws HL7Exception {
362 return getAllAsList("NK1", NK1.class);
363 }
364
365 /**
366 * Inserts a specific repetition of NK1 (NEXT OF KIN)
367 * @see AbstractGroup#insertRepetition(Structure, int)
368 */
369 public void insertNK1(NK1 structure, int rep) throws HL7Exception {
370 super.insertRepetition("NK1", structure, rep);
371 }
372
373
374 /**
375 * Inserts a specific repetition of NK1 (NEXT OF KIN)
376 * @see AbstractGroup#insertRepetition(Structure, int)
377 */
378 public NK1 insertNK1(int rep) throws HL7Exception {
379 return (NK1)super.insertRepetition("NK1", rep);
380 }
381
382
383 /**
384 * Removes a specific repetition of NK1 (NEXT OF KIN)
385 * @see AbstractGroup#removeRepetition(String, int)
386 */
387 public NK1 removeNK1(int rep) throws HL7Exception {
388 return (NK1)super.removeRepetition("NK1", rep);
389 }
390
391
392
393 /**
394 * Returns
395 * the first repetition of
396 * IN1 (INSURANCE) - creates it if necessary
397 */
398 public IN1 getIN1() {
399 IN1 retVal = getTyped("IN1", IN1.class);
400 return retVal;
401 }
402
403
404 /**
405 * Returns a specific repetition of
406 * IN1 (INSURANCE) - creates it if necessary
407 *
408 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
409 * @throws HL7Exception if the repetition requested is more than one
410 * greater than the number of existing repetitions.
411 */
412 public IN1 getIN1(int rep) {
413 IN1 retVal = getTyped("IN1", rep, IN1.class);
414 return retVal;
415 }
416
417 /**
418 * Returns the number of existing repetitions of IN1
419 */
420 public int getIN1Reps() {
421 return getReps("IN1");
422 }
423
424 /**
425 * <p>
426 * Returns a non-modifiable List containing all current existing repetitions of IN1.
427 * <p>
428 * <p>
429 * Note that unlike {@link #getIN1()}, this method will not create any reps
430 * if none are already present, so an empty list may be returned.
431 * </p>
432 */
433 public java.util.List<IN1> getIN1All() throws HL7Exception {
434 return getAllAsList("IN1", IN1.class);
435 }
436
437 /**
438 * Inserts a specific repetition of IN1 (INSURANCE)
439 * @see AbstractGroup#insertRepetition(Structure, int)
440 */
441 public void insertIN1(IN1 structure, int rep) throws HL7Exception {
442 super.insertRepetition("IN1", structure, rep);
443 }
444
445
446 /**
447 * Inserts a specific repetition of IN1 (INSURANCE)
448 * @see AbstractGroup#insertRepetition(Structure, int)
449 */
450 public IN1 insertIN1(int rep) throws HL7Exception {
451 return (IN1)super.insertRepetition("IN1", rep);
452 }
453
454
455 /**
456 * Removes a specific repetition of IN1 (INSURANCE)
457 * @see AbstractGroup#removeRepetition(String, int)
458 */
459 public IN1 removeIN1(int rep) throws HL7Exception {
460 return (IN1)super.removeRepetition("IN1", rep);
461 }
462
463
464
465 /**
466 * Returns
467 * ACC (ACCIDENT) - creates it if necessary
468 */
469 public ACC getACC() {
470 ACC retVal = getTyped("ACC", ACC.class);
471 return retVal;
472 }
473
474
475
476
477 /**
478 * Returns
479 * UB1 (UB82 DATA) - creates it if necessary
480 */
481 public UB1 getUB1() {
482 UB1 retVal = getTyped("UB1", UB1.class);
483 return retVal;
484 }
485
486
487
488
489 }
490