View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v28.segment;
35  
36  // import ca.uhn.hl7v2.model.v28.group.*;
37  import ca.uhn.hl7v2.model.v28.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 AIP message segment (Appointment Information - Personnel Resource). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>AIP-1: Set ID - AIP (SI) <b> </b>
53       * <li>AIP-2: Segment Action Code (ID) <b>optional </b>
54       * <li>AIP-3: Personnel Resource ID (XCN) <b>optional repeating</b>
55       * <li>AIP-4: Resource Type (CWE) <b>optional </b>
56       * <li>AIP-5: Resource Group (CWE) <b>optional </b>
57       * <li>AIP-6: Start Date/Time (DTM) <b>optional </b>
58       * <li>AIP-7: Start Date/Time Offset (NM) <b>optional </b>
59       * <li>AIP-8: Start Date/Time Offset Units (CNE) <b>optional </b>
60       * <li>AIP-9: Duration (NM) <b>optional </b>
61       * <li>AIP-10: Duration Units (CNE) <b>optional </b>
62       * <li>AIP-11: Allow Substitution Code (CWE) <b>optional </b>
63       * <li>AIP-12: Filler Status Code (CWE) <b>optional </b>
64   * </ul>
65   */
66  @SuppressWarnings("unused")
67  public class AIP extends AbstractSegment {
68  
69      /** 
70       * Creates a new AIP segment
71       */
72      public AIP(Group parent, ModelClassFactory factory) {
73         super(parent, factory);
74         init(factory);
75      }
76  
77      private void init(ModelClassFactory factory) {
78         try {
79                                    this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - AIP");
80                                                this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(206) }, "Segment Action Code");
81                                    this.add(XCN.class, false, 0, 0, new Object[]{ getMessage() }, "Personnel Resource ID");
82                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Resource Type");
83                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Resource Group");
84                                    this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "Start Date/Time");
85                                    this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Start Date/Time Offset");
86                                    this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "Start Date/Time Offset Units");
87                                    this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Duration");
88                                    this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "Duration Units");
89                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Allow Substitution Code");
90                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Filler Status Code");
91         } catch(HL7Exception e) {
92            log.error("Unexpected error creating AIP - this is probably a bug in the source code generator.", e);
93         }
94      }
95  
96  
97  
98      /**
99       * Returns
100      * AIP-1: "Set ID - AIP" - creates it if necessary
101      */
102     public SI getSetIDAIP() { 
103 		SI retVal = this.getTypedField(1, 0);
104 		return retVal;
105     }
106     
107     /**
108      * Returns
109      * AIP-1: "Set ID - AIP" - creates it if necessary
110      */
111     public SI getAip1_SetIDAIP() { 
112 		SI retVal = this.getTypedField(1, 0);
113 		return retVal;
114     }
115 
116 
117 
118     /**
119      * Returns
120      * AIP-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      * AIP-2: "Segment Action Code" - creates it if necessary
130      */
131     public ID getAip2_SegmentActionCode() { 
132 		ID retVal = this.getTypedField(2, 0);
133 		return retVal;
134     }
135 
136 
137     /**
138      * Returns all repetitions of Personnel Resource ID (AIP-3).
139      */
140     public XCN[] getPersonnelResourceID() {
141     	XCN[] retVal = this.getTypedField(3, new XCN[0]);
142     	return retVal;
143     }
144 
145 
146     /**
147      * Returns all repetitions of Personnel Resource ID (AIP-3).
148      */
149     public XCN[] getAip3_PersonnelResourceID() {
150     	XCN[] retVal = this.getTypedField(3, new XCN[0]);
151     	return retVal;
152     }
153 
154 
155     /**
156      * Returns a count of the current number of repetitions of Personnel Resource ID (AIP-3).
157      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
158      * it will return zero.
159      */
160     public int getPersonnelResourceIDReps() {
161     	return this.getReps(3);
162     }
163 
164 
165     /**
166      * Returns a specific repetition of
167      * AIP-3: "Personnel Resource ID" - creates it if necessary
168      *
169      * @param rep The repetition index (0-indexed)
170      */
171     public XCN getPersonnelResourceID(int rep) { 
172 		XCN retVal = this.getTypedField(3, rep);
173 		return retVal;
174     }
175 
176     /**
177      * Returns a specific repetition of
178      * AIP-3: "Personnel Resource ID" - creates it if necessary
179      *
180      * @param rep The repetition index (0-indexed)
181      */
182     public XCN getAip3_PersonnelResourceID(int rep) { 
183 		XCN retVal = this.getTypedField(3, rep);
184 		return retVal;
185     }
186 
187     /**
188      * Returns a count of the current number of repetitions of Personnel Resource ID (AIP-3).
189      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
190      * it will return zero.
191      */
192     public int getAip3_PersonnelResourceIDReps() {
193     	return this.getReps(3);
194     }
195 
196 
197     /**
198      * Inserts a repetition of
199      * AIP-3: "Personnel Resource ID" at a specific index
200      *
201      * @param rep The repetition index (0-indexed)
202      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
203      */
204     public XCN insertPersonnelResourceID(int rep) throws HL7Exception { 
205         return (XCN) super.insertRepetition(3, rep);
206     }
207 
208 
209     /**
210      * Inserts a repetition of
211      * AIP-3: "Personnel Resource ID" at a specific index
212      *
213      * @param rep The repetition index (0-indexed)
214      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
215      */
216     public XCN insertAip3_PersonnelResourceID(int rep) throws HL7Exception { 
217         return (XCN) super.insertRepetition(3, rep);
218     }
219 
220 
221     /**
222      * Removes a repetition of
223      * AIP-3: "Personnel Resource ID" at a specific index
224      *
225      * @param rep The repetition index (0-indexed)
226      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
227      */
228     public XCN removePersonnelResourceID(int rep) throws HL7Exception { 
229         return (XCN) super.removeRepetition(3, rep);
230     }
231 
232 
233     /**
234      * Removes a repetition of
235      * AIP-3: "Personnel Resource ID" at a specific index
236      *
237      * @param rep The repetition index (0-indexed)
238      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
239      */
240     public XCN removeAip3_PersonnelResourceID(int rep) throws HL7Exception { 
241         return (XCN) super.removeRepetition(3, rep);
242     }
243 
244 
245 
246 
247     /**
248      * Returns
249      * AIP-4: "Resource Type" - creates it if necessary
250      */
251     public CWE getResourceType() { 
252 		CWE retVal = this.getTypedField(4, 0);
253 		return retVal;
254     }
255     
256     /**
257      * Returns
258      * AIP-4: "Resource Type" - creates it if necessary
259      */
260     public CWE getAip4_ResourceType() { 
261 		CWE retVal = this.getTypedField(4, 0);
262 		return retVal;
263     }
264 
265 
266 
267     /**
268      * Returns
269      * AIP-5: "Resource Group" - creates it if necessary
270      */
271     public CWE getResourceGroup() { 
272 		CWE retVal = this.getTypedField(5, 0);
273 		return retVal;
274     }
275     
276     /**
277      * Returns
278      * AIP-5: "Resource Group" - creates it if necessary
279      */
280     public CWE getAip5_ResourceGroup() { 
281 		CWE retVal = this.getTypedField(5, 0);
282 		return retVal;
283     }
284 
285 
286 
287     /**
288      * Returns
289      * AIP-6: "Start Date/Time" - creates it if necessary
290      */
291     public DTM getStartDateTime() { 
292 		DTM retVal = this.getTypedField(6, 0);
293 		return retVal;
294     }
295     
296     /**
297      * Returns
298      * AIP-6: "Start Date/Time" - creates it if necessary
299      */
300     public DTM getAip6_StartDateTime() { 
301 		DTM retVal = this.getTypedField(6, 0);
302 		return retVal;
303     }
304 
305 
306 
307     /**
308      * Returns
309      * AIP-7: "Start Date/Time Offset" - creates it if necessary
310      */
311     public NM getStartDateTimeOffset() { 
312 		NM retVal = this.getTypedField(7, 0);
313 		return retVal;
314     }
315     
316     /**
317      * Returns
318      * AIP-7: "Start Date/Time Offset" - creates it if necessary
319      */
320     public NM getAip7_StartDateTimeOffset() { 
321 		NM retVal = this.getTypedField(7, 0);
322 		return retVal;
323     }
324 
325 
326 
327     /**
328      * Returns
329      * AIP-8: "Start Date/Time Offset Units" - creates it if necessary
330      */
331     public CNE getStartDateTimeOffsetUnits() { 
332 		CNE retVal = this.getTypedField(8, 0);
333 		return retVal;
334     }
335     
336     /**
337      * Returns
338      * AIP-8: "Start Date/Time Offset Units" - creates it if necessary
339      */
340     public CNE getAip8_StartDateTimeOffsetUnits() { 
341 		CNE retVal = this.getTypedField(8, 0);
342 		return retVal;
343     }
344 
345 
346 
347     /**
348      * Returns
349      * AIP-9: "Duration" - creates it if necessary
350      */
351     public NM getDuration() { 
352 		NM retVal = this.getTypedField(9, 0);
353 		return retVal;
354     }
355     
356     /**
357      * Returns
358      * AIP-9: "Duration" - creates it if necessary
359      */
360     public NM getAip9_Duration() { 
361 		NM retVal = this.getTypedField(9, 0);
362 		return retVal;
363     }
364 
365 
366 
367     /**
368      * Returns
369      * AIP-10: "Duration Units" - creates it if necessary
370      */
371     public CNE getDurationUnits() { 
372 		CNE retVal = this.getTypedField(10, 0);
373 		return retVal;
374     }
375     
376     /**
377      * Returns
378      * AIP-10: "Duration Units" - creates it if necessary
379      */
380     public CNE getAip10_DurationUnits() { 
381 		CNE retVal = this.getTypedField(10, 0);
382 		return retVal;
383     }
384 
385 
386 
387     /**
388      * Returns
389      * AIP-11: "Allow Substitution Code" - creates it if necessary
390      */
391     public CWE getAllowSubstitutionCode() { 
392 		CWE retVal = this.getTypedField(11, 0);
393 		return retVal;
394     }
395     
396     /**
397      * Returns
398      * AIP-11: "Allow Substitution Code" - creates it if necessary
399      */
400     public CWE getAip11_AllowSubstitutionCode() { 
401 		CWE retVal = this.getTypedField(11, 0);
402 		return retVal;
403     }
404 
405 
406 
407     /**
408      * Returns
409      * AIP-12: "Filler Status Code" - creates it if necessary
410      */
411     public CWE getFillerStatusCode() { 
412 		CWE retVal = this.getTypedField(12, 0);
413 		return retVal;
414     }
415     
416     /**
417      * Returns
418      * AIP-12: "Filler Status Code" - creates it if necessary
419      */
420     public CWE getAip12_FillerStatusCode() { 
421 		CWE retVal = this.getTypedField(12, 0);
422 		return retVal;
423     }
424 
425 
426 
427 
428 
429     /** {@inheritDoc} */   
430     protected Type createNewTypeWithoutReflection(int field) {
431        switch (field) {
432           case 0: return new SI(getMessage());
433           case 1: return new ID(getMessage(), new Integer( 206 ));
434           case 2: return new XCN(getMessage());
435           case 3: return new CWE(getMessage());
436           case 4: return new CWE(getMessage());
437           case 5: return new DTM(getMessage());
438           case 6: return new NM(getMessage());
439           case 7: return new CNE(getMessage());
440           case 8: return new NM(getMessage());
441           case 9: return new CNE(getMessage());
442           case 10: return new CWE(getMessage());
443           case 11: return new CWE(getMessage());
444           default: return null;
445        }
446    }
447 
448 
449 }
450