View Javadoc
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.segment;
35  
36  // import ca.uhn.hl7v2.model.v21.group.*;
37  import ca.uhn.hl7v2.model.v21.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 URD message segment (RESULTS/UPDATE DEFINITION). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>URD-1: R/U DATE/TIME (TS) <b>optional </b>
53       * <li>URD-2: REPORT PRIORITY (ID) <b>optional </b>
54       * <li>URD-3: R/U WHO SUBJECT DEFINITION (ST) <b> repeating</b>
55       * <li>URD-4: R/U WHAT SUBJECT DEFINITION (ID) <b>optional repeating</b>
56       * <li>URD-5: R/U WHAT DEPARTMENT CODE (ST) <b>optional repeating</b>
57       * <li>URD-6: R/U DISPLAY/PRINT LOCATIONS (ST) <b>optional repeating</b>
58       * <li>URD-7: R/U RESULTS LEVEL (ID) <b>optional </b>
59   * </ul>
60   */
61  @SuppressWarnings("unused")
62  public class URD extends AbstractSegment {
63  
64      /** 
65       * Creates a new URD segment
66       */
67      public URD(Group parent, ModelClassFactory factory) {
68         super(parent, factory);
69         init(factory);
70      }
71  
72      private void init(ModelClassFactory factory) {
73         try {
74                                    this.add(TS.class, false, 1, 19, new Object[]{ getMessage() }, "R/U DATE/TIME");
75                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(109) }, "REPORT PRIORITY");
76                                    this.add(ST.class, true, 0, 20, new Object[]{ getMessage() }, "R/U WHO SUBJECT DEFINITION");
77                                                this.add(ID.class, false, 0, 3, new Object[]{ getMessage(), new Integer(48) }, "R/U WHAT SUBJECT DEFINITION");
78                                    this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "R/U WHAT DEPARTMENT CODE");
79                                    this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "R/U DISPLAY/PRINT LOCATIONS");
80                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(108) }, "R/U RESULTS LEVEL");
81         } catch(HL7Exception e) {
82            log.error("Unexpected error creating URD - this is probably a bug in the source code generator.", e);
83         }
84      }
85  
86  
87  
88      /**
89       * Returns
90       * URD-1: "R/U DATE/TIME" - creates it if necessary
91       */
92      public TS getRUDATETIME() { 
93  		TS retVal = this.getTypedField(1, 0);
94  		return retVal;
95      }
96      
97      /**
98       * Returns
99       * URD-1: "R/U DATE/TIME" - creates it if necessary
100      */
101     public TS getUrd1_RUDATETIME() { 
102 		TS retVal = this.getTypedField(1, 0);
103 		return retVal;
104     }
105 
106 
107 
108     /**
109      * Returns
110      * URD-2: "REPORT PRIORITY" - creates it if necessary
111      */
112     public ID getREPORTPRIORITY() { 
113 		ID retVal = this.getTypedField(2, 0);
114 		return retVal;
115     }
116     
117     /**
118      * Returns
119      * URD-2: "REPORT PRIORITY" - creates it if necessary
120      */
121     public ID getUrd2_REPORTPRIORITY() { 
122 		ID retVal = this.getTypedField(2, 0);
123 		return retVal;
124     }
125 
126 
127     /**
128      * Returns all repetitions of R/U WHO SUBJECT DEFINITION (URD-3).
129      */
130     public ST[] getRUWHOSUBJECTDEFINITION() {
131     	ST[] retVal = this.getTypedField(3, new ST[0]);
132     	return retVal;
133     }
134 
135 
136     /**
137      * Returns all repetitions of R/U WHO SUBJECT DEFINITION (URD-3).
138      */
139     public ST[] getUrd3_RUWHOSUBJECTDEFINITION() {
140     	ST[] retVal = this.getTypedField(3, new ST[0]);
141     	return retVal;
142     }
143 
144 
145     /**
146      * Returns a count of the current number of repetitions of R/U WHO SUBJECT DEFINITION (URD-3).
147      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
148      * it will return zero.
149      */
150     public int getRUWHOSUBJECTDEFINITIONReps() {
151     	return this.getReps(3);
152     }
153 
154 
155     /**
156      * Returns a specific repetition of
157      * URD-3: "R/U WHO SUBJECT DEFINITION" - creates it if necessary
158      *
159      * @param rep The repetition index (0-indexed)
160      */
161     public ST getRUWHOSUBJECTDEFINITION(int rep) { 
162 		ST retVal = this.getTypedField(3, rep);
163 		return retVal;
164     }
165 
166     /**
167      * Returns a specific repetition of
168      * URD-3: "R/U WHO SUBJECT DEFINITION" - creates it if necessary
169      *
170      * @param rep The repetition index (0-indexed)
171      */
172     public ST getUrd3_RUWHOSUBJECTDEFINITION(int rep) { 
173 		ST retVal = this.getTypedField(3, rep);
174 		return retVal;
175     }
176 
177     /**
178      * Returns a count of the current number of repetitions of R/U WHO SUBJECT DEFINITION (URD-3).
179      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
180      * it will return zero.
181      */
182     public int getUrd3_RUWHOSUBJECTDEFINITIONReps() {
183     	return this.getReps(3);
184     }
185 
186 
187     /**
188      * Inserts a repetition of
189      * URD-3: "R/U WHO SUBJECT DEFINITION" at a specific index
190      *
191      * @param rep The repetition index (0-indexed)
192      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
193      */
194     public ST insertRUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 
195         return (ST) super.insertRepetition(3, rep);
196     }
197 
198 
199     /**
200      * Inserts a repetition of
201      * URD-3: "R/U WHO SUBJECT DEFINITION" at a specific index
202      *
203      * @param rep The repetition index (0-indexed)
204      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
205      */
206     public ST insertUrd3_RUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 
207         return (ST) super.insertRepetition(3, rep);
208     }
209 
210 
211     /**
212      * Removes a repetition of
213      * URD-3: "R/U WHO SUBJECT DEFINITION" at a specific index
214      *
215      * @param rep The repetition index (0-indexed)
216      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
217      */
218     public ST removeRUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 
219         return (ST) super.removeRepetition(3, rep);
220     }
221 
222 
223     /**
224      * Removes a repetition of
225      * URD-3: "R/U WHO SUBJECT DEFINITION" at a specific index
226      *
227      * @param rep The repetition index (0-indexed)
228      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
229      */
230     public ST removeUrd3_RUWHOSUBJECTDEFINITION(int rep) throws HL7Exception { 
231         return (ST) super.removeRepetition(3, rep);
232     }
233 
234 
235 
236     /**
237      * Returns all repetitions of R/U WHAT SUBJECT DEFINITION (URD-4).
238      */
239     public ID[] getRUWHATSUBJECTDEFINITION() {
240     	ID[] retVal = this.getTypedField(4, new ID[0]);
241     	return retVal;
242     }
243 
244 
245     /**
246      * Returns all repetitions of R/U WHAT SUBJECT DEFINITION (URD-4).
247      */
248     public ID[] getUrd4_RUWHATSUBJECTDEFINITION() {
249     	ID[] retVal = this.getTypedField(4, new ID[0]);
250     	return retVal;
251     }
252 
253 
254     /**
255      * Returns a count of the current number of repetitions of R/U WHAT SUBJECT DEFINITION (URD-4).
256      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
257      * it will return zero.
258      */
259     public int getRUWHATSUBJECTDEFINITIONReps() {
260     	return this.getReps(4);
261     }
262 
263 
264     /**
265      * Returns a specific repetition of
266      * URD-4: "R/U WHAT SUBJECT DEFINITION" - creates it if necessary
267      *
268      * @param rep The repetition index (0-indexed)
269      */
270     public ID getRUWHATSUBJECTDEFINITION(int rep) { 
271 		ID retVal = this.getTypedField(4, rep);
272 		return retVal;
273     }
274 
275     /**
276      * Returns a specific repetition of
277      * URD-4: "R/U WHAT SUBJECT DEFINITION" - creates it if necessary
278      *
279      * @param rep The repetition index (0-indexed)
280      */
281     public ID getUrd4_RUWHATSUBJECTDEFINITION(int rep) { 
282 		ID retVal = this.getTypedField(4, rep);
283 		return retVal;
284     }
285 
286     /**
287      * Returns a count of the current number of repetitions of R/U WHAT SUBJECT DEFINITION (URD-4).
288      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
289      * it will return zero.
290      */
291     public int getUrd4_RUWHATSUBJECTDEFINITIONReps() {
292     	return this.getReps(4);
293     }
294 
295 
296     /**
297      * Inserts a repetition of
298      * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index
299      *
300      * @param rep The repetition index (0-indexed)
301      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
302      */
303     public ID insertRUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 
304         return (ID) super.insertRepetition(4, rep);
305     }
306 
307 
308     /**
309      * Inserts a repetition of
310      * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index
311      *
312      * @param rep The repetition index (0-indexed)
313      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
314      */
315     public ID insertUrd4_RUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 
316         return (ID) super.insertRepetition(4, rep);
317     }
318 
319 
320     /**
321      * Removes a repetition of
322      * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index
323      *
324      * @param rep The repetition index (0-indexed)
325      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
326      */
327     public ID removeRUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 
328         return (ID) super.removeRepetition(4, rep);
329     }
330 
331 
332     /**
333      * Removes a repetition of
334      * URD-4: "R/U WHAT SUBJECT DEFINITION" at a specific index
335      *
336      * @param rep The repetition index (0-indexed)
337      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
338      */
339     public ID removeUrd4_RUWHATSUBJECTDEFINITION(int rep) throws HL7Exception { 
340         return (ID) super.removeRepetition(4, rep);
341     }
342 
343 
344 
345     /**
346      * Returns all repetitions of R/U WHAT DEPARTMENT CODE (URD-5).
347      */
348     public ST[] getRUWHATDEPARTMENTCODE() {
349     	ST[] retVal = this.getTypedField(5, new ST[0]);
350     	return retVal;
351     }
352 
353 
354     /**
355      * Returns all repetitions of R/U WHAT DEPARTMENT CODE (URD-5).
356      */
357     public ST[] getUrd5_RUWHATDEPARTMENTCODE() {
358     	ST[] retVal = this.getTypedField(5, new ST[0]);
359     	return retVal;
360     }
361 
362 
363     /**
364      * Returns a count of the current number of repetitions of R/U WHAT DEPARTMENT CODE (URD-5).
365      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
366      * it will return zero.
367      */
368     public int getRUWHATDEPARTMENTCODEReps() {
369     	return this.getReps(5);
370     }
371 
372 
373     /**
374      * Returns a specific repetition of
375      * URD-5: "R/U WHAT DEPARTMENT CODE" - creates it if necessary
376      *
377      * @param rep The repetition index (0-indexed)
378      */
379     public ST getRUWHATDEPARTMENTCODE(int rep) { 
380 		ST retVal = this.getTypedField(5, rep);
381 		return retVal;
382     }
383 
384     /**
385      * Returns a specific repetition of
386      * URD-5: "R/U WHAT DEPARTMENT CODE" - creates it if necessary
387      *
388      * @param rep The repetition index (0-indexed)
389      */
390     public ST getUrd5_RUWHATDEPARTMENTCODE(int rep) { 
391 		ST retVal = this.getTypedField(5, rep);
392 		return retVal;
393     }
394 
395     /**
396      * Returns a count of the current number of repetitions of R/U WHAT DEPARTMENT CODE (URD-5).
397      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
398      * it will return zero.
399      */
400     public int getUrd5_RUWHATDEPARTMENTCODEReps() {
401     	return this.getReps(5);
402     }
403 
404 
405     /**
406      * Inserts a repetition of
407      * URD-5: "R/U WHAT DEPARTMENT CODE" at a specific index
408      *
409      * @param rep The repetition index (0-indexed)
410      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
411      */
412     public ST insertRUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 
413         return (ST) super.insertRepetition(5, rep);
414     }
415 
416 
417     /**
418      * Inserts a repetition of
419      * URD-5: "R/U WHAT DEPARTMENT CODE" 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 ST insertUrd5_RUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 
425         return (ST) super.insertRepetition(5, rep);
426     }
427 
428 
429     /**
430      * Removes a repetition of
431      * URD-5: "R/U WHAT DEPARTMENT CODE" 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 ST removeRUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 
437         return (ST) super.removeRepetition(5, rep);
438     }
439 
440 
441     /**
442      * Removes a repetition of
443      * URD-5: "R/U WHAT DEPARTMENT CODE" 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 ST removeUrd5_RUWHATDEPARTMENTCODE(int rep) throws HL7Exception { 
449         return (ST) super.removeRepetition(5, rep);
450     }
451 
452 
453 
454     /**
455      * Returns all repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-6).
456      */
457     public ST[] getRUDISPLAYPRINTLOCATIONS() {
458     	ST[] retVal = this.getTypedField(6, new ST[0]);
459     	return retVal;
460     }
461 
462 
463     /**
464      * Returns all repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-6).
465      */
466     public ST[] getUrd6_RUDISPLAYPRINTLOCATIONS() {
467     	ST[] retVal = this.getTypedField(6, new ST[0]);
468     	return retVal;
469     }
470 
471 
472     /**
473      * Returns a count of the current number of repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-6).
474      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
475      * it will return zero.
476      */
477     public int getRUDISPLAYPRINTLOCATIONSReps() {
478     	return this.getReps(6);
479     }
480 
481 
482     /**
483      * Returns a specific repetition of
484      * URD-6: "R/U DISPLAY/PRINT LOCATIONS" - creates it if necessary
485      *
486      * @param rep The repetition index (0-indexed)
487      */
488     public ST getRUDISPLAYPRINTLOCATIONS(int rep) { 
489 		ST retVal = this.getTypedField(6, rep);
490 		return retVal;
491     }
492 
493     /**
494      * Returns a specific repetition of
495      * URD-6: "R/U DISPLAY/PRINT LOCATIONS" - creates it if necessary
496      *
497      * @param rep The repetition index (0-indexed)
498      */
499     public ST getUrd6_RUDISPLAYPRINTLOCATIONS(int rep) { 
500 		ST retVal = this.getTypedField(6, rep);
501 		return retVal;
502     }
503 
504     /**
505      * Returns a count of the current number of repetitions of R/U DISPLAY/PRINT LOCATIONS (URD-6).
506      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
507      * it will return zero.
508      */
509     public int getUrd6_RUDISPLAYPRINTLOCATIONSReps() {
510     	return this.getReps(6);
511     }
512 
513 
514     /**
515      * Inserts a repetition of
516      * URD-6: "R/U DISPLAY/PRINT LOCATIONS" at a specific index
517      *
518      * @param rep The repetition index (0-indexed)
519      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
520      */
521     public ST insertRUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 
522         return (ST) super.insertRepetition(6, rep);
523     }
524 
525 
526     /**
527      * Inserts a repetition of
528      * URD-6: "R/U DISPLAY/PRINT LOCATIONS" at a specific index
529      *
530      * @param rep The repetition index (0-indexed)
531      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
532      */
533     public ST insertUrd6_RUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 
534         return (ST) super.insertRepetition(6, rep);
535     }
536 
537 
538     /**
539      * Removes a repetition of
540      * URD-6: "R/U DISPLAY/PRINT LOCATIONS" at a specific index
541      *
542      * @param rep The repetition index (0-indexed)
543      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
544      */
545     public ST removeRUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 
546         return (ST) super.removeRepetition(6, rep);
547     }
548 
549 
550     /**
551      * Removes a repetition of
552      * URD-6: "R/U DISPLAY/PRINT LOCATIONS" at a specific index
553      *
554      * @param rep The repetition index (0-indexed)
555      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
556      */
557     public ST removeUrd6_RUDISPLAYPRINTLOCATIONS(int rep) throws HL7Exception { 
558         return (ST) super.removeRepetition(6, rep);
559     }
560 
561 
562 
563 
564     /**
565      * Returns
566      * URD-7: "R/U RESULTS LEVEL" - creates it if necessary
567      */
568     public ID getRURESULTSLEVEL() { 
569 		ID retVal = this.getTypedField(7, 0);
570 		return retVal;
571     }
572     
573     /**
574      * Returns
575      * URD-7: "R/U RESULTS LEVEL" - creates it if necessary
576      */
577     public ID getUrd7_RURESULTSLEVEL() { 
578 		ID retVal = this.getTypedField(7, 0);
579 		return retVal;
580     }
581 
582 
583 
584 
585 
586     /** {@inheritDoc} */   
587     protected Type createNewTypeWithoutReflection(int field) {
588        switch (field) {
589           case 0: return new TS(getMessage());
590           case 1: return new ID(getMessage(), new Integer( 109 ));
591           case 2: return new ST(getMessage());
592           case 3: return new ID(getMessage(), new Integer( 48 ));
593           case 4: return new ST(getMessage());
594           case 5: return new ST(getMessage());
595           case 6: return new ID(getMessage(), new Integer( 108 ));
596           default: return null;
597        }
598    }
599 
600 
601 }
602