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.v25.segment;
035
036// import ca.uhn.hl7v2.model.v25.group.*;
037import ca.uhn.hl7v2.model.v25.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 IPC message segment (Imaging Procedure Control Segment). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>IPC-1: Accession Identifier (EI) <b> </b>
053     * <li>IPC-2: Requested Procedure ID (EI) <b> </b>
054     * <li>IPC-3: Study Instance UID (EI) <b> </b>
055     * <li>IPC-4: Scheduled Procedure Step ID (EI) <b> </b>
056     * <li>IPC-5: Modality (CE) <b>optional </b>
057     * <li>IPC-6: Protocol Code (CE) <b>optional repeating</b>
058     * <li>IPC-7: Scheduled Station Name (EI) <b>optional </b>
059     * <li>IPC-8: Scheduled Procedure Step Location (CE) <b>optional repeating</b>
060     * <li>IPC-9: Scheduled AE Title (ST) <b>optional </b>
061 * </ul>
062 */
063@SuppressWarnings("unused")
064public class IPC extends AbstractSegment {
065
066    /** 
067     * Creates a new IPC segment
068     */
069    public IPC(Group parent, ModelClassFactory factory) {
070       super(parent, factory);
071       init(factory);
072    }
073
074    private void init(ModelClassFactory factory) {
075       try {
076                                  this.add(EI.class, true, 1, 80, new Object[]{ getMessage() }, "Accession Identifier");
077                                  this.add(EI.class, true, 1, 22, new Object[]{ getMessage() }, "Requested Procedure ID");
078                                  this.add(EI.class, true, 1, 70, new Object[]{ getMessage() }, "Study Instance UID");
079                                  this.add(EI.class, true, 1, 22, new Object[]{ getMessage() }, "Scheduled Procedure Step ID");
080                                  this.add(CE.class, false, 1, 16, new Object[]{ getMessage() }, "Modality");
081                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Protocol Code");
082                                  this.add(EI.class, false, 1, 22, new Object[]{ getMessage() }, "Scheduled Station Name");
083                                  this.add(CE.class, false, 0, 250, new Object[]{ getMessage() }, "Scheduled Procedure Step Location");
084                                  this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "Scheduled AE Title");
085       } catch(HL7Exception e) {
086          log.error("Unexpected error creating IPC - this is probably a bug in the source code generator.", e);
087       }
088    }
089
090
091
092    /**
093     * Returns
094     * IPC-1: "Accession Identifier" - creates it if necessary
095     */
096    public EI getAccessionIdentifier() { 
097                EI retVal = this.getTypedField(1, 0);
098                return retVal;
099    }
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