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