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.segment;
009
010 // import ca.uhn.hl7v2.model.v24.group.*;
011 import ca.uhn.hl7v2.model.v24.datatype.*;
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.Type;
019 import ca.uhn.hl7v2.model.AbstractSegment;
020 import ca.uhn.hl7v2.model.Varies;
021
022 /**
023 *<p>Represents an HL7 URD message segment (Results/update Definition).
024 * This segment has the following fields:</p>
025 * <ul>
026 * <li>URD-1: R/U Date/Time (TS) <b>optional </b>
027 * <li>URD-2: Report Priority (ID) <b>optional </b>
028 * <li>URD-3: R/U Who Subject Definition (XCN) <b> repeating</b>
029 * <li>URD-4: R/U What Subject Definition (CE) <b>optional repeating</b>
030 * <li>URD-5: R/U What Department Code (CE) <b>optional repeating</b>
031 * <li>URD-6: R/U Display/Print Locations (ST) <b>optional repeating</b>
032 * <li>URD-7: R/U Results Level (ID) <b>optional </b>
033 * </ul>
034 */
035 public class URD extends AbstractSegment {
036
037 /**
038 * Creates a new URD segment
039 */
040 public URD(Group parent, ModelClassFactory factory) {
041 super(parent, factory);
042 init(factory);
043 }
044
045 private void init(ModelClassFactory factory) {
046 try {
047 this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "R/U Date/Time");
048 this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Report Priority");
049 this.add(XCN.class, true, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "R/U Who Subject Definition");
050 this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(48) }, "R/U What Subject Definition");
051 this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "R/U What Department Code");
052 this.add(ST.class, false, 0, 20, new Object[]{ getMessage(), new Integer(0) }, "R/U Display/Print Locations");
053 this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "R/U Results Level");
054 } catch(HL7Exception e) {
055 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating URD - this is probably a bug in the source code generator.", e);
056 }
057 }
058
059
060
061 /**
062 * Returns
063 * URD-1: "R/U Date/Time" - creates it if necessary
064 */
065 public TS getRUDateTime() {
066 TS ret = null;
067 try {
068 Type t = this.getField(1, 0);
069 ret = (TS)t;
070 } catch (ClassCastException cce) {
071 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
072 throw new RuntimeException(cce);
073 } catch (HL7Exception he) {
074 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
075 throw new RuntimeException(he);
076 }
077 return ret;
078 }
079
080
081 /**
082 * Returns
083 * URD-1: "R/U Date/Time" - creates it if necessary
084 */
085 public TS getUrd1_RUDateTime() {
086 TS ret = null;
087 try {
088 Type t = this.getField(1, 0);
089 ret = (TS)t;
090 } catch (ClassCastException cce) {
091 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
092 throw new RuntimeException(cce);
093 } catch (HL7Exception he) {
094 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
095 throw new RuntimeException(he);
096 }
097 return ret;
098 }
099
100
101
102 /**
103 * Returns
104 * URD-2: "Report Priority" - creates it if necessary
105 */
106 public ID getReportPriority() {
107 ID ret = null;
108 try {
109 Type t = this.getField(2, 0);
110 ret = (ID)t;
111 } catch (ClassCastException cce) {
112 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
113 throw new RuntimeException(cce);
114 } catch (HL7Exception he) {
115 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
116 throw new RuntimeException(he);
117 }
118 return ret;
119 }
120
121
122 /**
123 * Returns
124 * URD-2: "Report Priority" - creates it if necessary
125 */
126 public ID getUrd2_ReportPriority() {
127 ID ret = null;
128 try {
129 Type t = this.getField(2, 0);
130 ret = (ID)t;
131 } catch (ClassCastException cce) {
132 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
133 throw new RuntimeException(cce);
134 } catch (HL7Exception he) {
135 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
136 throw new RuntimeException(he);
137 }
138 return ret;
139 }
140
141
142 /**
143 * Returns all repetitions of R/U Who Subject Definition (URD-3).
144 */
145 public XCN[] getRUWhoSubjectDefinition() {
146 XCN[] ret = null;
147 try {
148 Type[] t = this.getField(3);
149 ret = new XCN[t.length];
150 for (int i = 0; i < ret.length; i++) {
151 ret[i] = (XCN)t[i];
152 }
153 } catch (ClassCastException cce) {
154 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
155 throw new RuntimeException(cce);
156 } catch (HL7Exception he) {
157 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
158 throw new RuntimeException(he);
159 }
160 return ret;
161 }
162
163
164 /**
165 * Returns a count of the current number of repetitions of R/U Who Subject Definition (URD-3).
166 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
167 * it will return zero.
168 */
169 public int getRUWhoSubjectDefinitionReps() {
170 XCN[] ret = null;
171 try {
172 Type[] t = this.getField(3);
173 return t.length;
174 } catch (ClassCastException cce) {
175 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
176 throw new RuntimeException(cce);
177 } catch (HL7Exception he) {
178 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
179 throw new RuntimeException(he);
180 }
181 }
182
183
184 /**
185 * Returns a specific repetition of
186 * URD-3: "R/U Who Subject Definition" - creates it if necessary
187 *
188 * @param rep The repetition index (0-indexed)
189 */
190 public XCN getRUWhoSubjectDefinition(int rep) {
191 XCN ret = null;
192 try {
193 Type t = this.getField(3, rep);
194 ret = (XCN)t;
195 } catch (ClassCastException cce) {
196 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
197 throw new RuntimeException(cce);
198 } catch (HL7Exception he) {
199 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
200 throw new RuntimeException(he);
201 }
202 return ret;
203 }
204
205 /**
206 * Returns a specific repetition of
207 * URD-3: "R/U Who Subject Definition" - creates it if necessary
208 *
209 * @param rep The repetition index (0-indexed)
210 */
211 public XCN getUrd3_RUWhoSubjectDefinition(int rep) {
212 XCN ret = null;
213 try {
214 Type t = this.getField(3, rep);
215 ret = (XCN)t;
216 } catch (ClassCastException cce) {
217 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
218 throw new RuntimeException(cce);
219 } catch (HL7Exception he) {
220 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
221 throw new RuntimeException(he);
222 }
223 return ret;
224 }
225
226
227 /**
228 * Returns a count of the current number of repetitions of R/U Who Subject Definition (URD-3).
229 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
230 * it will return zero.
231 */
232 public int getUrd3_RUWhoSubjectDefinitionReps() {
233 XCN[] ret = null;
234 try {
235 Type[] t = this.getField(3);
236 return t.length;
237 } catch (ClassCastException cce) {
238 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
239 throw new RuntimeException(cce);
240 } catch (HL7Exception he) {
241 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
242 throw new RuntimeException(he);
243 }
244 }
245
246
247
248 /**
249 * Inserts a repetition of
250 * URD-3: "R/U Who Subject Definition" at a specific index
251 *
252 * @param rep The repetition index (0-indexed)
253 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
254 */
255 public XCN insertRUWhoSubjectDefinition(int rep) throws HL7Exception {
256 return (XCN) super.insertRepetition(3, rep);
257 }
258
259
260
261 /**
262 * Inserts a repetition of
263 * URD-3: "R/U Who Subject Definition" at a specific index
264 *
265 * @param rep The repetition index (0-indexed)
266 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
267 */
268 public XCN insertUrd3_RUWhoSubjectDefinition(int rep) throws HL7Exception {
269 return (XCN) super.insertRepetition(3, rep);
270 }
271
272
273 /**
274 * Removes a repetition of
275 * URD-3: "R/U Who Subject Definition" at a specific index
276 *
277 * @param rep The repetition index (0-indexed)
278 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
279 */
280 public XCN removeRUWhoSubjectDefinition(int rep) throws HL7Exception {
281 return (XCN) super.removeRepetition(3, rep);
282 }
283
284
285 /**
286 * Removes a repetition of
287 * URD-3: "R/U Who Subject Definition" at a specific index
288 *
289 * @param rep The repetition index (0-indexed)
290 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
291 */
292 public XCN removeUrd3_RUWhoSubjectDefinition(int rep) throws HL7Exception {
293 return (XCN) super.removeRepetition(3, rep);
294 }
295
296
297
298 /**
299 * Returns all repetitions of R/U What Subject Definition (URD-4).
300 */
301 public CE[] getRUWhatSubjectDefinition() {
302 CE[] ret = null;
303 try {
304 Type[] t = this.getField(4);
305 ret = new CE[t.length];
306 for (int i = 0; i < ret.length; i++) {
307 ret[i] = (CE)t[i];
308 }
309 } catch (ClassCastException cce) {
310 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
311 throw new RuntimeException(cce);
312 } catch (HL7Exception he) {
313 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
314 throw new RuntimeException(he);
315 }
316 return ret;
317 }
318
319
320 /**
321 * Returns a count of the current number of repetitions of R/U What Subject Definition (URD-4).
322 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
323 * it will return zero.
324 */
325 public int getRUWhatSubjectDefinitionReps() {
326 CE[] ret = null;
327 try {
328 Type[] t = this.getField(4);
329 return t.length;
330 } catch (ClassCastException cce) {
331 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
332 throw new RuntimeException(cce);
333 } catch (HL7Exception he) {
334 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
335 throw new RuntimeException(he);
336 }
337 }
338
339
340 /**
341 * Returns a specific repetition of
342 * URD-4: "R/U What Subject Definition" - creates it if necessary
343 *
344 * @param rep The repetition index (0-indexed)
345 */
346 public CE getRUWhatSubjectDefinition(int rep) {
347 CE ret = null;
348 try {
349 Type t = this.getField(4, rep);
350 ret = (CE)t;
351 } catch (ClassCastException cce) {
352 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
353 throw new RuntimeException(cce);
354 } catch (HL7Exception he) {
355 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
356 throw new RuntimeException(he);
357 }
358 return ret;
359 }
360
361 /**
362 * Returns a specific repetition of
363 * URD-4: "R/U What Subject Definition" - creates it if necessary
364 *
365 * @param rep The repetition index (0-indexed)
366 */
367 public CE getUrd4_RUWhatSubjectDefinition(int rep) {
368 CE ret = null;
369 try {
370 Type t = this.getField(4, rep);
371 ret = (CE)t;
372 } catch (ClassCastException cce) {
373 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
374 throw new RuntimeException(cce);
375 } catch (HL7Exception he) {
376 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
377 throw new RuntimeException(he);
378 }
379 return ret;
380 }
381
382
383 /**
384 * Returns a count of the current number of repetitions of R/U What Subject Definition (URD-4).
385 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
386 * it will return zero.
387 */
388 public int getUrd4_RUWhatSubjectDefinitionReps() {
389 CE[] ret = null;
390 try {
391 Type[] t = this.getField(4);
392 return t.length;
393 } catch (ClassCastException cce) {
394 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
395 throw new RuntimeException(cce);
396 } catch (HL7Exception he) {
397 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
398 throw new RuntimeException(he);
399 }
400 }
401
402
403
404 /**
405 * Inserts a repetition of
406 * URD-4: "R/U What Subject Definition" at a specific index
407 *
408 * @param rep The repetition index (0-indexed)
409 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
410 */
411 public CE insertRUWhatSubjectDefinition(int rep) throws HL7Exception {
412 return (CE) super.insertRepetition(4, rep);
413 }
414
415
416
417 /**
418 * Inserts a repetition of
419 * URD-4: "R/U What Subject Definition" at a specific index
420 *
421 * @param rep The repetition index (0-indexed)
422 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
423 */
424 public CE insertUrd4_RUWhatSubjectDefinition(int rep) throws HL7Exception {
425 return (CE) super.insertRepetition(4, rep);
426 }
427
428
429 /**
430 * Removes a repetition of
431 * URD-4: "R/U What Subject Definition" at a specific index
432 *
433 * @param rep The repetition index (0-indexed)
434 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
435 */
436 public CE removeRUWhatSubjectDefinition(int rep) throws HL7Exception {
437 return (CE) super.removeRepetition(4, rep);
438 }
439
440
441 /**
442 * Removes a repetition of
443 * URD-4: "R/U What Subject Definition" at a specific index
444 *
445 * @param rep The repetition index (0-indexed)
446 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
447 */
448 public CE removeUrd4_RUWhatSubjectDefinition(int rep) throws HL7Exception {
449 return (CE) super.removeRepetition(4, rep);
450 }
451
452
453
454 /**
455 * Returns all repetitions of R/U What Department Code (URD-5).
456 */
457 public CE[] getRUWhatDepartmentCode() {
458 CE[] ret = null;
459 try {
460 Type[] t = this.getField(5);
461 ret = new CE[t.length];
462 for (int i = 0; i < ret.length; i++) {
463 ret[i] = (CE)t[i];
464 }
465 } catch (ClassCastException cce) {
466 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
467 throw new RuntimeException(cce);
468 } catch (HL7Exception he) {
469 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
470 throw new RuntimeException(he);
471 }
472 return ret;
473 }
474
475
476 /**
477 * Returns a count of the current number of repetitions of R/U What Department Code (URD-5).
478 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
479 * it will return zero.
480 */
481 public int getRUWhatDepartmentCodeReps() {
482 CE[] ret = null;
483 try {
484 Type[] t = this.getField(5);
485 return t.length;
486 } catch (ClassCastException cce) {
487 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
488 throw new RuntimeException(cce);
489 } catch (HL7Exception he) {
490 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
491 throw new RuntimeException(he);
492 }
493 }
494
495
496 /**
497 * Returns a specific repetition of
498 * URD-5: "R/U What Department Code" - creates it if necessary
499 *
500 * @param rep The repetition index (0-indexed)
501 */
502 public CE getRUWhatDepartmentCode(int rep) {
503 CE ret = null;
504 try {
505 Type t = this.getField(5, rep);
506 ret = (CE)t;
507 } catch (ClassCastException cce) {
508 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
509 throw new RuntimeException(cce);
510 } catch (HL7Exception he) {
511 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
512 throw new RuntimeException(he);
513 }
514 return ret;
515 }
516
517 /**
518 * Returns a specific repetition of
519 * URD-5: "R/U What Department Code" - creates it if necessary
520 *
521 * @param rep The repetition index (0-indexed)
522 */
523 public CE getUrd5_RUWhatDepartmentCode(int rep) {
524 CE ret = null;
525 try {
526 Type t = this.getField(5, rep);
527 ret = (CE)t;
528 } catch (ClassCastException cce) {
529 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
530 throw new RuntimeException(cce);
531 } catch (HL7Exception he) {
532 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
533 throw new RuntimeException(he);
534 }
535 return ret;
536 }
537
538
539 /**
540 * Returns a count of the current number of repetitions of R/U What Department Code (URD-5).
541 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
542 * it will return zero.
543 */
544 public int getUrd5_RUWhatDepartmentCodeReps() {
545 CE[] ret = null;
546 try {
547 Type[] t = this.getField(5);
548 return t.length;
549 } catch (ClassCastException cce) {
550 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
551 throw new RuntimeException(cce);
552 } catch (HL7Exception he) {
553 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
554 throw new RuntimeException(he);
555 }
556 }
557
558
559
560 /**
561 * Inserts a repetition of
562 * URD-5: "R/U What Department Code" at a specific index
563 *
564 * @param rep The repetition index (0-indexed)
565 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
566 */
567 public CE insertRUWhatDepartmentCode(int rep) throws HL7Exception {
568 return (CE) super.insertRepetition(5, rep);
569 }
570
571
572
573 /**
574 * Inserts a repetition of
575 * URD-5: "R/U What Department Code" at a specific index
576 *
577 * @param rep The repetition index (0-indexed)
578 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
579 */
580 public CE insertUrd5_RUWhatDepartmentCode(int rep) throws HL7Exception {
581 return (CE) super.insertRepetition(5, rep);
582 }
583
584
585 /**
586 * Removes a repetition of
587 * URD-5: "R/U What Department Code" at a specific index
588 *
589 * @param rep The repetition index (0-indexed)
590 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
591 */
592 public CE removeRUWhatDepartmentCode(int rep) throws HL7Exception {
593 return (CE) super.removeRepetition(5, rep);
594 }
595
596
597 /**
598 * Removes a repetition of
599 * URD-5: "R/U What Department Code" at a specific index
600 *
601 * @param rep The repetition index (0-indexed)
602 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
603 */
604 public CE removeUrd5_RUWhatDepartmentCode(int rep) throws HL7Exception {
605 return (CE) super.removeRepetition(5, rep);
606 }
607
608
609
610 /**
611 * Returns all repetitions of R/U Display/Print Locations (URD-6).
612 */
613 public ST[] getRUDisplayPrintLocations() {
614 ST[] ret = null;
615 try {
616 Type[] t = this.getField(6);
617 ret = new ST[t.length];
618 for (int i = 0; i < ret.length; i++) {
619 ret[i] = (ST)t[i];
620 }
621 } catch (ClassCastException cce) {
622 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
623 throw new RuntimeException(cce);
624 } catch (HL7Exception he) {
625 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
626 throw new RuntimeException(he);
627 }
628 return ret;
629 }
630
631
632 /**
633 * Returns a count of the current number of repetitions of R/U Display/Print Locations (URD-6).
634 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
635 * it will return zero.
636 */
637 public int getRUDisplayPrintLocationsReps() {
638 ST[] ret = null;
639 try {
640 Type[] t = this.getField(6);
641 return t.length;
642 } catch (ClassCastException cce) {
643 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
644 throw new RuntimeException(cce);
645 } catch (HL7Exception he) {
646 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
647 throw new RuntimeException(he);
648 }
649 }
650
651
652 /**
653 * Returns a specific repetition of
654 * URD-6: "R/U Display/Print Locations" - creates it if necessary
655 *
656 * @param rep The repetition index (0-indexed)
657 */
658 public ST getRUDisplayPrintLocations(int rep) {
659 ST ret = null;
660 try {
661 Type t = this.getField(6, rep);
662 ret = (ST)t;
663 } catch (ClassCastException cce) {
664 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
665 throw new RuntimeException(cce);
666 } catch (HL7Exception he) {
667 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
668 throw new RuntimeException(he);
669 }
670 return ret;
671 }
672
673 /**
674 * Returns a specific repetition of
675 * URD-6: "R/U Display/Print Locations" - creates it if necessary
676 *
677 * @param rep The repetition index (0-indexed)
678 */
679 public ST getUrd6_RUDisplayPrintLocations(int rep) {
680 ST ret = null;
681 try {
682 Type t = this.getField(6, rep);
683 ret = (ST)t;
684 } catch (ClassCastException cce) {
685 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
686 throw new RuntimeException(cce);
687 } catch (HL7Exception he) {
688 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
689 throw new RuntimeException(he);
690 }
691 return ret;
692 }
693
694
695 /**
696 * Returns a count of the current number of repetitions of R/U Display/Print Locations (URD-6).
697 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
698 * it will return zero.
699 */
700 public int getUrd6_RUDisplayPrintLocationsReps() {
701 ST[] ret = null;
702 try {
703 Type[] t = this.getField(6);
704 return t.length;
705 } catch (ClassCastException cce) {
706 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
707 throw new RuntimeException(cce);
708 } catch (HL7Exception he) {
709 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
710 throw new RuntimeException(he);
711 }
712 }
713
714
715
716 /**
717 * Inserts a repetition of
718 * URD-6: "R/U Display/Print Locations" at a specific index
719 *
720 * @param rep The repetition index (0-indexed)
721 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
722 */
723 public ST insertRUDisplayPrintLocations(int rep) throws HL7Exception {
724 return (ST) super.insertRepetition(6, rep);
725 }
726
727
728
729 /**
730 * Inserts a repetition of
731 * URD-6: "R/U Display/Print Locations" at a specific index
732 *
733 * @param rep The repetition index (0-indexed)
734 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
735 */
736 public ST insertUrd6_RUDisplayPrintLocations(int rep) throws HL7Exception {
737 return (ST) super.insertRepetition(6, rep);
738 }
739
740
741 /**
742 * Removes a repetition of
743 * URD-6: "R/U Display/Print Locations" at a specific index
744 *
745 * @param rep The repetition index (0-indexed)
746 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
747 */
748 public ST removeRUDisplayPrintLocations(int rep) throws HL7Exception {
749 return (ST) super.removeRepetition(6, rep);
750 }
751
752
753 /**
754 * Removes a repetition of
755 * URD-6: "R/U Display/Print Locations" at a specific index
756 *
757 * @param rep The repetition index (0-indexed)
758 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
759 */
760 public ST removeUrd6_RUDisplayPrintLocations(int rep) throws HL7Exception {
761 return (ST) super.removeRepetition(6, rep);
762 }
763
764
765
766
767 /**
768 * Returns
769 * URD-7: "R/U Results Level" - creates it if necessary
770 */
771 public ID getRUResultsLevel() {
772 ID ret = null;
773 try {
774 Type t = this.getField(7, 0);
775 ret = (ID)t;
776 } catch (ClassCastException cce) {
777 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
778 throw new RuntimeException(cce);
779 } catch (HL7Exception he) {
780 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
781 throw new RuntimeException(he);
782 }
783 return ret;
784 }
785
786
787 /**
788 * Returns
789 * URD-7: "R/U Results Level" - creates it if necessary
790 */
791 public ID getUrd7_RUResultsLevel() {
792 ID ret = null;
793 try {
794 Type t = this.getField(7, 0);
795 ret = (ID)t;
796 } catch (ClassCastException cce) {
797 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
798 throw new RuntimeException(cce);
799 } catch (HL7Exception he) {
800 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
801 throw new RuntimeException(he);
802 }
803 return ret;
804 }
805
806
807
808
809
810 /** {@inheritDoc} */
811 protected Type createNewTypeWithoutReflection(int field) {
812 switch (field) {
813 case 0: return new TS(getMessage());
814 case 1: return new ID(getMessage(), new Integer( 109 ));
815 case 2: return new XCN(getMessage());
816 case 3: return new CE(getMessage());
817 case 4: return new CE(getMessage());
818 case 5: return new ST(getMessage());
819 case 6: return new ID(getMessage(), new Integer( 108 ));
820 default: return null;
821 }
822 }
823
824
825 }
826