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