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