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.v23.segment;
035
036// import ca.uhn.hl7v2.model.v23.group.*;
037import ca.uhn.hl7v2.model.v23.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/**
049 *<p>Represents an HL7 PR1 message segment (Procedures). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>PR1-1: Set ID - Procedure (SI) <b> </b>
053     * <li>PR1-2: Procedure Coding Method (IS) <b> </b>
054     * <li>PR1-3: Procedure Code (CE) <b>optional </b>
055     * <li>PR1-4: Procedure Description (ST) <b>optional </b>
056     * <li>PR1-5: Procedure Date/Time (TS) <b>optional </b>
057     * <li>PR1-6: Procedure Type (ID) <b> </b>
058     * <li>PR1-7: Procedure Minutes (NM) <b>optional </b>
059     * <li>PR1-8: Anesthesiologist (XCN) <b>optional repeating</b>
060     * <li>PR1-9: Anesthesia Code (IS) <b>optional </b>
061     * <li>PR1-10: Anesthesia Minutes (NM) <b>optional </b>
062     * <li>PR1-11: Surgeon (XCN) <b>optional repeating</b>
063     * <li>PR1-12: Procedure Practitioner (XCN) <b>optional repeating</b>
064     * <li>PR1-13: Consent Code (CE) <b>optional </b>
065     * <li>PR1-14: Procedure Priority (NM) <b>optional </b>
066     * <li>PR1-15: Associated Diagnosis Code (CE) <b>optional </b>
067 * </ul>
068 */
069@SuppressWarnings("unused")
070public class PR1 extends AbstractSegment {
071
072    /** 
073     * Creates a new PR1 segment
074     */
075    public PR1(Group parent, ModelClassFactory factory) {
076       super(parent, factory);
077       init(factory);
078    }
079
080    private void init(ModelClassFactory factory) {
081       try {
082                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - Procedure");
083                                              this.add(IS.class, true, 1, 2, new Object[]{ getMessage(), new Integer(89) }, "Procedure Coding Method");
084                                  this.add(CE.class, false, 1, 80, new Object[]{ getMessage() }, "Procedure Code");
085                                  this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Procedure Description");
086                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Procedure Date/Time");
087                                              this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(230) }, "Procedure Type");
088                                  this.add(NM.class, false, 1, 4, new Object[]{ getMessage() }, "Procedure Minutes");
089                                  this.add(XCN.class, false, 0, 120, new Object[]{ getMessage() }, "Anesthesiologist");
090                                              this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(19) }, "Anesthesia Code");
091                                  this.add(NM.class, false, 1, 4, new Object[]{ getMessage() }, "Anesthesia Minutes");
092                                  this.add(XCN.class, false, 0, 120, new Object[]{ getMessage() }, "Surgeon");
093                                  this.add(XCN.class, false, 0, 230, new Object[]{ getMessage() }, "Procedure Practitioner");
094                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Consent Code");
095                                  this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "Procedure Priority");
096                                  this.add(CE.class, false, 1, 80, new Object[]{ getMessage() }, "Associated Diagnosis Code");
097       } catch(HL7Exception e) {
098          log.error("Unexpected error creating PR1 - this is probably a bug in the source code generator.", e);
099       }
100    }
101
102
103
104    /**
105     * Returns
106     * PR1-1: "Set ID - Procedure" - creates it if necessary
107     */
108    public SI getSetIDProcedure() { 
109                SI retVal = this.getTypedField(1, 0);
110                return retVal;
111    }
112    
113    /**
114     * Returns
115     * PR1-1: "Set ID - Procedure" - creates it if necessary
116     */
117    public SI getPr11_SetIDProcedure() { 
118                SI retVal = this.getTypedField(1, 0);
119                return retVal;
120    }
121
122
123
124    /**
125     * Returns
126     * PR1-2: "Procedure Coding Method" - creates it if necessary
127     */
128    public IS getProcedureCodingMethod() { 
129                IS retVal = this.getTypedField(2, 0);
130                return retVal;
131    }
132    
133    /**
134     * Returns
135     * PR1-2: "Procedure Coding Method" - creates it if necessary
136     */
137    public IS getPr12_ProcedureCodingMethod() { 
138                IS retVal = this.getTypedField(2, 0);
139                return retVal;
140    }
141
142
143
144    /**
145     * Returns
146     * PR1-3: "Procedure Code" - creates it if necessary
147     */
148    public CE getProcedureCode() { 
149                CE retVal = this.getTypedField(3, 0);
150                return retVal;
151    }
152    
153    /**
154     * Returns
155     * PR1-3: "Procedure Code" - creates it if necessary
156     */
157    public CE getPr13_ProcedureCode() { 
158                CE retVal = this.getTypedField(3, 0);
159                return retVal;
160    }
161
162
163
164    /**
165     * Returns
166     * PR1-4: "Procedure Description" - creates it if necessary
167     */
168    public ST getProcedureDescription() { 
169                ST retVal = this.getTypedField(4, 0);
170                return retVal;
171    }
172    
173    /**
174     * Returns
175     * PR1-4: "Procedure Description" - creates it if necessary
176     */
177    public ST getPr14_ProcedureDescription() { 
178                ST retVal = this.getTypedField(4, 0);
179                return retVal;
180    }
181
182
183
184    /**
185     * Returns
186     * PR1-5: "Procedure Date/Time" - creates it if necessary
187     */
188    public TS getProcedureDateTime() { 
189                TS retVal = this.getTypedField(5, 0);
190                return retVal;
191    }
192    
193    /**
194     * Returns
195     * PR1-5: "Procedure Date/Time" - creates it if necessary
196     */
197    public TS getPr15_ProcedureDateTime() { 
198                TS retVal = this.getTypedField(5, 0);
199                return retVal;
200    }
201
202
203
204    /**
205     * Returns
206     * PR1-6: "Procedure Type" - creates it if necessary
207     */
208    public ID getProcedureType() { 
209                ID retVal = this.getTypedField(6, 0);
210                return retVal;
211    }
212    
213    /**
214     * Returns
215     * PR1-6: "Procedure Type" - creates it if necessary
216     */
217    public ID getPr16_ProcedureType() { 
218                ID retVal = this.getTypedField(6, 0);
219                return retVal;
220    }
221
222
223
224    /**
225     * Returns
226     * PR1-7: "Procedure Minutes" - creates it if necessary
227     */
228    public NM getProcedureMinutes() { 
229                NM retVal = this.getTypedField(7, 0);
230                return retVal;
231    }
232    
233    /**
234     * Returns
235     * PR1-7: "Procedure Minutes" - creates it if necessary
236     */
237    public NM getPr17_ProcedureMinutes() { 
238                NM retVal = this.getTypedField(7, 0);
239                return retVal;
240    }
241
242
243    /**
244     * Returns all repetitions of Anesthesiologist (PR1-8).
245     */
246    public XCN[] getAnesthesiologist() {
247        XCN[] retVal = this.getTypedField(8, new XCN[0]);
248        return retVal;
249    }
250
251
252    /**
253     * Returns all repetitions of Anesthesiologist (PR1-8).
254     */
255    public XCN[] getPr18_Anesthesiologist() {
256        XCN[] retVal = this.getTypedField(8, new XCN[0]);
257        return retVal;
258    }
259
260
261    /**
262     * Returns a count of the current number of repetitions of Anesthesiologist (PR1-8).
263     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
264     * it will return zero.
265     */
266    public int getAnesthesiologistReps() {
267        return this.getReps(8);
268    }
269
270
271    /**
272     * Returns a specific repetition of
273     * PR1-8: "Anesthesiologist" - creates it if necessary
274     *
275     * @param rep The repetition index (0-indexed)
276     */
277    public XCN getAnesthesiologist(int rep) { 
278                XCN retVal = this.getTypedField(8, rep);
279                return retVal;
280    }
281
282    /**
283     * Returns a specific repetition of
284     * PR1-8: "Anesthesiologist" - creates it if necessary
285     *
286     * @param rep The repetition index (0-indexed)
287     */
288    public XCN getPr18_Anesthesiologist(int rep) { 
289                XCN retVal = this.getTypedField(8, rep);
290                return retVal;
291    }
292
293    /**
294     * Returns a count of the current number of repetitions of Anesthesiologist (PR1-8).
295     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
296     * it will return zero.
297     */
298    public int getPr18_AnesthesiologistReps() {
299        return this.getReps(8);
300    }
301
302
303    /**
304     * Inserts a repetition of
305     * PR1-8: "Anesthesiologist" at a specific index
306     *
307     * @param rep The repetition index (0-indexed)
308     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
309     */
310    public XCN insertAnesthesiologist(int rep) throws HL7Exception { 
311        return (XCN) super.insertRepetition(8, rep);
312    }
313
314
315    /**
316     * Inserts a repetition of
317     * PR1-8: "Anesthesiologist" at a specific index
318     *
319     * @param rep The repetition index (0-indexed)
320     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
321     */
322    public XCN insertPr18_Anesthesiologist(int rep) throws HL7Exception { 
323        return (XCN) super.insertRepetition(8, rep);
324    }
325
326
327    /**
328     * Removes a repetition of
329     * PR1-8: "Anesthesiologist" at a specific index
330     *
331     * @param rep The repetition index (0-indexed)
332     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
333     */
334    public XCN removeAnesthesiologist(int rep) throws HL7Exception { 
335        return (XCN) super.removeRepetition(8, rep);
336    }
337
338
339    /**
340     * Removes a repetition of
341     * PR1-8: "Anesthesiologist" at a specific index
342     *
343     * @param rep The repetition index (0-indexed)
344     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
345     */
346    public XCN removePr18_Anesthesiologist(int rep) throws HL7Exception { 
347        return (XCN) super.removeRepetition(8, rep);
348    }
349
350
351
352
353    /**
354     * Returns
355     * PR1-9: "Anesthesia Code" - creates it if necessary
356     */
357    public IS getAnesthesiaCode() { 
358                IS retVal = this.getTypedField(9, 0);
359                return retVal;
360    }
361    
362    /**
363     * Returns
364     * PR1-9: "Anesthesia Code" - creates it if necessary
365     */
366    public IS getPr19_AnesthesiaCode() { 
367                IS retVal = this.getTypedField(9, 0);
368                return retVal;
369    }
370
371
372
373    /**
374     * Returns
375     * PR1-10: "Anesthesia Minutes" - creates it if necessary
376     */
377    public NM getAnesthesiaMinutes() { 
378                NM retVal = this.getTypedField(10, 0);
379                return retVal;
380    }
381    
382    /**
383     * Returns
384     * PR1-10: "Anesthesia Minutes" - creates it if necessary
385     */
386    public NM getPr110_AnesthesiaMinutes() { 
387                NM retVal = this.getTypedField(10, 0);
388                return retVal;
389    }
390
391
392    /**
393     * Returns all repetitions of Surgeon (PR1-11).
394     */
395    public XCN[] getSurgeon() {
396        XCN[] retVal = this.getTypedField(11, new XCN[0]);
397        return retVal;
398    }
399
400
401    /**
402     * Returns all repetitions of Surgeon (PR1-11).
403     */
404    public XCN[] getPr111_Surgeon() {
405        XCN[] retVal = this.getTypedField(11, new XCN[0]);
406        return retVal;
407    }
408
409
410    /**
411     * Returns a count of the current number of repetitions of Surgeon (PR1-11).
412     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
413     * it will return zero.
414     */
415    public int getSurgeonReps() {
416        return this.getReps(11);
417    }
418
419
420    /**
421     * Returns a specific repetition of
422     * PR1-11: "Surgeon" - creates it if necessary
423     *
424     * @param rep The repetition index (0-indexed)
425     */
426    public XCN getSurgeon(int rep) { 
427                XCN retVal = this.getTypedField(11, rep);
428                return retVal;
429    }
430
431    /**
432     * Returns a specific repetition of
433     * PR1-11: "Surgeon" - creates it if necessary
434     *
435     * @param rep The repetition index (0-indexed)
436     */
437    public XCN getPr111_Surgeon(int rep) { 
438                XCN retVal = this.getTypedField(11, rep);
439                return retVal;
440    }
441
442    /**
443     * Returns a count of the current number of repetitions of Surgeon (PR1-11).
444     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
445     * it will return zero.
446     */
447    public int getPr111_SurgeonReps() {
448        return this.getReps(11);
449    }
450
451
452    /**
453     * Inserts a repetition of
454     * PR1-11: "Surgeon" at a specific index
455     *
456     * @param rep The repetition index (0-indexed)
457     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
458     */
459    public XCN insertSurgeon(int rep) throws HL7Exception { 
460        return (XCN) super.insertRepetition(11, rep);
461    }
462
463
464    /**
465     * Inserts a repetition of
466     * PR1-11: "Surgeon" at a specific index
467     *
468     * @param rep The repetition index (0-indexed)
469     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
470     */
471    public XCN insertPr111_Surgeon(int rep) throws HL7Exception { 
472        return (XCN) super.insertRepetition(11, rep);
473    }
474
475
476    /**
477     * Removes a repetition of
478     * PR1-11: "Surgeon" at a specific index
479     *
480     * @param rep The repetition index (0-indexed)
481     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
482     */
483    public XCN removeSurgeon(int rep) throws HL7Exception { 
484        return (XCN) super.removeRepetition(11, rep);
485    }
486
487
488    /**
489     * Removes a repetition of
490     * PR1-11: "Surgeon" at a specific index
491     *
492     * @param rep The repetition index (0-indexed)
493     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
494     */
495    public XCN removePr111_Surgeon(int rep) throws HL7Exception { 
496        return (XCN) super.removeRepetition(11, rep);
497    }
498
499
500
501    /**
502     * Returns all repetitions of Procedure Practitioner (PR1-12).
503     */
504    public XCN[] getProcedurePractitioner() {
505        XCN[] retVal = this.getTypedField(12, new XCN[0]);
506        return retVal;
507    }
508
509
510    /**
511     * Returns all repetitions of Procedure Practitioner (PR1-12).
512     */
513    public XCN[] getPr112_ProcedurePractitioner() {
514        XCN[] retVal = this.getTypedField(12, new XCN[0]);
515        return retVal;
516    }
517
518
519    /**
520     * Returns a count of the current number of repetitions of Procedure Practitioner (PR1-12).
521     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
522     * it will return zero.
523     */
524    public int getProcedurePractitionerReps() {
525        return this.getReps(12);
526    }
527
528
529    /**
530     * Returns a specific repetition of
531     * PR1-12: "Procedure Practitioner" - creates it if necessary
532     *
533     * @param rep The repetition index (0-indexed)
534     */
535    public XCN getProcedurePractitioner(int rep) { 
536                XCN retVal = this.getTypedField(12, rep);
537                return retVal;
538    }
539
540    /**
541     * Returns a specific repetition of
542     * PR1-12: "Procedure Practitioner" - creates it if necessary
543     *
544     * @param rep The repetition index (0-indexed)
545     */
546    public XCN getPr112_ProcedurePractitioner(int rep) { 
547                XCN retVal = this.getTypedField(12, rep);
548                return retVal;
549    }
550
551    /**
552     * Returns a count of the current number of repetitions of Procedure Practitioner (PR1-12).
553     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
554     * it will return zero.
555     */
556    public int getPr112_ProcedurePractitionerReps() {
557        return this.getReps(12);
558    }
559
560
561    /**
562     * Inserts a repetition of
563     * PR1-12: "Procedure Practitioner" at a specific index
564     *
565     * @param rep The repetition index (0-indexed)
566     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
567     */
568    public XCN insertProcedurePractitioner(int rep) throws HL7Exception { 
569        return (XCN) super.insertRepetition(12, rep);
570    }
571
572
573    /**
574     * Inserts a repetition of
575     * PR1-12: "Procedure Practitioner" 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 XCN insertPr112_ProcedurePractitioner(int rep) throws HL7Exception { 
581        return (XCN) super.insertRepetition(12, rep);
582    }
583
584
585    /**
586     * Removes a repetition of
587     * PR1-12: "Procedure Practitioner" 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 XCN removeProcedurePractitioner(int rep) throws HL7Exception { 
593        return (XCN) super.removeRepetition(12, rep);
594    }
595
596
597    /**
598     * Removes a repetition of
599     * PR1-12: "Procedure Practitioner" 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 XCN removePr112_ProcedurePractitioner(int rep) throws HL7Exception { 
605        return (XCN) super.removeRepetition(12, rep);
606    }
607
608
609
610
611    /**
612     * Returns
613     * PR1-13: "Consent Code" - creates it if necessary
614     */
615    public CE getConsentCode() { 
616                CE retVal = this.getTypedField(13, 0);
617                return retVal;
618    }
619    
620    /**
621     * Returns
622     * PR1-13: "Consent Code" - creates it if necessary
623     */
624    public CE getPr113_ConsentCode() { 
625                CE retVal = this.getTypedField(13, 0);
626                return retVal;
627    }
628
629
630
631    /**
632     * Returns
633     * PR1-14: "Procedure Priority" - creates it if necessary
634     */
635    public NM getProcedurePriority() { 
636                NM retVal = this.getTypedField(14, 0);
637                return retVal;
638    }
639    
640    /**
641     * Returns
642     * PR1-14: "Procedure Priority" - creates it if necessary
643     */
644    public NM getPr114_ProcedurePriority() { 
645                NM retVal = this.getTypedField(14, 0);
646                return retVal;
647    }
648
649
650
651    /**
652     * Returns
653     * PR1-15: "Associated Diagnosis Code" - creates it if necessary
654     */
655    public CE getAssociatedDiagnosisCode() { 
656                CE retVal = this.getTypedField(15, 0);
657                return retVal;
658    }
659    
660    /**
661     * Returns
662     * PR1-15: "Associated Diagnosis Code" - creates it if necessary
663     */
664    public CE getPr115_AssociatedDiagnosisCode() { 
665                CE retVal = this.getTypedField(15, 0);
666                return retVal;
667    }
668
669
670
671
672
673    /** {@inheritDoc} */   
674    protected Type createNewTypeWithoutReflection(int field) {
675       switch (field) {
676          case 0: return new SI(getMessage());
677          case 1: return new IS(getMessage(), new Integer( 89 ));
678          case 2: return new CE(getMessage());
679          case 3: return new ST(getMessage());
680          case 4: return new TS(getMessage());
681          case 5: return new ID(getMessage(), new Integer( 230 ));
682          case 6: return new NM(getMessage());
683          case 7: return new XCN(getMessage());
684          case 8: return new IS(getMessage(), new Integer( 19 ));
685          case 9: return new NM(getMessage());
686          case 10: return new XCN(getMessage());
687          case 11: return new XCN(getMessage());
688          case 12: return new CE(getMessage());
689          case 13: return new NM(getMessage());
690          case 14: return new CE(getMessage());
691          default: return null;
692       }
693   }
694
695
696}
697