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.message;
035
036import ca.uhn.hl7v2.model.v251.group.*;
037import ca.uhn.hl7v2.model.v251.segment.*;
038
039import java.util.List;
040
041import ca.uhn.hl7v2.HL7Exception;
042import ca.uhn.hl7v2.parser.ModelClassFactory;
043import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
044import ca.uhn.hl7v2.model.AbstractMessage;
045
046/**
047 * <p>Represents a PMU_B01 message structure (see chapter 15.3.1). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (Message Header) <b> </b></li>
051                 * <li>2: SFT (Software Segment) <b>optional repeating</b></li>
052                 * <li>3: EVN (Event Type) <b> </b></li>
053                 * <li>4: STF (Staff Identification) <b> </b></li>
054                 * <li>5: PRA (Practitioner Detail) <b>optional repeating</b></li>
055                 * <li>6: ORG (Practitioner Organization Unit) <b>optional repeating</b></li>
056                 * <li>7: AFF (Professional Affiliation) <b>optional repeating</b></li>
057                 * <li>8: LAN (Language Detail) <b>optional repeating</b></li>
058                 * <li>9: EDU (Educational Detail) <b>optional repeating</b></li>
059                 * <li>10: CER (Certificate Detail) <b>optional repeating</b></li>
060 * </ul>
061 */
062@SuppressWarnings("unused")
063public class PMU_B01 extends AbstractMessage  {
064
065    /**
066     * Creates a new PMU_B01 message with DefaultModelClassFactory. 
067     */ 
068    public PMU_B01() { 
069       this(new DefaultModelClassFactory());
070    }
071
072    /** 
073     * Creates a new PMU_B01 message with custom ModelClassFactory.
074     */
075    public PMU_B01(ModelClassFactory factory) {
076       super(factory);
077       init(factory);
078    }
079
080    private void init(ModelClassFactory factory) {
081       try {
082                          this.add(MSH.class, true, false);
083                          this.add(SFT.class, false, true);
084                          this.add(EVN.class, true, false);
085                          this.add(STF.class, true, false);
086                          this.add(PRA.class, false, true);
087                          this.add(ORG.class, false, true);
088                          this.add(AFF.class, false, true);
089                          this.add(LAN.class, false, true);
090                          this.add(EDU.class, false, true);
091                          this.add(CER.class, false, true);
092       } catch(HL7Exception e) {
093          log.error("Unexpected error creating PMU_B01 - this is probably a bug in the source code generator.", e);
094       }
095    }
096
097    /** 
098     * Returns "2.5.1"
099     */
100    public String getVersion() {
101       return "2.5.1";
102    }
103
104
105
106    /**
107     * Returns
108     * MSH (Message Header) - creates it if necessary
109     */
110    public MSH getMSH() { 
111       return getTyped("MSH", MSH.class);
112    }
113
114
115
116
117    /**
118     * Returns
119     * the first repetition of 
120     * SFT (Software Segment) - creates it if necessary
121     */
122    public SFT getSFT() { 
123       return getTyped("SFT", SFT.class);
124    }
125
126
127    /**
128     * Returns a specific repetition of
129     * SFT (Software Segment) - creates it if necessary
130     *
131     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
132     * @throws HL7Exception if the repetition requested is more than one 
133     *     greater than the number of existing repetitions.
134     */
135    public SFT getSFT(int rep) { 
136       return getTyped("SFT", rep, SFT.class);
137    }
138
139    /** 
140     * Returns the number of existing repetitions of SFT 
141     */ 
142    public int getSFTReps() { 
143        return getReps("SFT");
144    } 
145
146    /** 
147     * <p>
148     * Returns a non-modifiable List containing all current existing repetitions of SFT.
149     * <p>
150     * <p>
151     * Note that unlike {@link #getSFT()}, this method will not create any reps
152     * if none are already present, so an empty list may be returned.
153     * </p>
154     */ 
155    public List<SFT> getSFTAll() throws HL7Exception {
156        return getAllAsList("SFT", SFT.class);
157    } 
158
159    /**
160     * Inserts a specific repetition of SFT (Software Segment)
161     * @see AbstractGroup#insertRepetition(Structure, int) 
162     */
163    public void insertSFT(SFT structure, int rep) throws HL7Exception { 
164       super.insertRepetition( "SFT", structure, rep);
165    }
166
167
168    /**
169     * Inserts a specific repetition of SFT (Software Segment)
170     * @see AbstractGroup#insertRepetition(Structure, int) 
171     */
172    public SFT insertSFT(int rep) throws HL7Exception { 
173       return (SFT)super.insertRepetition("SFT", rep);
174    }
175
176
177    /**
178     * Removes a specific repetition of SFT (Software Segment)
179     * @see AbstractGroup#removeRepetition(String, int) 
180     */
181    public SFT removeSFT(int rep) throws HL7Exception { 
182       return (SFT)super.removeRepetition("SFT", rep);
183    }
184
185
186
187    /**
188     * Returns
189     * EVN (Event Type) - creates it if necessary
190     */
191    public EVN getEVN() { 
192       return getTyped("EVN", EVN.class);
193    }
194
195
196
197
198    /**
199     * Returns
200     * STF (Staff Identification) - creates it if necessary
201     */
202    public STF getSTF() { 
203       return getTyped("STF", STF.class);
204    }
205
206
207
208
209    /**
210     * Returns
211     * the first repetition of 
212     * PRA (Practitioner Detail) - creates it if necessary
213     */
214    public PRA getPRA() { 
215       return getTyped("PRA", PRA.class);
216    }
217
218
219    /**
220     * Returns a specific repetition of
221     * PRA (Practitioner Detail) - creates it if necessary
222     *
223     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
224     * @throws HL7Exception if the repetition requested is more than one 
225     *     greater than the number of existing repetitions.
226     */
227    public PRA getPRA(int rep) { 
228       return getTyped("PRA", rep, PRA.class);
229    }
230
231    /** 
232     * Returns the number of existing repetitions of PRA 
233     */ 
234    public int getPRAReps() { 
235        return getReps("PRA");
236    } 
237
238    /** 
239     * <p>
240     * Returns a non-modifiable List containing all current existing repetitions of PRA.
241     * <p>
242     * <p>
243     * Note that unlike {@link #getPRA()}, this method will not create any reps
244     * if none are already present, so an empty list may be returned.
245     * </p>
246     */ 
247    public List<PRA> getPRAAll() throws HL7Exception {
248        return getAllAsList("PRA", PRA.class);
249    } 
250
251    /**
252     * Inserts a specific repetition of PRA (Practitioner Detail)
253     * @see AbstractGroup#insertRepetition(Structure, int) 
254     */
255    public void insertPRA(PRA structure, int rep) throws HL7Exception { 
256       super.insertRepetition( "PRA", structure, rep);
257    }
258
259
260    /**
261     * Inserts a specific repetition of PRA (Practitioner Detail)
262     * @see AbstractGroup#insertRepetition(Structure, int) 
263     */
264    public PRA insertPRA(int rep) throws HL7Exception { 
265       return (PRA)super.insertRepetition("PRA", rep);
266    }
267
268
269    /**
270     * Removes a specific repetition of PRA (Practitioner Detail)
271     * @see AbstractGroup#removeRepetition(String, int) 
272     */
273    public PRA removePRA(int rep) throws HL7Exception { 
274       return (PRA)super.removeRepetition("PRA", rep);
275    }
276
277
278
279    /**
280     * Returns
281     * the first repetition of 
282     * ORG (Practitioner Organization Unit) - creates it if necessary
283     */
284    public ORG getORG() { 
285       return getTyped("ORG", ORG.class);
286    }
287
288
289    /**
290     * Returns a specific repetition of
291     * ORG (Practitioner Organization Unit) - creates it if necessary
292     *
293     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
294     * @throws HL7Exception if the repetition requested is more than one 
295     *     greater than the number of existing repetitions.
296     */
297    public ORG getORG(int rep) { 
298       return getTyped("ORG", rep, ORG.class);
299    }
300
301    /** 
302     * Returns the number of existing repetitions of ORG 
303     */ 
304    public int getORGReps() { 
305        return getReps("ORG");
306    } 
307
308    /** 
309     * <p>
310     * Returns a non-modifiable List containing all current existing repetitions of ORG.
311     * <p>
312     * <p>
313     * Note that unlike {@link #getORG()}, this method will not create any reps
314     * if none are already present, so an empty list may be returned.
315     * </p>
316     */ 
317    public List<ORG> getORGAll() throws HL7Exception {
318        return getAllAsList("ORG", ORG.class);
319    } 
320
321    /**
322     * Inserts a specific repetition of ORG (Practitioner Organization Unit)
323     * @see AbstractGroup#insertRepetition(Structure, int) 
324     */
325    public void insertORG(ORG structure, int rep) throws HL7Exception { 
326       super.insertRepetition( "ORG", structure, rep);
327    }
328
329
330    /**
331     * Inserts a specific repetition of ORG (Practitioner Organization Unit)
332     * @see AbstractGroup#insertRepetition(Structure, int) 
333     */
334    public ORG insertORG(int rep) throws HL7Exception { 
335       return (ORG)super.insertRepetition("ORG", rep);
336    }
337
338
339    /**
340     * Removes a specific repetition of ORG (Practitioner Organization Unit)
341     * @see AbstractGroup#removeRepetition(String, int) 
342     */
343    public ORG removeORG(int rep) throws HL7Exception { 
344       return (ORG)super.removeRepetition("ORG", rep);
345    }
346
347
348
349    /**
350     * Returns
351     * the first repetition of 
352     * AFF (Professional Affiliation) - creates it if necessary
353     */
354    public AFF getAFF() { 
355       return getTyped("AFF", AFF.class);
356    }
357
358
359    /**
360     * Returns a specific repetition of
361     * AFF (Professional Affiliation) - creates it if necessary
362     *
363     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
364     * @throws HL7Exception if the repetition requested is more than one 
365     *     greater than the number of existing repetitions.
366     */
367    public AFF getAFF(int rep) { 
368       return getTyped("AFF", rep, AFF.class);
369    }
370
371    /** 
372     * Returns the number of existing repetitions of AFF 
373     */ 
374    public int getAFFReps() { 
375        return getReps("AFF");
376    } 
377
378    /** 
379     * <p>
380     * Returns a non-modifiable List containing all current existing repetitions of AFF.
381     * <p>
382     * <p>
383     * Note that unlike {@link #getAFF()}, this method will not create any reps
384     * if none are already present, so an empty list may be returned.
385     * </p>
386     */ 
387    public List<AFF> getAFFAll() throws HL7Exception {
388        return getAllAsList("AFF", AFF.class);
389    } 
390
391    /**
392     * Inserts a specific repetition of AFF (Professional Affiliation)
393     * @see AbstractGroup#insertRepetition(Structure, int) 
394     */
395    public void insertAFF(AFF structure, int rep) throws HL7Exception { 
396       super.insertRepetition( "AFF", structure, rep);
397    }
398
399
400    /**
401     * Inserts a specific repetition of AFF (Professional Affiliation)
402     * @see AbstractGroup#insertRepetition(Structure, int) 
403     */
404    public AFF insertAFF(int rep) throws HL7Exception { 
405       return (AFF)super.insertRepetition("AFF", rep);
406    }
407
408
409    /**
410     * Removes a specific repetition of AFF (Professional Affiliation)
411     * @see AbstractGroup#removeRepetition(String, int) 
412     */
413    public AFF removeAFF(int rep) throws HL7Exception { 
414       return (AFF)super.removeRepetition("AFF", rep);
415    }
416
417
418
419    /**
420     * Returns
421     * the first repetition of 
422     * LAN (Language Detail) - creates it if necessary
423     */
424    public LAN getLAN() { 
425       return getTyped("LAN", LAN.class);
426    }
427
428
429    /**
430     * Returns a specific repetition of
431     * LAN (Language Detail) - creates it if necessary
432     *
433     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
434     * @throws HL7Exception if the repetition requested is more than one 
435     *     greater than the number of existing repetitions.
436     */
437    public LAN getLAN(int rep) { 
438       return getTyped("LAN", rep, LAN.class);
439    }
440
441    /** 
442     * Returns the number of existing repetitions of LAN 
443     */ 
444    public int getLANReps() { 
445        return getReps("LAN");
446    } 
447
448    /** 
449     * <p>
450     * Returns a non-modifiable List containing all current existing repetitions of LAN.
451     * <p>
452     * <p>
453     * Note that unlike {@link #getLAN()}, this method will not create any reps
454     * if none are already present, so an empty list may be returned.
455     * </p>
456     */ 
457    public List<LAN> getLANAll() throws HL7Exception {
458        return getAllAsList("LAN", LAN.class);
459    } 
460
461    /**
462     * Inserts a specific repetition of LAN (Language Detail)
463     * @see AbstractGroup#insertRepetition(Structure, int) 
464     */
465    public void insertLAN(LAN structure, int rep) throws HL7Exception { 
466       super.insertRepetition( "LAN", structure, rep);
467    }
468
469
470    /**
471     * Inserts a specific repetition of LAN (Language Detail)
472     * @see AbstractGroup#insertRepetition(Structure, int) 
473     */
474    public LAN insertLAN(int rep) throws HL7Exception { 
475       return (LAN)super.insertRepetition("LAN", rep);
476    }
477
478
479    /**
480     * Removes a specific repetition of LAN (Language Detail)
481     * @see AbstractGroup#removeRepetition(String, int) 
482     */
483    public LAN removeLAN(int rep) throws HL7Exception { 
484       return (LAN)super.removeRepetition("LAN", rep);
485    }
486
487
488
489    /**
490     * Returns
491     * the first repetition of 
492     * EDU (Educational Detail) - creates it if necessary
493     */
494    public EDU getEDU() { 
495       return getTyped("EDU", EDU.class);
496    }
497
498
499    /**
500     * Returns a specific repetition of
501     * EDU (Educational Detail) - creates it if necessary
502     *
503     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
504     * @throws HL7Exception if the repetition requested is more than one 
505     *     greater than the number of existing repetitions.
506     */
507    public EDU getEDU(int rep) { 
508       return getTyped("EDU", rep, EDU.class);
509    }
510
511    /** 
512     * Returns the number of existing repetitions of EDU 
513     */ 
514    public int getEDUReps() { 
515        return getReps("EDU");
516    } 
517
518    /** 
519     * <p>
520     * Returns a non-modifiable List containing all current existing repetitions of EDU.
521     * <p>
522     * <p>
523     * Note that unlike {@link #getEDU()}, this method will not create any reps
524     * if none are already present, so an empty list may be returned.
525     * </p>
526     */ 
527    public List<EDU> getEDUAll() throws HL7Exception {
528        return getAllAsList("EDU", EDU.class);
529    } 
530
531    /**
532     * Inserts a specific repetition of EDU (Educational Detail)
533     * @see AbstractGroup#insertRepetition(Structure, int) 
534     */
535    public void insertEDU(EDU structure, int rep) throws HL7Exception { 
536       super.insertRepetition( "EDU", structure, rep);
537    }
538
539
540    /**
541     * Inserts a specific repetition of EDU (Educational Detail)
542     * @see AbstractGroup#insertRepetition(Structure, int) 
543     */
544    public EDU insertEDU(int rep) throws HL7Exception { 
545       return (EDU)super.insertRepetition("EDU", rep);
546    }
547
548
549    /**
550     * Removes a specific repetition of EDU (Educational Detail)
551     * @see AbstractGroup#removeRepetition(String, int) 
552     */
553    public EDU removeEDU(int rep) throws HL7Exception { 
554       return (EDU)super.removeRepetition("EDU", rep);
555    }
556
557
558
559    /**
560     * Returns
561     * the first repetition of 
562     * CER (Certificate Detail) - creates it if necessary
563     */
564    public CER getCER() { 
565       return getTyped("CER", CER.class);
566    }
567
568
569    /**
570     * Returns a specific repetition of
571     * CER (Certificate Detail) - creates it if necessary
572     *
573     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
574     * @throws HL7Exception if the repetition requested is more than one 
575     *     greater than the number of existing repetitions.
576     */
577    public CER getCER(int rep) { 
578       return getTyped("CER", rep, CER.class);
579    }
580
581    /** 
582     * Returns the number of existing repetitions of CER 
583     */ 
584    public int getCERReps() { 
585        return getReps("CER");
586    } 
587
588    /** 
589     * <p>
590     * Returns a non-modifiable List containing all current existing repetitions of CER.
591     * <p>
592     * <p>
593     * Note that unlike {@link #getCER()}, this method will not create any reps
594     * if none are already present, so an empty list may be returned.
595     * </p>
596     */ 
597    public List<CER> getCERAll() throws HL7Exception {
598        return getAllAsList("CER", CER.class);
599    } 
600
601    /**
602     * Inserts a specific repetition of CER (Certificate Detail)
603     * @see AbstractGroup#insertRepetition(Structure, int) 
604     */
605    public void insertCER(CER structure, int rep) throws HL7Exception { 
606       super.insertRepetition( "CER", structure, rep);
607    }
608
609
610    /**
611     * Inserts a specific repetition of CER (Certificate Detail)
612     * @see AbstractGroup#insertRepetition(Structure, int) 
613     */
614    public CER insertCER(int rep) throws HL7Exception { 
615       return (CER)super.insertRepetition("CER", rep);
616    }
617
618
619    /**
620     * Removes a specific repetition of CER (Certificate Detail)
621     * @see AbstractGroup#removeRepetition(String, int) 
622     */
623    public CER removeCER(int rep) throws HL7Exception { 
624       return (CER)super.removeRepetition("CER", rep);
625    }
626
627
628
629}
630