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 AIS message segment (Appointment Information). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>AIS-1: Set ID - AIS (SI) <b> </b>
052     * <li>AIS-2: Segment Action Code (ID) <b>optional </b>
053     * <li>AIS-3: Universal Service Identifier (CE) <b> </b>
054     * <li>AIS-4: Start Date/Time (TS) <b>optional </b>
055     * <li>AIS-5: Start Date/Time Offset (NM) <b>optional </b>
056     * <li>AIS-6: Start Date/Time Offset Units (CE) <b>optional </b>
057     * <li>AIS-7: Duration (NM) <b>optional </b>
058     * <li>AIS-8: Duration Units (CE) <b>optional </b>
059     * <li>AIS-9: Allow Substitution Code (IS) <b>optional </b>
060     * <li>AIS-10: Filler Status Code (CE) <b>optional </b>
061     * <li>AIS-11: Placer Supplemental Service Information (CE) <b>optional repeating</b>
062     * <li>AIS-12: Filler Supplemental Service Information (CE) <b>optional repeating</b>
063 * </ul>
064 */
065@SuppressWarnings("unused")
066public class AIS extends AbstractSegment {
067
068    /** 
069     * Creates a new AIS segment
070     */
071    public AIS(Group parent, ModelClassFactory factory) {
072       super(parent, factory);
073       init(factory);
074    }
075
076    private void init(ModelClassFactory factory) {
077       try {
078                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - AIS");
079                                              this.add(ID.class, false, 1, 3, new Object[]{ getMessage(), new Integer(206) }, "Segment Action Code");
080                                  this.add(CE.class, true, 1, 250, new Object[]{ getMessage() }, "Universal Service Identifier");
081                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Start Date/Time");
082                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Start Date/Time Offset");
083                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Start Date/Time Offset Units");
084                                  this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Duration");
085                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Duration Units");
086                                              this.add(IS.class, false, 1, 10, new Object[]{ getMessage(), new Integer(279) }, "Allow Substitution Code");
087                                  this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Filler Status Code");
088                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Placer Supplemental Service Information");
089                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Filler Supplemental Service Information");
090       } catch(HL7Exception e) {
091          log.error("Unexpected error creating AIS - this is probably a bug in the source code generator.", e);
092       }
093    }
094
095
096
097    /**
098     * Returns
099     * AIS-1: "Set ID - AIS" - creates it if necessary
100     */
101    public SI getSetIDAIS() { 
102                SI retVal = this.getTypedField(1, 0);
103                return retVal;
104    }
105    
106    /**
107     * Returns
108     * AIS-1: "Set ID - AIS" - creates it if necessary
109     */
110    public SI getAis1_SetIDAIS() { 
111                SI retVal = this.getTypedField(1, 0);
112                return retVal;
113    }
114
115
116
117    /**
118     * Returns
119     * AIS-2: "Segment Action Code" - creates it if necessary
120     */
121    public ID getSegmentActionCode() { 
122                ID retVal = this.getTypedField(2, 0);
123                return retVal;
124    }
125    
126    /**
127     * Returns
128     * AIS-2: "Segment Action Code" - creates it if necessary
129     */
130    public ID getAis2_SegmentActionCode() { 
131                ID retVal = this.getTypedField(2, 0);
132                return retVal;
133    }
134
135
136
137    /**
138     * Returns
139     * AIS-3: "Universal Service Identifier" - creates it if necessary
140     */
141    public CE getUniversalServiceIdentifier() { 
142                CE retVal = this.getTypedField(3, 0);
143                return retVal;
144    }
145    
146    /**
147     * Returns
148     * AIS-3: "Universal Service Identifier" - creates it if necessary
149     */
150    public CE getAis3_UniversalServiceIdentifier() { 
151                CE retVal = this.getTypedField(3, 0);
152                return retVal;
153    }
154
155
156
157    /**
158     * Returns
159     * AIS-4: "Start Date/Time" - creates it if necessary
160     */
161    public TS getStartDateTime() { 
162                TS retVal = this.getTypedField(4, 0);
163                return retVal;
164    }
165    
166    /**
167     * Returns
168     * AIS-4: "Start Date/Time" - creates it if necessary
169     */
170    public TS getAis4_StartDateTime() { 
171                TS retVal = this.getTypedField(4, 0);
172                return retVal;
173    }
174
175
176
177    /**
178     * Returns
179     * AIS-5: "Start Date/Time Offset" - creates it if necessary
180     */
181    public NM getStartDateTimeOffset() { 
182                NM retVal = this.getTypedField(5, 0);
183                return retVal;
184    }
185    
186    /**
187     * Returns
188     * AIS-5: "Start Date/Time Offset" - creates it if necessary
189     */
190    public NM getAis5_StartDateTimeOffset() { 
191                NM retVal = this.getTypedField(5, 0);
192                return retVal;
193    }
194
195
196
197    /**
198     * Returns
199     * AIS-6: "Start Date/Time Offset Units" - creates it if necessary
200     */
201    public CE getStartDateTimeOffsetUnits() { 
202                CE retVal = this.getTypedField(6, 0);
203                return retVal;
204    }
205    
206    /**
207     * Returns
208     * AIS-6: "Start Date/Time Offset Units" - creates it if necessary
209     */
210    public CE getAis6_StartDateTimeOffsetUnits() { 
211                CE retVal = this.getTypedField(6, 0);
212                return retVal;
213    }
214
215
216
217    /**
218     * Returns
219     * AIS-7: "Duration" - creates it if necessary
220     */
221    public NM getDuration() { 
222                NM retVal = this.getTypedField(7, 0);
223                return retVal;
224    }
225    
226    /**
227     * Returns
228     * AIS-7: "Duration" - creates it if necessary
229     */
230    public NM getAis7_Duration() { 
231                NM retVal = this.getTypedField(7, 0);
232                return retVal;
233    }
234
235
236
237    /**
238     * Returns
239     * AIS-8: "Duration Units" - creates it if necessary
240     */
241    public CE getDurationUnits() { 
242                CE retVal = this.getTypedField(8, 0);
243                return retVal;
244    }
245    
246    /**
247     * Returns
248     * AIS-8: "Duration Units" - creates it if necessary
249     */
250    public CE getAis8_DurationUnits() { 
251                CE retVal = this.getTypedField(8, 0);
252                return retVal;
253    }
254
255
256
257    /**
258     * Returns
259     * AIS-9: "Allow Substitution Code" - creates it if necessary
260     */
261    public IS getAllowSubstitutionCode() { 
262                IS retVal = this.getTypedField(9, 0);
263                return retVal;
264    }
265    
266    /**
267     * Returns
268     * AIS-9: "Allow Substitution Code" - creates it if necessary
269     */
270    public IS getAis9_AllowSubstitutionCode() { 
271                IS retVal = this.getTypedField(9, 0);
272                return retVal;
273    }
274
275
276
277    /**
278     * Returns
279     * AIS-10: "Filler Status Code" - creates it if necessary
280     */
281    public CE getFillerStatusCode() { 
282                CE retVal = this.getTypedField(10, 0);
283                return retVal;
284    }
285    
286    /**
287     * Returns
288     * AIS-10: "Filler Status Code" - creates it if necessary
289     */
290    public CE getAis10_FillerStatusCode() { 
291                CE retVal = this.getTypedField(10, 0);
292                return retVal;
293    }
294
295
296    /**
297     * Returns all repetitions of Placer Supplemental Service Information (AIS-11).
298     */
299    public CE[] getPlacerSupplementalServiceInformation() {
300        CE[] retVal = this.getTypedField(11, new CE[0]);
301        return retVal;
302    }
303
304
305    /**
306     * Returns all repetitions of Placer Supplemental Service Information (AIS-11).
307     */
308    public CE[] getAis11_PlacerSupplementalServiceInformation() {
309        CE[] retVal = this.getTypedField(11, new CE[0]);
310        return retVal;
311    }
312
313
314    /**
315     * Returns a count of the current number of repetitions of Placer Supplemental Service Information (AIS-11).
316     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
317     * it will return zero.
318     */
319    public int getPlacerSupplementalServiceInformationReps() {
320        return this.getReps(11);
321    }
322
323
324    /**
325     * Returns a specific repetition of
326     * AIS-11: "Placer Supplemental Service Information" - creates it if necessary
327     *
328     * @param rep The repetition index (0-indexed)
329     */
330    public CE getPlacerSupplementalServiceInformation(int rep) { 
331                CE retVal = this.getTypedField(11, rep);
332                return retVal;
333    }
334
335    /**
336     * Returns a specific repetition of
337     * AIS-11: "Placer Supplemental Service Information" - creates it if necessary
338     *
339     * @param rep The repetition index (0-indexed)
340     */
341    public CE getAis11_PlacerSupplementalServiceInformation(int rep) { 
342                CE retVal = this.getTypedField(11, rep);
343                return retVal;
344    }
345
346    /**
347     * Returns a count of the current number of repetitions of Placer Supplemental Service Information (AIS-11).
348     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
349     * it will return zero.
350     */
351    public int getAis11_PlacerSupplementalServiceInformationReps() {
352        return this.getReps(11);
353    }
354
355
356    /**
357     * Inserts a repetition of
358     * AIS-11: "Placer Supplemental Service Information" at a specific index
359     *
360     * @param rep The repetition index (0-indexed)
361     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
362     */
363    public CE insertPlacerSupplementalServiceInformation(int rep) throws HL7Exception { 
364        return (CE) super.insertRepetition(11, rep);
365    }
366
367
368    /**
369     * Inserts a repetition of
370     * AIS-11: "Placer Supplemental Service Information" at a specific index
371     *
372     * @param rep The repetition index (0-indexed)
373     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
374     */
375    public CE insertAis11_PlacerSupplementalServiceInformation(int rep) throws HL7Exception { 
376        return (CE) super.insertRepetition(11, rep);
377    }
378
379
380    /**
381     * Removes a repetition of
382     * AIS-11: "Placer Supplemental Service Information" at a specific index
383     *
384     * @param rep The repetition index (0-indexed)
385     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
386     */
387    public CE removePlacerSupplementalServiceInformation(int rep) throws HL7Exception { 
388        return (CE) super.removeRepetition(11, rep);
389    }
390
391
392    /**
393     * Removes a repetition of
394     * AIS-11: "Placer Supplemental Service Information" at a specific index
395     *
396     * @param rep The repetition index (0-indexed)
397     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
398     */
399    public CE removeAis11_PlacerSupplementalServiceInformation(int rep) throws HL7Exception { 
400        return (CE) super.removeRepetition(11, rep);
401    }
402
403
404
405    /**
406     * Returns all repetitions of Filler Supplemental Service Information (AIS-12).
407     */
408    public CE[] getFillerSupplementalServiceInformation() {
409        CE[] retVal = this.getTypedField(12, new CE[0]);
410        return retVal;
411    }
412
413
414    /**
415     * Returns all repetitions of Filler Supplemental Service Information (AIS-12).
416     */
417    public CE[] getAis12_FillerSupplementalServiceInformation() {
418        CE[] retVal = this.getTypedField(12, new CE[0]);
419        return retVal;
420    }
421
422
423    /**
424     * Returns a count of the current number of repetitions of Filler Supplemental Service Information (AIS-12).
425     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
426     * it will return zero.
427     */
428    public int getFillerSupplementalServiceInformationReps() {
429        return this.getReps(12);
430    }
431
432
433    /**
434     * Returns a specific repetition of
435     * AIS-12: "Filler Supplemental Service Information" - creates it if necessary
436     *
437     * @param rep The repetition index (0-indexed)
438     */
439    public CE getFillerSupplementalServiceInformation(int rep) { 
440                CE retVal = this.getTypedField(12, rep);
441                return retVal;
442    }
443
444    /**
445     * Returns a specific repetition of
446     * AIS-12: "Filler Supplemental Service Information" - creates it if necessary
447     *
448     * @param rep The repetition index (0-indexed)
449     */
450    public CE getAis12_FillerSupplementalServiceInformation(int rep) { 
451                CE retVal = this.getTypedField(12, rep);
452                return retVal;
453    }
454
455    /**
456     * Returns a count of the current number of repetitions of Filler Supplemental Service Information (AIS-12).
457     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
458     * it will return zero.
459     */
460    public int getAis12_FillerSupplementalServiceInformationReps() {
461        return this.getReps(12);
462    }
463
464
465    /**
466     * Inserts a repetition of
467     * AIS-12: "Filler Supplemental Service Information" at a specific index
468     *
469     * @param rep The repetition index (0-indexed)
470     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
471     */
472    public CE insertFillerSupplementalServiceInformation(int rep) throws HL7Exception { 
473        return (CE) super.insertRepetition(12, rep);
474    }
475
476
477    /**
478     * Inserts a repetition of
479     * AIS-12: "Filler Supplemental Service Information" at a specific index
480     *
481     * @param rep The repetition index (0-indexed)
482     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
483     */
484    public CE insertAis12_FillerSupplementalServiceInformation(int rep) throws HL7Exception { 
485        return (CE) super.insertRepetition(12, rep);
486    }
487
488
489    /**
490     * Removes a repetition of
491     * AIS-12: "Filler Supplemental Service Information" at a specific index
492     *
493     * @param rep The repetition index (0-indexed)
494     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
495     */
496    public CE removeFillerSupplementalServiceInformation(int rep) throws HL7Exception { 
497        return (CE) super.removeRepetition(12, rep);
498    }
499
500
501    /**
502     * Removes a repetition of
503     * AIS-12: "Filler Supplemental Service Information" at a specific index
504     *
505     * @param rep The repetition index (0-indexed)
506     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
507     */
508    public CE removeAis12_FillerSupplementalServiceInformation(int rep) throws HL7Exception { 
509        return (CE) super.removeRepetition(12, rep);
510    }
511
512
513
514
515
516
517    /** {@inheritDoc} */   
518    protected Type createNewTypeWithoutReflection(int field) {
519       switch (field) {
520          case 0: return new SI(getMessage());
521          case 1: return new ID(getMessage(), new Integer( 206 ));
522          case 2: return new CE(getMessage());
523          case 3: return new TS(getMessage());
524          case 4: return new NM(getMessage());
525          case 5: return new CE(getMessage());
526          case 6: return new NM(getMessage());
527          case 7: return new CE(getMessage());
528          case 8: return new IS(getMessage(), new Integer( 279 ));
529          case 9: return new CE(getMessage());
530          case 10: return new CE(getMessage());
531          case 11: return new CE(getMessage());
532          default: return null;
533       }
534   }
535
536
537}
538