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.message;
009
010 import ca.uhn.hl7v2.model.v24.group.*;
011 import ca.uhn.hl7v2.model.v24.segment.*;
012
013 import ca.uhn.log.HapiLogFactory;
014 import ca.uhn.hl7v2.HL7Exception;
015 import ca.uhn.hl7v2.parser.ModelClassFactory;
016 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
017 import ca.uhn.hl7v2.model.AbstractMessage;
018
019 /**
020 * <p>Represents a VXR_V03 message structure (see chapter ?). This structure contains the
021 * following elements: </p>
022 * <ul>
023 * <li>1: MSH (Message Header) <b> </b></li>
024 * <li>2: MSA (Message Acknowledgment) <b> </b></li>
025 * <li>3: QRD (Original-Style Query Definition) <b> </b></li>
026 * <li>4: QRF (Original Style Query Filter) <b>optional </b></li>
027 * <li>5: PID (Patient identification) <b> </b></li>
028 * <li>6: PD1 (patient additional demographic) <b>optional </b></li>
029 * <li>7: NK1 (Next of kin / associated parties) <b>optional repeating</b></li>
030 * <li>8: VXR_V03_PATIENT_VISIT (a Group object) <b>optional </b></li>
031 * <li>9: GT1 (Guarantor) <b>optional repeating</b></li>
032 * <li>10: VXR_V03_INSURANCE (a Group object) <b>optional repeating</b></li>
033 * <li>11: VXR_V03_ORDER (a Group object) <b>optional repeating</b></li>
034 * </ul>
035 */
036 public class VXR_V03 extends AbstractMessage {
037
038 /**
039 * Creates a new VXR_V03 message with DefaultModelClassFactory.
040 */
041 public VXR_V03() {
042 this(new DefaultModelClassFactory());
043 }
044
045 /**
046 * Creates a new VXR_V03 message with custom ModelClassFactory.
047 */
048 public VXR_V03(ModelClassFactory factory) {
049 super(factory);
050 init(factory);
051 }
052
053 private void init(ModelClassFactory factory) {
054 try {
055 this.add(MSH.class, true, false);
056 this.add(MSA.class, true, false);
057 this.add(QRD.class, true, false);
058 this.add(QRF.class, false, false);
059 this.add(PID.class, true, false);
060 this.add(PD1.class, false, false);
061 this.add(NK1.class, false, true);
062 this.add(VXR_V03_PATIENT_VISIT.class, false, false);
063 this.add(GT1.class, false, true);
064 this.add(VXR_V03_INSURANCE.class, false, true);
065 this.add(VXR_V03_ORDER.class, false, true);
066 } catch(HL7Exception e) {
067 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating VXR_V03 - this is probably a bug in the source code generator.", e);
068 }
069 }
070
071 /**
072 * Returns "2.4"
073 */
074 public String getVersion() {
075 return "2.4";
076 }
077
078
079
080 /**
081 * Returns
082 * MSH (Message Header) - creates it if necessary
083 */
084 public MSH getMSH() {
085 MSH ret = null;
086 try {
087 ret = (MSH)this.get("MSH");
088 } catch(HL7Exception e) {
089 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
090 throw new RuntimeException(e);
091 }
092 return ret;
093 }
094
095
096
097
098 /**
099 * Returns
100 * MSA (Message Acknowledgment) - creates it if necessary
101 */
102 public MSA getMSA() {
103 MSA ret = null;
104 try {
105 ret = (MSA)this.get("MSA");
106 } catch(HL7Exception e) {
107 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
108 throw new RuntimeException(e);
109 }
110 return ret;
111 }
112
113
114
115
116 /**
117 * Returns
118 * QRD (Original-Style Query Definition) - creates it if necessary
119 */
120 public QRD getQRD() {
121 QRD ret = null;
122 try {
123 ret = (QRD)this.get("QRD");
124 } catch(HL7Exception e) {
125 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
126 throw new RuntimeException(e);
127 }
128 return ret;
129 }
130
131
132
133
134 /**
135 * Returns
136 * QRF (Original Style Query Filter) - creates it if necessary
137 */
138 public QRF getQRF() {
139 QRF ret = null;
140 try {
141 ret = (QRF)this.get("QRF");
142 } catch(HL7Exception e) {
143 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
144 throw new RuntimeException(e);
145 }
146 return ret;
147 }
148
149
150
151
152 /**
153 * Returns
154 * PID (Patient identification) - creates it if necessary
155 */
156 public PID getPID() {
157 PID ret = null;
158 try {
159 ret = (PID)this.get("PID");
160 } catch(HL7Exception e) {
161 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
162 throw new RuntimeException(e);
163 }
164 return ret;
165 }
166
167
168
169
170 /**
171 * Returns
172 * PD1 (patient additional demographic) - creates it if necessary
173 */
174 public PD1 getPD1() {
175 PD1 ret = null;
176 try {
177 ret = (PD1)this.get("PD1");
178 } catch(HL7Exception e) {
179 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
180 throw new RuntimeException(e);
181 }
182 return ret;
183 }
184
185
186
187
188 /**
189 * Returns
190 * the first repetition of
191 * NK1 (Next of kin / associated parties) - creates it if necessary
192 */
193 public NK1 getNK1() {
194 NK1 ret = null;
195 try {
196 ret = (NK1)this.get("NK1");
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 /**
206 * Returns a specific repetition of
207 * NK1 (Next of kin / associated parties) - creates it if necessary
208 *
209 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
210 * @throws HL7Exception if the repetition requested is more than one
211 * greater than the number of existing repetitions.
212 */
213 public NK1 getNK1(int rep) {
214 NK1 ret = null;
215 try {
216 ret = (NK1)this.get("NK1", rep);
217 } catch(HL7Exception e) {
218 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
219 throw new RuntimeException(e);
220 }
221 return ret;
222 }
223
224 /**
225 * Returns the number of existing repetitions of NK1
226 */
227 public int getNK1Reps() {
228 int reps = -1;
229 try {
230 reps = this.getAll("NK1").length;
231 } catch (HL7Exception e) {
232 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
233 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
234 throw new RuntimeException(message);
235 }
236 return reps;
237 }
238
239 /**
240 * Inserts a specific repetition of NK1 (Next of kin / associated parties)
241 * @see AbstractGroup\#insertRepetition(Structure, int)
242 */
243 public void insertNK1(NK1 structure, int rep) throws HL7Exception {
244 super.insertRepetition( "NK1", structure, rep);
245 }
246
247
248 /**
249 * Inserts a specific repetition of NK1 (Next of kin / associated parties)
250 * @see AbstractGroup\#insertRepetition(Structure, int)
251 */
252 public NK1 insertNK1(int rep) throws HL7Exception {
253 return (NK1)super.insertRepetition("NK1", rep);
254 }
255
256
257 /**
258 * Removes a specific repetition of NK1 (Next of kin / associated parties)
259 * @see AbstractGroup\#removeRepetition(String, int)
260 */
261 public NK1 removeNK1(int rep) throws HL7Exception {
262 return (NK1)super.removeRepetition("NK1", rep);
263 }
264
265
266
267 /**
268 * Returns
269 * PATIENT_VISIT (a Group object) - creates it if necessary
270 */
271 public VXR_V03_PATIENT_VISIT getPATIENT_VISIT() {
272 VXR_V03_PATIENT_VISIT ret = null;
273 try {
274 ret = (VXR_V03_PATIENT_VISIT)this.get("PATIENT_VISIT");
275 } catch(HL7Exception e) {
276 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
277 throw new RuntimeException(e);
278 }
279 return ret;
280 }
281
282
283
284
285 /**
286 * Returns
287 * the first repetition of
288 * GT1 (Guarantor) - creates it if necessary
289 */
290 public GT1 getGT1() {
291 GT1 ret = null;
292 try {
293 ret = (GT1)this.get("GT1");
294 } catch(HL7Exception e) {
295 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
296 throw new RuntimeException(e);
297 }
298 return ret;
299 }
300
301
302 /**
303 * Returns a specific repetition of
304 * GT1 (Guarantor) - creates it if necessary
305 *
306 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
307 * @throws HL7Exception if the repetition requested is more than one
308 * greater than the number of existing repetitions.
309 */
310 public GT1 getGT1(int rep) {
311 GT1 ret = null;
312 try {
313 ret = (GT1)this.get("GT1", rep);
314 } catch(HL7Exception e) {
315 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
316 throw new RuntimeException(e);
317 }
318 return ret;
319 }
320
321 /**
322 * Returns the number of existing repetitions of GT1
323 */
324 public int getGT1Reps() {
325 int reps = -1;
326 try {
327 reps = this.getAll("GT1").length;
328 } catch (HL7Exception e) {
329 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
330 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
331 throw new RuntimeException(message);
332 }
333 return reps;
334 }
335
336 /**
337 * Inserts a specific repetition of GT1 (Guarantor)
338 * @see AbstractGroup\#insertRepetition(Structure, int)
339 */
340 public void insertGT1(GT1 structure, int rep) throws HL7Exception {
341 super.insertRepetition( "GT1", structure, rep);
342 }
343
344
345 /**
346 * Inserts a specific repetition of GT1 (Guarantor)
347 * @see AbstractGroup\#insertRepetition(Structure, int)
348 */
349 public GT1 insertGT1(int rep) throws HL7Exception {
350 return (GT1)super.insertRepetition("GT1", rep);
351 }
352
353
354 /**
355 * Removes a specific repetition of GT1 (Guarantor)
356 * @see AbstractGroup\#removeRepetition(String, int)
357 */
358 public GT1 removeGT1(int rep) throws HL7Exception {
359 return (GT1)super.removeRepetition("GT1", rep);
360 }
361
362
363
364 /**
365 * Returns
366 * the first repetition of
367 * INSURANCE (a Group object) - creates it if necessary
368 */
369 public VXR_V03_INSURANCE getINSURANCE() {
370 VXR_V03_INSURANCE ret = null;
371 try {
372 ret = (VXR_V03_INSURANCE)this.get("INSURANCE");
373 } catch(HL7Exception e) {
374 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
375 throw new RuntimeException(e);
376 }
377 return ret;
378 }
379
380
381 /**
382 * Returns a specific repetition of
383 * INSURANCE (a Group object) - creates it if necessary
384 *
385 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
386 * @throws HL7Exception if the repetition requested is more than one
387 * greater than the number of existing repetitions.
388 */
389 public VXR_V03_INSURANCE getINSURANCE(int rep) {
390 VXR_V03_INSURANCE ret = null;
391 try {
392 ret = (VXR_V03_INSURANCE)this.get("INSURANCE", rep);
393 } catch(HL7Exception e) {
394 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
395 throw new RuntimeException(e);
396 }
397 return ret;
398 }
399
400 /**
401 * Returns the number of existing repetitions of INSURANCE
402 */
403 public int getINSURANCEReps() {
404 int reps = -1;
405 try {
406 reps = this.getAll("INSURANCE").length;
407 } catch (HL7Exception e) {
408 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
409 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
410 throw new RuntimeException(message);
411 }
412 return reps;
413 }
414
415 /**
416 * Inserts a specific repetition of INSURANCE (a Group object)
417 * @see AbstractGroup\#insertRepetition(Structure, int)
418 */
419 public void insertINSURANCE(VXR_V03_INSURANCE structure, int rep) throws HL7Exception {
420 super.insertRepetition( "INSURANCE", structure, rep);
421 }
422
423
424 /**
425 * Inserts a specific repetition of INSURANCE (a Group object)
426 * @see AbstractGroup\#insertRepetition(Structure, int)
427 */
428 public VXR_V03_INSURANCE insertINSURANCE(int rep) throws HL7Exception {
429 return (VXR_V03_INSURANCE)super.insertRepetition("INSURANCE", rep);
430 }
431
432
433 /**
434 * Removes a specific repetition of INSURANCE (a Group object)
435 * @see AbstractGroup\#removeRepetition(String, int)
436 */
437 public VXR_V03_INSURANCE removeINSURANCE(int rep) throws HL7Exception {
438 return (VXR_V03_INSURANCE)super.removeRepetition("INSURANCE", rep);
439 }
440
441
442
443 /**
444 * Returns
445 * the first repetition of
446 * ORDER (a Group object) - creates it if necessary
447 */
448 public VXR_V03_ORDER getORDER() {
449 VXR_V03_ORDER ret = null;
450 try {
451 ret = (VXR_V03_ORDER)this.get("ORDER");
452 } catch(HL7Exception e) {
453 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
454 throw new RuntimeException(e);
455 }
456 return ret;
457 }
458
459
460 /**
461 * Returns a specific repetition of
462 * ORDER (a Group object) - creates it if necessary
463 *
464 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
465 * @throws HL7Exception if the repetition requested is more than one
466 * greater than the number of existing repetitions.
467 */
468 public VXR_V03_ORDER getORDER(int rep) {
469 VXR_V03_ORDER ret = null;
470 try {
471 ret = (VXR_V03_ORDER)this.get("ORDER", rep);
472 } catch(HL7Exception e) {
473 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
474 throw new RuntimeException(e);
475 }
476 return ret;
477 }
478
479 /**
480 * Returns the number of existing repetitions of ORDER
481 */
482 public int getORDERReps() {
483 int reps = -1;
484 try {
485 reps = this.getAll("ORDER").length;
486 } catch (HL7Exception e) {
487 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
488 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
489 throw new RuntimeException(message);
490 }
491 return reps;
492 }
493
494 /**
495 * Inserts a specific repetition of ORDER (a Group object)
496 * @see AbstractGroup\#insertRepetition(Structure, int)
497 */
498 public void insertORDER(VXR_V03_ORDER structure, int rep) throws HL7Exception {
499 super.insertRepetition( "ORDER", structure, rep);
500 }
501
502
503 /**
504 * Inserts a specific repetition of ORDER (a Group object)
505 * @see AbstractGroup\#insertRepetition(Structure, int)
506 */
507 public VXR_V03_ORDER insertORDER(int rep) throws HL7Exception {
508 return (VXR_V03_ORDER)super.insertRepetition("ORDER", rep);
509 }
510
511
512 /**
513 * Removes a specific repetition of ORDER (a Group object)
514 * @see AbstractGroup\#removeRepetition(String, int)
515 */
516 public VXR_V03_ORDER removeORDER(int rep) throws HL7Exception {
517 return (VXR_V03_ORDER)super.removeRepetition("ORDER", rep);
518 }
519
520
521
522 }
523