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 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033
034package ca.uhn.hl7v2.model.v251.segment;
035
036// import ca.uhn.hl7v2.model.v251.group.*;
037import ca.uhn.hl7v2.model.v251.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047/**
048 *<p>Represents an HL7 URD message segment (Results/update Definition). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>URD-1: R/U Date/Time (TS) <b>optional </b>
052     * <li>URD-2: Report Priority (ID) <b>optional </b>
053     * <li>URD-3: R/U Who Subject Definition (XCN) <b> repeating</b>
054     * <li>URD-4: R/U What Subject Definition (CE) <b>optional repeating</b>
055     * <li>URD-5: R/U What Department Code (CE) <b>optional repeating</b>
056     * <li>URD-6: R/U Display/Print Locations (ST) <b>optional repeating</b>
057     * <li>URD-7: R/U Results Level (ID) <b>optional </b>
058 * </ul>
059 */
060@SuppressWarnings("unused")
061public class URD extends AbstractSegment {
062
063    /** 
064     * Creates a new URD segment
065     */
066    public URD(Group parent, ModelClassFactory factory) {
067       super(parent, factory);
068       init(factory);
069    }
070
071    private void init(ModelClassFactory factory) {
072       try {
073                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "R/U Date/Time");
074                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(109) }, "Report Priority");
075                                  this.add(XCN.class, true, 0, 250, new Object[]{ getMessage() }, "R/U Who Subject Definition");
076                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "R/U What Subject Definition");
077                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "R/U What Department Code");
078                                  this.add(ST.class, false, 0, 20, new Object[]{ getMessage() }, "R/U Display/Print Locations");
079                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(108) }, "R/U Results Level");
080       } catch(HL7Exception e) {
081          log.error("Unexpected error creating URD - this is probably a bug in the source code generator.", e);
082       }
083    }
084
085
086
087    /**
088     * Returns
089     * URD-1: "R/U Date/Time" - creates it if necessary
090     */
091    public TS getRUDateTime() { 
092                TS retVal = this.getTypedField(1, 0);
093                return retVal;
094    }
095    
096    /**
097     * Returns
098     * URD-1: "R/U Date/Time" - creates it if necessary
099     */
100    public TS getUrd1_RUDateTime() { 
101                TS retVal = this.getTypedField(1, 0);
102                return retVal;
103    }
104
105
106
107    /**
108     * Returns
109     * URD-2: "Report Priority" - creates it if necessary
110     */
111    public ID getReportPriority() { 
112                ID retVal = this.getTypedField(2, 0);
113                return retVal;
114    }
115    
116    /**
117     * Returns
118     * URD-2: "Report Priority" - creates it if necessary
119     */
120    public ID getUrd2_ReportPriority() { 
121                ID retVal = this.getTypedField(2, 0);
122                return retVal;
123    }
124
125
126    /**
127     * Returns all repetitions of R/U Who Subject Definition (URD-3).
128     */
129    public XCN[] getRUWhoSubjectDefinition() {
130        XCN[] retVal = this.getTypedField(3, new XCN[0]);
131        return retVal;
132    }
133
134
135    /**
136     * Returns all repetitions of R/U Who Subject Definition (URD-3).
137     */
138    public XCN[] getUrd3_RUWhoSubjectDefinition() {
139        XCN[] retVal = this.getTypedField(3, new XCN[0]);
140        return retVal;
141    }
142
143
144    /**
145     * Returns a count of the current number of repetitions of R/U Who Subject Definition (URD-3).
146     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
147     * it will return zero.
148     */
149    public int getRUWhoSubjectDefinitionReps() {
150        return this.getReps(3);
151    }
152
153
154    /**
155     * Returns a specific repetition of
156     * URD-3: "R/U Who Subject Definition" - creates it if necessary
157     *
158     * @param rep The repetition index (0-indexed)
159     */
160    public XCN getRUWhoSubjectDefinition(int rep) { 
161                XCN retVal = this.getTypedField(3, rep);
162                return retVal;
163    }
164
165    /**
166     * Returns a specific repetition of
167     * URD-3: "R/U Who Subject Definition" - creates it if necessary
168     *
169     * @param rep The repetition index (0-indexed)
170     */
171    public XCN getUrd3_RUWhoSubjectDefinition(int rep) { 
172                XCN retVal = this.getTypedField(3, rep);
173                return retVal;
174    }
175
176    /**
177     * Returns a count of the current number of repetitions of R/U Who Subject Definition (URD-3).
178     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
179     * it will return zero.
180     */
181    public int getUrd3_RUWhoSubjectDefinitionReps() {
182        return this.getReps(3);
183    }
184
185
186    /**
187     * Inserts a repetition of
188     * URD-3: "R/U Who Subject Definition" at a specific index
189     *
190     * @param rep The repetition index (0-indexed)
191     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
192     */
193    public XCN insertRUWhoSubjectDefinition(int rep) throws HL7Exception { 
194        return (XCN) super.insertRepetition(3, rep);
195    }
196
197
198    /**
199     * Inserts a repetition of
200     * URD-3: "R/U Who Subject Definition" at a specific index
201     *
202     * @param rep The repetition index (0-indexed)
203     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
204     */
205    public XCN insertUrd3_RUWhoSubjectDefinition(int rep) throws HL7Exception { 
206        return (XCN) super.insertRepetition(3, rep);
207    }
208
209
210    /**
211     * Removes a repetition of
212     * URD-3: "R/U Who Subject Definition" at a specific index
213     *
214     * @param rep The repetition index (0-indexed)
215     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
216     */
217    public XCN removeRUWhoSubjectDefinition(int rep) throws HL7Exception { 
218        return (XCN) super.removeRepetition(3, rep);
219    }
220
221
222    /**
223     * Removes a repetition of
224     * URD-3: "R/U Who Subject Definition" at a specific index
225     *
226     * @param rep The repetition index (0-indexed)
227     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
228     */
229    public XCN removeUrd3_RUWhoSubjectDefinition(int rep) throws HL7Exception { 
230        return (XCN) super.removeRepetition(3, rep);
231    }
232
233
234
235    /**
236     * Returns all repetitions of R/U What Subject Definition (URD-4).
237     */
238    public CE[] getRUWhatSubjectDefinition() {
239        CE[] retVal = this.getTypedField(4, new CE[0]);
240        return retVal;
241    }
242
243
244    /**
245     * Returns all repetitions of R/U What Subject Definition (URD-4).
246     */
247    public CE[] getUrd4_RUWhatSubjectDefinition() {
248        CE[] retVal = this.getTypedField(4, new CE[0]);
249        return retVal;
250    }
251
252
253    /**
254     * Returns a count of the current number of repetitions of R/U What Subject Definition (URD-4).
255     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
256     * it will return zero.
257     */
258    public int getRUWhatSubjectDefinitionReps() {
259        return this.getReps(4);
260    }
261
262
263    /**
264     * Returns a specific repetition of
265     * URD-4: "R/U What Subject Definition" - creates it if necessary
266     *
267     * @param rep The repetition index (0-indexed)
268     */
269    public CE getRUWhatSubjectDefinition(int rep) { 
270                CE retVal = this.getTypedField(4, rep);
271                return retVal;
272    }
273
274    /**
275     * Returns a specific repetition of
276     * URD-4: "R/U What Subject Definition" - creates it if necessary
277     *
278     * @param rep The repetition index (0-indexed)
279     */
280    public CE getUrd4_RUWhatSubjectDefinition(int rep) { 
281                CE retVal = this.getTypedField(4, rep);
282                return retVal;
283    }
284
285    /**
286     * Returns a count of the current number of repetitions of R/U What Subject Definition (URD-4).
287     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
288     * it will return zero.
289     */
290    public int getUrd4_RUWhatSubjectDefinitionReps() {
291        return this.getReps(4);
292    }
293
294
295    /**
296     * Inserts a repetition of
297     * URD-4: "R/U What Subject Definition" at a specific index
298     *
299     * @param rep The repetition index (0-indexed)
300     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
301     */
302    public CE insertRUWhatSubjectDefinition(int rep) throws HL7Exception { 
303        return (CE) super.insertRepetition(4, rep);
304    }
305
306
307    /**
308     * Inserts a repetition of
309     * URD-4: "R/U What Subject Definition" at a specific index
310     *
311     * @param rep The repetition index (0-indexed)
312     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
313     */
314    public CE insertUrd4_RUWhatSubjectDefinition(int rep) throws HL7Exception { 
315        return (CE) super.insertRepetition(4, rep);
316    }
317
318
319    /**
320     * Removes a repetition of
321     * URD-4: "R/U What Subject Definition" at a specific index
322     *
323     * @param rep The repetition index (0-indexed)
324     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
325     */
326    public CE removeRUWhatSubjectDefinition(int rep) throws HL7Exception { 
327        return (CE) super.removeRepetition(4, rep);
328    }
329
330
331    /**
332     * Removes a repetition of
333     * URD-4: "R/U What Subject Definition" at a specific index
334     *
335     * @param rep The repetition index (0-indexed)
336     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
337     */
338    public CE removeUrd4_RUWhatSubjectDefinition(int rep) throws HL7Exception { 
339        return (CE) super.removeRepetition(4, rep);
340    }
341
342
343
344    /**
345     * Returns all repetitions of R/U What Department Code (URD-5).
346     */
347    public CE[] getRUWhatDepartmentCode() {
348        CE[] retVal = this.getTypedField(5, new CE[0]);
349        return retVal;
350    }
351
352
353    /**
354     * Returns all repetitions of R/U What Department Code (URD-5).
355     */
356    public CE[] getUrd5_RUWhatDepartmentCode() {
357        CE[] retVal = this.getTypedField(5, new CE[0]);
358        return retVal;
359    }
360
361
362    /**
363     * Returns a count of the current number of repetitions of R/U What Department Code (URD-5).
364     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
365     * it will return zero.
366     */
367    public int getRUWhatDepartmentCodeReps() {
368        return this.getReps(5);
369    }
370
371
372    /**
373     * Returns a specific repetition of
374     * URD-5: "R/U What Department Code" - creates it if necessary
375     *
376     * @param rep The repetition index (0-indexed)
377     */
378    public CE getRUWhatDepartmentCode(int rep) { 
379                CE retVal = this.getTypedField(5, rep);
380                return retVal;
381    }
382
383    /**
384     * Returns a specific repetition of
385     * URD-5: "R/U What Department Code" - creates it if necessary
386     *
387     * @param rep The repetition index (0-indexed)
388     */
389    public CE getUrd5_RUWhatDepartmentCode(int rep) { 
390                CE retVal = this.getTypedField(5, rep);
391                return retVal;
392    }
393
394    /**
395     * Returns a count of the current number of repetitions of R/U What Department Code (URD-5).
396     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
397     * it will return zero.
398     */
399    public int getUrd5_RUWhatDepartmentCodeReps() {
400        return this.getReps(5);
401    }
402
403
404    /**
405     * Inserts a repetition of
406     * URD-5: "R/U What Department Code" 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 insertRUWhatDepartmentCode(int rep) throws HL7Exception { 
412        return (CE) super.insertRepetition(5, rep);
413    }
414
415
416    /**
417     * Inserts a repetition of
418     * URD-5: "R/U What Department Code" at a specific index
419     *
420     * @param rep The repetition index (0-indexed)
421     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
422     */
423    public CE insertUrd5_RUWhatDepartmentCode(int rep) throws HL7Exception { 
424        return (CE) super.insertRepetition(5, rep);
425    }
426
427
428    /**
429     * Removes a repetition of
430     * URD-5: "R/U What Department Code" at a specific index
431     *
432     * @param rep The repetition index (0-indexed)
433     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
434     */
435    public CE removeRUWhatDepartmentCode(int rep) throws HL7Exception { 
436        return (CE) super.removeRepetition(5, rep);
437    }
438
439
440    /**
441     * Removes a repetition of
442     * URD-5: "R/U What Department Code" at a specific index
443     *
444     * @param rep The repetition index (0-indexed)
445     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
446     */
447    public CE removeUrd5_RUWhatDepartmentCode(int rep) throws HL7Exception { 
448        return (CE) super.removeRepetition(5, rep);
449    }
450
451
452
453    /**
454     * Returns all repetitions of R/U Display/Print Locations (URD-6).
455     */
456    public ST[] getRUDisplayPrintLocations() {
457        ST[] retVal = this.getTypedField(6, new ST[0]);
458        return retVal;
459    }
460
461
462    /**
463     * Returns all repetitions of R/U Display/Print Locations (URD-6).
464     */
465    public ST[] getUrd6_RUDisplayPrintLocations() {
466        ST[] retVal = this.getTypedField(6, new ST[0]);
467        return retVal;
468    }
469
470
471    /**
472     * Returns a count of the current number of repetitions of R/U Display/Print Locations (URD-6).
473     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
474     * it will return zero.
475     */
476    public int getRUDisplayPrintLocationsReps() {
477        return this.getReps(6);
478    }
479
480
481    /**
482     * Returns a specific repetition of
483     * URD-6: "R/U Display/Print Locations" - creates it if necessary
484     *
485     * @param rep The repetition index (0-indexed)
486     */
487    public ST getRUDisplayPrintLocations(int rep) { 
488                ST retVal = this.getTypedField(6, rep);
489                return retVal;
490    }
491
492    /**
493     * Returns a specific repetition of
494     * URD-6: "R/U Display/Print Locations" - creates it if necessary
495     *
496     * @param rep The repetition index (0-indexed)
497     */
498    public ST getUrd6_RUDisplayPrintLocations(int rep) { 
499                ST retVal = this.getTypedField(6, rep);
500                return retVal;
501    }
502
503    /**
504     * Returns a count of the current number of repetitions of R/U Display/Print Locations (URD-6).
505     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
506     * it will return zero.
507     */
508    public int getUrd6_RUDisplayPrintLocationsReps() {
509        return this.getReps(6);
510    }
511
512
513    /**
514     * Inserts a repetition of
515     * URD-6: "R/U Display/Print Locations" at a specific index
516     *
517     * @param rep The repetition index (0-indexed)
518     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
519     */
520    public ST insertRUDisplayPrintLocations(int rep) throws HL7Exception { 
521        return (ST) super.insertRepetition(6, rep);
522    }
523
524
525    /**
526     * Inserts a repetition of
527     * URD-6: "R/U Display/Print Locations" at a specific index
528     *
529     * @param rep The repetition index (0-indexed)
530     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
531     */
532    public ST insertUrd6_RUDisplayPrintLocations(int rep) throws HL7Exception { 
533        return (ST) super.insertRepetition(6, rep);
534    }
535
536
537    /**
538     * Removes a repetition of
539     * URD-6: "R/U Display/Print Locations" at a specific index
540     *
541     * @param rep The repetition index (0-indexed)
542     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
543     */
544    public ST removeRUDisplayPrintLocations(int rep) throws HL7Exception { 
545        return (ST) super.removeRepetition(6, rep);
546    }
547
548
549    /**
550     * Removes a repetition of
551     * URD-6: "R/U Display/Print Locations" at a specific index
552     *
553     * @param rep The repetition index (0-indexed)
554     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
555     */
556    public ST removeUrd6_RUDisplayPrintLocations(int rep) throws HL7Exception { 
557        return (ST) super.removeRepetition(6, rep);
558    }
559
560
561
562
563    /**
564     * Returns
565     * URD-7: "R/U Results Level" - creates it if necessary
566     */
567    public ID getRUResultsLevel() { 
568                ID retVal = this.getTypedField(7, 0);
569                return retVal;
570    }
571    
572    /**
573     * Returns
574     * URD-7: "R/U Results Level" - creates it if necessary
575     */
576    public ID getUrd7_RUResultsLevel() { 
577                ID retVal = this.getTypedField(7, 0);
578                return retVal;
579    }
580
581
582
583
584
585    /** {@inheritDoc} */   
586    protected Type createNewTypeWithoutReflection(int field) {
587       switch (field) {
588          case 0: return new TS(getMessage());
589          case 1: return new ID(getMessage(), new Integer( 109 ));
590          case 2: return new XCN(getMessage());
591          case 3: return new CE(getMessage());
592          case 4: return new CE(getMessage());
593          case 5: return new ST(getMessage());
594          case 6: return new ID(getMessage(), new Integer( 108 ));
595          default: return null;
596       }
597   }
598
599
600}
601