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