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.v22.segment;
035
036// import ca.uhn.hl7v2.model.v22.group.*;
037import ca.uhn.hl7v2.model.v22.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 ORC message segment (COMMOM ORDER). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>ORC-1: Order Control (ID) <b> </b>
053     * <li>ORC-2: Placer Order Number (CM_PLACER) <b>optional </b>
054     * <li>ORC-3: Filler Order Number (CM_FILLER) <b>optional </b>
055     * <li>ORC-4: Placer Group Number (CM_GROUP_ID) <b>optional </b>
056     * <li>ORC-5: Order Status (ID) <b>optional </b>
057     * <li>ORC-6: Response Flag (ID) <b>optional </b>
058     * <li>ORC-7: Quantity / timing (TQ) <b>optional repeating</b>
059     * <li>ORC-8: Parent Order (CM_EIP) <b>optional </b>
060     * <li>ORC-9: Date / time of transaction (TS) <b>optional </b>
061     * <li>ORC-10: Entered By (CN) <b>optional </b>
062     * <li>ORC-11: Verified By (CN) <b>optional </b>
063     * <li>ORC-12: Ordering Provider (CN) <b>optional </b>
064     * <li>ORC-13: Enterer's Location (CM_PARENT_RESULT) <b>optional </b>
065     * <li>ORC-14: Call Back Phone Number (TN) <b>optional repeating</b>
066     * <li>ORC-15: Order effective date / time (TS) <b>optional </b>
067     * <li>ORC-16: Order Control Code Reason (CE) <b>optional </b>
068     * <li>ORC-17: Entering Organization (CE) <b>optional </b>
069     * <li>ORC-18: Entering Device (CE) <b>optional </b>
070     * <li>ORC-19: Action by (CN) <b>optional </b>
071 * </ul>
072 */
073@SuppressWarnings("unused")
074public class ORC extends AbstractSegment {
075
076    /** 
077     * Creates a new ORC segment
078     */
079    public ORC(Group parent, ModelClassFactory factory) {
080       super(parent, factory);
081       init(factory);
082    }
083
084    private void init(ModelClassFactory factory) {
085       try {
086                                              this.add(ID.class, true, 1, 2, new Object[]{ getMessage(), new Integer(119) }, "Order Control");
087                                  this.add(CM_PLACER.class, false, 1, 75, new Object[]{ getMessage() }, "Placer Order Number");
088                                  this.add(CM_FILLER.class, false, 1, 75, new Object[]{ getMessage() }, "Filler Order Number");
089                                  this.add(CM_GROUP_ID.class, false, 1, 75, new Object[]{ getMessage() }, "Placer Group Number");
090                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(38) }, "Order Status");
091                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(121) }, "Response Flag");
092                                  this.add(TQ.class, false, 0, 200, new Object[]{ getMessage() }, "Quantity / timing");
093                                  this.add(CM_EIP.class, false, 1, 200, new Object[]{ getMessage() }, "Parent Order");
094                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date / time of transaction");
095                                  this.add(CN.class, false, 1, 80, new Object[]{ getMessage() }, "Entered By");
096                                  this.add(CN.class, false, 1, 80, new Object[]{ getMessage() }, "Verified By");
097                                  this.add(CN.class, false, 1, 80, new Object[]{ getMessage() }, "Ordering Provider");
098                                  this.add(CM_PARENT_RESULT.class, false, 1, 80, new Object[]{ getMessage() }, "Enterer's Location");
099                                  this.add(TN.class, false, 2, 40, new Object[]{ getMessage() }, "Call Back Phone Number");
100                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Order effective date / time");
101                                  this.add(CE.class, false, 1, 200, new Object[]{ getMessage() }, "Order Control Code Reason");
102                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Entering Organization");
103                                  this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Entering Device");
104                                  this.add(CN.class, false, 1, 80, new Object[]{ getMessage() }, "Action by");
105       } catch(HL7Exception e) {
106          log.error("Unexpected error creating ORC - this is probably a bug in the source code generator.", e);
107       }
108    }
109
110
111
112    /**
113     * Returns
114     * ORC-1: "Order Control" - creates it if necessary
115     */
116    public ID getOrderControl() { 
117                ID retVal = this.getTypedField(1, 0);
118                return retVal;
119    }
120    
121    /**
122     * Returns
123     * ORC-1: "Order Control" - creates it if necessary
124     */
125    public ID getOrc1_OrderControl() { 
126                ID retVal = this.getTypedField(1, 0);
127                return retVal;
128    }
129
130
131
132    /**
133     * Returns
134     * ORC-2: "Placer Order Number" - creates it if necessary
135     */
136    public CM_PLACER getPlacerOrderNumber() { 
137                CM_PLACER retVal = this.getTypedField(2, 0);
138                return retVal;
139    }
140    
141    /**
142     * Returns
143     * ORC-2: "Placer Order Number" - creates it if necessary
144     */
145    public CM_PLACER getOrc2_PlacerOrderNumber() { 
146                CM_PLACER retVal = this.getTypedField(2, 0);
147                return retVal;
148    }
149
150
151
152    /**
153     * Returns
154     * ORC-3: "Filler Order Number" - creates it if necessary
155     */
156    public CM_FILLER getFillerOrderNumber() { 
157                CM_FILLER retVal = this.getTypedField(3, 0);
158                return retVal;
159    }
160    
161    /**
162     * Returns
163     * ORC-3: "Filler Order Number" - creates it if necessary
164     */
165    public CM_FILLER getOrc3_FillerOrderNumber() { 
166                CM_FILLER retVal = this.getTypedField(3, 0);
167                return retVal;
168    }
169
170
171
172    /**
173     * Returns
174     * ORC-4: "Placer Group Number" - creates it if necessary
175     */
176    public CM_GROUP_ID getPlacerGroupNumber() { 
177                CM_GROUP_ID retVal = this.getTypedField(4, 0);
178                return retVal;
179    }
180    
181    /**
182     * Returns
183     * ORC-4: "Placer Group Number" - creates it if necessary
184     */
185    public CM_GROUP_ID getOrc4_PlacerGroupNumber() { 
186                CM_GROUP_ID retVal = this.getTypedField(4, 0);
187                return retVal;
188    }
189
190
191
192    /**
193     * Returns
194     * ORC-5: "Order Status" - creates it if necessary
195     */
196    public ID getOrderStatus() { 
197                ID retVal = this.getTypedField(5, 0);
198                return retVal;
199    }
200    
201    /**
202     * Returns
203     * ORC-5: "Order Status" - creates it if necessary
204     */
205    public ID getOrc5_OrderStatus() { 
206                ID retVal = this.getTypedField(5, 0);
207                return retVal;
208    }
209
210
211
212    /**
213     * Returns
214     * ORC-6: "Response Flag" - creates it if necessary
215     */
216    public ID getResponseFlag() { 
217                ID retVal = this.getTypedField(6, 0);
218                return retVal;
219    }
220    
221    /**
222     * Returns
223     * ORC-6: "Response Flag" - creates it if necessary
224     */
225    public ID getOrc6_ResponseFlag() { 
226                ID retVal = this.getTypedField(6, 0);
227                return retVal;
228    }
229
230
231    /**
232     * Returns all repetitions of Quantity / timing (ORC-7).
233     */
234    public TQ[] getQuantityTiming() {
235        TQ[] retVal = this.getTypedField(7, new TQ[0]);
236        return retVal;
237    }
238
239
240    /**
241     * Returns all repetitions of Quantity / timing (ORC-7).
242     */
243    public TQ[] getOrc7_QuantityTiming() {
244        TQ[] retVal = this.getTypedField(7, new TQ[0]);
245        return retVal;
246    }
247
248
249    /**
250     * Returns a count of the current number of repetitions of Quantity / timing (ORC-7).
251     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
252     * it will return zero.
253     */
254    public int getQuantityTimingReps() {
255        return this.getReps(7);
256    }
257
258
259    /**
260     * Returns a specific repetition of
261     * ORC-7: "Quantity / timing" - creates it if necessary
262     *
263     * @param rep The repetition index (0-indexed)
264     */
265    public TQ getQuantityTiming(int rep) { 
266                TQ retVal = this.getTypedField(7, rep);
267                return retVal;
268    }
269
270    /**
271     * Returns a specific repetition of
272     * ORC-7: "Quantity / timing" - creates it if necessary
273     *
274     * @param rep The repetition index (0-indexed)
275     */
276    public TQ getOrc7_QuantityTiming(int rep) { 
277                TQ retVal = this.getTypedField(7, rep);
278                return retVal;
279    }
280
281    /**
282     * Returns a count of the current number of repetitions of Quantity / timing (ORC-7).
283     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
284     * it will return zero.
285     */
286    public int getOrc7_QuantityTimingReps() {
287        return this.getReps(7);
288    }
289
290
291    /**
292     * Inserts a repetition of
293     * ORC-7: "Quantity / timing" at a specific index
294     *
295     * @param rep The repetition index (0-indexed)
296     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
297     */
298    public TQ insertQuantityTiming(int rep) throws HL7Exception { 
299        return (TQ) super.insertRepetition(7, rep);
300    }
301
302
303    /**
304     * Inserts a repetition of
305     * ORC-7: "Quantity / timing" at a specific index
306     *
307     * @param rep The repetition index (0-indexed)
308     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
309     */
310    public TQ insertOrc7_QuantityTiming(int rep) throws HL7Exception { 
311        return (TQ) super.insertRepetition(7, rep);
312    }
313
314
315    /**
316     * Removes a repetition of
317     * ORC-7: "Quantity / timing" at a specific index
318     *
319     * @param rep The repetition index (0-indexed)
320     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
321     */
322    public TQ removeQuantityTiming(int rep) throws HL7Exception { 
323        return (TQ) super.removeRepetition(7, rep);
324    }
325
326
327    /**
328     * Removes a repetition of
329     * ORC-7: "Quantity / timing" at a specific index
330     *
331     * @param rep The repetition index (0-indexed)
332     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
333     */
334    public TQ removeOrc7_QuantityTiming(int rep) throws HL7Exception { 
335        return (TQ) super.removeRepetition(7, rep);
336    }
337
338
339
340
341    /**
342     * Returns
343     * ORC-8: "Parent Order" - creates it if necessary
344     */
345    public CM_EIP getParentOrder() { 
346                CM_EIP retVal = this.getTypedField(8, 0);
347                return retVal;
348    }
349    
350    /**
351     * Returns
352     * ORC-8: "Parent Order" - creates it if necessary
353     */
354    public CM_EIP getOrc8_ParentOrder() { 
355                CM_EIP retVal = this.getTypedField(8, 0);
356                return retVal;
357    }
358
359
360
361    /**
362     * Returns
363     * ORC-9: "Date / time of transaction" - creates it if necessary
364     */
365    public TS getDateTimeOfTransaction() { 
366                TS retVal = this.getTypedField(9, 0);
367                return retVal;
368    }
369    
370    /**
371     * Returns
372     * ORC-9: "Date / time of transaction" - creates it if necessary
373     */
374    public TS getOrc9_DateTimeOfTransaction() { 
375                TS retVal = this.getTypedField(9, 0);
376                return retVal;
377    }
378
379
380
381    /**
382     * Returns
383     * ORC-10: "Entered By" - creates it if necessary
384     */
385    public CN getEnteredBy() { 
386                CN retVal = this.getTypedField(10, 0);
387                return retVal;
388    }
389    
390    /**
391     * Returns
392     * ORC-10: "Entered By" - creates it if necessary
393     */
394    public CN getOrc10_EnteredBy() { 
395                CN retVal = this.getTypedField(10, 0);
396                return retVal;
397    }
398
399
400
401    /**
402     * Returns
403     * ORC-11: "Verified By" - creates it if necessary
404     */
405    public CN getVerifiedBy() { 
406                CN retVal = this.getTypedField(11, 0);
407                return retVal;
408    }
409    
410    /**
411     * Returns
412     * ORC-11: "Verified By" - creates it if necessary
413     */
414    public CN getOrc11_VerifiedBy() { 
415                CN retVal = this.getTypedField(11, 0);
416                return retVal;
417    }
418
419
420
421    /**
422     * Returns
423     * ORC-12: "Ordering Provider" - creates it if necessary
424     */
425    public CN getOrderingProvider() { 
426                CN retVal = this.getTypedField(12, 0);
427                return retVal;
428    }
429    
430    /**
431     * Returns
432     * ORC-12: "Ordering Provider" - creates it if necessary
433     */
434    public CN getOrc12_OrderingProvider() { 
435                CN retVal = this.getTypedField(12, 0);
436                return retVal;
437    }
438
439
440
441    /**
442     * Returns
443     * ORC-13: "Enterer's Location" - creates it if necessary
444     */
445    public CM_PARENT_RESULT getEntererSLocation() { 
446                CM_PARENT_RESULT retVal = this.getTypedField(13, 0);
447                return retVal;
448    }
449    
450    /**
451     * Returns
452     * ORC-13: "Enterer's Location" - creates it if necessary
453     */
454    public CM_PARENT_RESULT getOrc13_EntererSLocation() { 
455                CM_PARENT_RESULT retVal = this.getTypedField(13, 0);
456                return retVal;
457    }
458
459
460    /**
461     * Returns all repetitions of Call Back Phone Number (ORC-14).
462     */
463    public TN[] getCallBackPhoneNumber() {
464        TN[] retVal = this.getTypedField(14, new TN[0]);
465        return retVal;
466    }
467
468
469    /**
470     * Returns all repetitions of Call Back Phone Number (ORC-14).
471     */
472    public TN[] getOrc14_CallBackPhoneNumber() {
473        TN[] retVal = this.getTypedField(14, new TN[0]);
474        return retVal;
475    }
476
477
478    /**
479     * Returns a count of the current number of repetitions of Call Back Phone Number (ORC-14).
480     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
481     * it will return zero.
482     */
483    public int getCallBackPhoneNumberReps() {
484        return this.getReps(14);
485    }
486
487
488    /**
489     * Returns a specific repetition of
490     * ORC-14: "Call Back Phone Number" - creates it if necessary
491     *
492     * @param rep The repetition index (0-indexed)
493     */
494    public TN getCallBackPhoneNumber(int rep) { 
495                TN retVal = this.getTypedField(14, rep);
496                return retVal;
497    }
498
499    /**
500     * Returns a specific repetition of
501     * ORC-14: "Call Back Phone Number" - creates it if necessary
502     *
503     * @param rep The repetition index (0-indexed)
504     */
505    public TN getOrc14_CallBackPhoneNumber(int rep) { 
506                TN retVal = this.getTypedField(14, rep);
507                return retVal;
508    }
509
510    /**
511     * Returns a count of the current number of repetitions of Call Back Phone Number (ORC-14).
512     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
513     * it will return zero.
514     */
515    public int getOrc14_CallBackPhoneNumberReps() {
516        return this.getReps(14);
517    }
518
519
520    /**
521     * Inserts a repetition of
522     * ORC-14: "Call Back Phone Number" at a specific index
523     *
524     * @param rep The repetition index (0-indexed)
525     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
526     */
527    public TN insertCallBackPhoneNumber(int rep) throws HL7Exception { 
528        return (TN) super.insertRepetition(14, rep);
529    }
530
531
532    /**
533     * Inserts a repetition of
534     * ORC-14: "Call Back Phone Number" at a specific index
535     *
536     * @param rep The repetition index (0-indexed)
537     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
538     */
539    public TN insertOrc14_CallBackPhoneNumber(int rep) throws HL7Exception { 
540        return (TN) super.insertRepetition(14, rep);
541    }
542
543
544    /**
545     * Removes a repetition of
546     * ORC-14: "Call Back Phone Number" at a specific index
547     *
548     * @param rep The repetition index (0-indexed)
549     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
550     */
551    public TN removeCallBackPhoneNumber(int rep) throws HL7Exception { 
552        return (TN) super.removeRepetition(14, rep);
553    }
554
555
556    /**
557     * Removes a repetition of
558     * ORC-14: "Call Back Phone Number" at a specific index
559     *
560     * @param rep The repetition index (0-indexed)
561     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
562     */
563    public TN removeOrc14_CallBackPhoneNumber(int rep) throws HL7Exception { 
564        return (TN) super.removeRepetition(14, rep);
565    }
566
567
568
569
570    /**
571     * Returns
572     * ORC-15: "Order effective date / time" - creates it if necessary
573     */
574    public TS getOrderEffectiveDateTime() { 
575                TS retVal = this.getTypedField(15, 0);
576                return retVal;
577    }
578    
579    /**
580     * Returns
581     * ORC-15: "Order effective date / time" - creates it if necessary
582     */
583    public TS getOrc15_OrderEffectiveDateTime() { 
584                TS retVal = this.getTypedField(15, 0);
585                return retVal;
586    }
587
588
589
590    /**
591     * Returns
592     * ORC-16: "Order Control Code Reason" - creates it if necessary
593     */
594    public CE getOrderControlCodeReason() { 
595                CE retVal = this.getTypedField(16, 0);
596                return retVal;
597    }
598    
599    /**
600     * Returns
601     * ORC-16: "Order Control Code Reason" - creates it if necessary
602     */
603    public CE getOrc16_OrderControlCodeReason() { 
604                CE retVal = this.getTypedField(16, 0);
605                return retVal;
606    }
607
608
609
610    /**
611     * Returns
612     * ORC-17: "Entering Organization" - creates it if necessary
613     */
614    public CE getEnteringOrganization() { 
615                CE retVal = this.getTypedField(17, 0);
616                return retVal;
617    }
618    
619    /**
620     * Returns
621     * ORC-17: "Entering Organization" - creates it if necessary
622     */
623    public CE getOrc17_EnteringOrganization() { 
624                CE retVal = this.getTypedField(17, 0);
625                return retVal;
626    }
627
628
629
630    /**
631     * Returns
632     * ORC-18: "Entering Device" - creates it if necessary
633     */
634    public CE getEnteringDevice() { 
635                CE retVal = this.getTypedField(18, 0);
636                return retVal;
637    }
638    
639    /**
640     * Returns
641     * ORC-18: "Entering Device" - creates it if necessary
642     */
643    public CE getOrc18_EnteringDevice() { 
644                CE retVal = this.getTypedField(18, 0);
645                return retVal;
646    }
647
648
649
650    /**
651     * Returns
652     * ORC-19: "Action by" - creates it if necessary
653     */
654    public CN getActionBy() { 
655                CN retVal = this.getTypedField(19, 0);
656                return retVal;
657    }
658    
659    /**
660     * Returns
661     * ORC-19: "Action by" - creates it if necessary
662     */
663    public CN getOrc19_ActionBy() { 
664                CN retVal = this.getTypedField(19, 0);
665                return retVal;
666    }
667
668
669
670
671
672    /** {@inheritDoc} */   
673    protected Type createNewTypeWithoutReflection(int field) {
674       switch (field) {
675          case 0: return new ID(getMessage(), new Integer( 119 ));
676          case 1: return new CM_PLACER(getMessage());
677          case 2: return new CM_FILLER(getMessage());
678          case 3: return new CM_GROUP_ID(getMessage());
679          case 4: return new ID(getMessage(), new Integer( 38 ));
680          case 5: return new ID(getMessage(), new Integer( 121 ));
681          case 6: return new TQ(getMessage());
682          case 7: return new CM_EIP(getMessage());
683          case 8: return new TS(getMessage());
684          case 9: return new CN(getMessage());
685          case 10: return new CN(getMessage());
686          case 11: return new CN(getMessage());
687          case 12: return new CM_PARENT_RESULT(getMessage());
688          case 13: return new TN(getMessage());
689          case 14: return new TS(getMessage());
690          case 15: return new CE(getMessage());
691          case 16: return new CE(getMessage());
692          case 17: return new CE(getMessage());
693          case 18: return new CN(getMessage());
694          default: return null;
695       }
696   }
697
698
699}
700