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.v251.segment;
35  
36  // import ca.uhn.hl7v2.model.v251.group.*;
37  import ca.uhn.hl7v2.model.v251.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 IPC message segment (Imaging Procedure Control Segment). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>IPC-1: Accession Identifier (EI) <b> </b>
53       * <li>IPC-2: Requested Procedure ID (EI) <b> </b>
54       * <li>IPC-3: Study Instance UID (EI) <b> </b>
55       * <li>IPC-4: Scheduled Procedure Step ID (EI) <b> </b>
56       * <li>IPC-5: Modality (CE) <b>optional </b>
57       * <li>IPC-6: Protocol Code (CE) <b>optional repeating</b>
58       * <li>IPC-7: Scheduled Station Name (EI) <b>optional </b>
59       * <li>IPC-8: Scheduled Procedure Step Location (CE) <b>optional repeating</b>
60       * <li>IPC-9: Scheduled AE Title (ST) <b>optional </b>
61   * </ul>
62   */
63  @SuppressWarnings("unused")
64  public class IPC extends AbstractSegment {
65  
66      /** 
67       * Creates a new IPC segment
68       */
69      public IPC(Group parent, ModelClassFactory factory) {
70         super(parent, factory);
71         init(factory);
72      }
73  
74      private void init(ModelClassFactory factory) {
75         try {
76                                    this.add(EI.class, true, 1, 80, new Object[]{ getMessage() }, "Accession Identifier");
77                                    this.add(EI.class, true, 1, 22, new Object[]{ getMessage() }, "Requested Procedure ID");
78                                    this.add(EI.class, true, 1, 70, new Object[]{ getMessage() }, "Study Instance UID");
79                                    this.add(EI.class, true, 1, 22, new Object[]{ getMessage() }, "Scheduled Procedure Step ID");
80                                    this.add(CE.class, false, 1, 16, new Object[]{ getMessage() }, "Modality");
81                                    this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Protocol Code");
82                                    this.add(EI.class, false, 1, 22, new Object[]{ getMessage() }, "Scheduled Station Name");
83                                    this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Scheduled Procedure Step Location");
84                                    this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "Scheduled AE Title");
85         } catch(HL7Exception e) {
86            log.error("Unexpected error creating IPC - this is probably a bug in the source code generator.", e);
87         }
88      }
89  
90  
91  
92      /**
93       * Returns
94       * IPC-1: "Accession Identifier" - creates it if necessary
95       */
96      public EI getAccessionIdentifier() { 
97  		EI retVal = this.getTypedField(1, 0);
98  		return retVal;
99      }
100     
101     /**
102      * Returns
103      * IPC-1: "Accession Identifier" - creates it if necessary
104      */
105     public EI getIpc1_AccessionIdentifier() { 
106 		EI retVal = this.getTypedField(1, 0);
107 		return retVal;
108     }
109 
110 
111 
112     /**
113      * Returns
114      * IPC-2: "Requested Procedure ID" - creates it if necessary
115      */
116     public EI getRequestedProcedureID() { 
117 		EI retVal = this.getTypedField(2, 0);
118 		return retVal;
119     }
120     
121     /**
122      * Returns
123      * IPC-2: "Requested Procedure ID" - creates it if necessary
124      */
125     public EI getIpc2_RequestedProcedureID() { 
126 		EI retVal = this.getTypedField(2, 0);
127 		return retVal;
128     }
129 
130 
131 
132     /**
133      * Returns
134      * IPC-3: "Study Instance UID" - creates it if necessary
135      */
136     public EI getStudyInstanceUID() { 
137 		EI retVal = this.getTypedField(3, 0);
138 		return retVal;
139     }
140     
141     /**
142      * Returns
143      * IPC-3: "Study Instance UID" - creates it if necessary
144      */
145     public EI getIpc3_StudyInstanceUID() { 
146 		EI retVal = this.getTypedField(3, 0);
147 		return retVal;
148     }
149 
150 
151 
152     /**
153      * Returns
154      * IPC-4: "Scheduled Procedure Step ID" - creates it if necessary
155      */
156     public EI getScheduledProcedureStepID() { 
157 		EI retVal = this.getTypedField(4, 0);
158 		return retVal;
159     }
160     
161     /**
162      * Returns
163      * IPC-4: "Scheduled Procedure Step ID" - creates it if necessary
164      */
165     public EI getIpc4_ScheduledProcedureStepID() { 
166 		EI retVal = this.getTypedField(4, 0);
167 		return retVal;
168     }
169 
170 
171 
172     /**
173      * Returns
174      * IPC-5: "Modality" - creates it if necessary
175      */
176     public CE getModality() { 
177 		CE retVal = this.getTypedField(5, 0);
178 		return retVal;
179     }
180     
181     /**
182      * Returns
183      * IPC-5: "Modality" - creates it if necessary
184      */
185     public CE getIpc5_Modality() { 
186 		CE retVal = this.getTypedField(5, 0);
187 		return retVal;
188     }
189 
190 
191     /**
192      * Returns all repetitions of Protocol Code (IPC-6).
193      */
194     public CE[] getProtocolCode() {
195     	CE[] retVal = this.getTypedField(6, new CE[0]);
196     	return retVal;
197     }
198 
199 
200     /**
201      * Returns all repetitions of Protocol Code (IPC-6).
202      */
203     public CE[] getIpc6_ProtocolCode() {
204     	CE[] retVal = this.getTypedField(6, new CE[0]);
205     	return retVal;
206     }
207 
208 
209     /**
210      * Returns a count of the current number of repetitions of Protocol Code (IPC-6).
211      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
212      * it will return zero.
213      */
214     public int getProtocolCodeReps() {
215     	return this.getReps(6);
216     }
217 
218 
219     /**
220      * Returns a specific repetition of
221      * IPC-6: "Protocol Code" - creates it if necessary
222      *
223      * @param rep The repetition index (0-indexed)
224      */
225     public CE getProtocolCode(int rep) { 
226 		CE retVal = this.getTypedField(6, rep);
227 		return retVal;
228     }
229 
230     /**
231      * Returns a specific repetition of
232      * IPC-6: "Protocol Code" - creates it if necessary
233      *
234      * @param rep The repetition index (0-indexed)
235      */
236     public CE getIpc6_ProtocolCode(int rep) { 
237 		CE retVal = this.getTypedField(6, rep);
238 		return retVal;
239     }
240 
241     /**
242      * Returns a count of the current number of repetitions of Protocol Code (IPC-6).
243      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
244      * it will return zero.
245      */
246     public int getIpc6_ProtocolCodeReps() {
247     	return this.getReps(6);
248     }
249 
250 
251     /**
252      * Inserts a repetition of
253      * IPC-6: "Protocol Code" at a specific index
254      *
255      * @param rep The repetition index (0-indexed)
256      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
257      */
258     public CE insertProtocolCode(int rep) throws HL7Exception { 
259         return (CE) super.insertRepetition(6, rep);
260     }
261 
262 
263     /**
264      * Inserts a repetition of
265      * IPC-6: "Protocol Code" at a specific index
266      *
267      * @param rep The repetition index (0-indexed)
268      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
269      */
270     public CE insertIpc6_ProtocolCode(int rep) throws HL7Exception { 
271         return (CE) super.insertRepetition(6, rep);
272     }
273 
274 
275     /**
276      * Removes a repetition of
277      * IPC-6: "Protocol Code" at a specific index
278      *
279      * @param rep The repetition index (0-indexed)
280      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
281      */
282     public CE removeProtocolCode(int rep) throws HL7Exception { 
283         return (CE) super.removeRepetition(6, rep);
284     }
285 
286 
287     /**
288      * Removes a repetition of
289      * IPC-6: "Protocol Code" at a specific index
290      *
291      * @param rep The repetition index (0-indexed)
292      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
293      */
294     public CE removeIpc6_ProtocolCode(int rep) throws HL7Exception { 
295         return (CE) super.removeRepetition(6, rep);
296     }
297 
298 
299 
300 
301     /**
302      * Returns
303      * IPC-7: "Scheduled Station Name" - creates it if necessary
304      */
305     public EI getScheduledStationName() { 
306 		EI retVal = this.getTypedField(7, 0);
307 		return retVal;
308     }
309     
310     /**
311      * Returns
312      * IPC-7: "Scheduled Station Name" - creates it if necessary
313      */
314     public EI getIpc7_ScheduledStationName() { 
315 		EI retVal = this.getTypedField(7, 0);
316 		return retVal;
317     }
318 
319 
320     /**
321      * Returns all repetitions of Scheduled Procedure Step Location (IPC-8).
322      */
323     public CE[] getScheduledProcedureStepLocation() {
324     	CE[] retVal = this.getTypedField(8, new CE[0]);
325     	return retVal;
326     }
327 
328 
329     /**
330      * Returns all repetitions of Scheduled Procedure Step Location (IPC-8).
331      */
332     public CE[] getIpc8_ScheduledProcedureStepLocation() {
333     	CE[] retVal = this.getTypedField(8, new CE[0]);
334     	return retVal;
335     }
336 
337 
338     /**
339      * Returns a count of the current number of repetitions of Scheduled Procedure Step Location (IPC-8).
340      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
341      * it will return zero.
342      */
343     public int getScheduledProcedureStepLocationReps() {
344     	return this.getReps(8);
345     }
346 
347 
348     /**
349      * Returns a specific repetition of
350      * IPC-8: "Scheduled Procedure Step Location" - creates it if necessary
351      *
352      * @param rep The repetition index (0-indexed)
353      */
354     public CE getScheduledProcedureStepLocation(int rep) { 
355 		CE retVal = this.getTypedField(8, rep);
356 		return retVal;
357     }
358 
359     /**
360      * Returns a specific repetition of
361      * IPC-8: "Scheduled Procedure Step Location" - creates it if necessary
362      *
363      * @param rep The repetition index (0-indexed)
364      */
365     public CE getIpc8_ScheduledProcedureStepLocation(int rep) { 
366 		CE retVal = this.getTypedField(8, rep);
367 		return retVal;
368     }
369 
370     /**
371      * Returns a count of the current number of repetitions of Scheduled Procedure Step Location (IPC-8).
372      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
373      * it will return zero.
374      */
375     public int getIpc8_ScheduledProcedureStepLocationReps() {
376     	return this.getReps(8);
377     }
378 
379 
380     /**
381      * Inserts a repetition of
382      * IPC-8: "Scheduled Procedure Step Location" 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 insertScheduledProcedureStepLocation(int rep) throws HL7Exception { 
388         return (CE) super.insertRepetition(8, rep);
389     }
390 
391 
392     /**
393      * Inserts a repetition of
394      * IPC-8: "Scheduled Procedure Step Location" 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 insertIpc8_ScheduledProcedureStepLocation(int rep) throws HL7Exception { 
400         return (CE) super.insertRepetition(8, rep);
401     }
402 
403 
404     /**
405      * Removes a repetition of
406      * IPC-8: "Scheduled Procedure Step Location" at a specific index
407      *
408      * @param rep The repetition index (0-indexed)
409      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
410      */
411     public CE removeScheduledProcedureStepLocation(int rep) throws HL7Exception { 
412         return (CE) super.removeRepetition(8, rep);
413     }
414 
415 
416     /**
417      * Removes a repetition of
418      * IPC-8: "Scheduled Procedure Step Location" at a specific index
419      *
420      * @param rep The repetition index (0-indexed)
421      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
422      */
423     public CE removeIpc8_ScheduledProcedureStepLocation(int rep) throws HL7Exception { 
424         return (CE) super.removeRepetition(8, rep);
425     }
426 
427 
428 
429 
430     /**
431      * Returns
432      * IPC-9: "Scheduled AE Title" - creates it if necessary
433      */
434     public ST getScheduledAETitle() { 
435 		ST retVal = this.getTypedField(9, 0);
436 		return retVal;
437     }
438     
439     /**
440      * Returns
441      * IPC-9: "Scheduled AE Title" - creates it if necessary
442      */
443     public ST getIpc9_ScheduledAETitle() { 
444 		ST retVal = this.getTypedField(9, 0);
445 		return retVal;
446     }
447 
448 
449 
450 
451 
452     /** {@inheritDoc} */   
453     protected Type createNewTypeWithoutReflection(int field) {
454        switch (field) {
455           case 0: return new EI(getMessage());
456           case 1: return new EI(getMessage());
457           case 2: return new EI(getMessage());
458           case 3: return new EI(getMessage());
459           case 4: return new CE(getMessage());
460           case 5: return new CE(getMessage());
461           case 6: return new EI(getMessage());
462           case 7: return new CE(getMessage());
463           case 8: return new ST(getMessage());
464           default: return null;
465        }
466    }
467 
468 
469 }
470