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.v28.segment;
035
036// import ca.uhn.hl7v2.model.v28.group.*;
037import ca.uhn.hl7v2.model.v28.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 BTX message segment (Blood Product Transfusion/Disposition). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>BTX-1: Set ID - BTX (SI) <b> </b>
053     * <li>BTX-2: BC Donation ID (EI) <b>optional </b>
054     * <li>BTX-3: BC Component (CNE) <b>optional </b>
055     * <li>BTX-4: BC Blood Group (CNE) <b>optional </b>
056     * <li>BTX-5: CP Commercial Product (CWE) <b>optional </b>
057     * <li>BTX-6: CP Manufacturer (XON) <b>optional </b>
058     * <li>BTX-7: CP Lot Number (EI) <b>optional </b>
059     * <li>BTX-8: BP Quantity (NM) <b> </b>
060     * <li>BTX-9: BP Amount (NM) <b>optional </b>
061     * <li>BTX-10: BP Units (CWE) <b>optional </b>
062     * <li>BTX-11: BP Transfusion/Disposition Status (CWE) <b> </b>
063     * <li>BTX-12: BP Message Status (ID) <b> </b>
064     * <li>BTX-13: BP Date/Time of Status (DTM) <b> </b>
065     * <li>BTX-14: BP Transfusion Administrator (XCN) <b>optional </b>
066     * <li>BTX-15: BP Transfusion Verifier (XCN) <b>optional </b>
067     * <li>BTX-16: BP Transfusion Start Date/Time of Status (DTM) <b>optional </b>
068     * <li>BTX-17: BP Transfusion End Date/Time of Status (DTM) <b>optional </b>
069     * <li>BTX-18: BP Adverse Reaction Type (CWE) <b>optional repeating</b>
070     * <li>BTX-19: BP Transfusion Interrupted Reason (CWE) <b>optional </b>
071     * <li>BTX-20: BP Unique ID (EI) <b>optional </b>
072 * </ul>
073 */
074@SuppressWarnings("unused")
075public class BTX extends AbstractSegment {
076
077    /** 
078     * Creates a new BTX segment
079     */
080    public BTX(Group parent, ModelClassFactory factory) {
081       super(parent, factory);
082       init(factory);
083    }
084
085    private void init(ModelClassFactory factory) {
086       try {
087                                  this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - BTX");
088                                  this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "BC Donation ID");
089                                  this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "BC Component");
090                                  this.add(CNE.class, false, 1, 0, new Object[]{ getMessage() }, "BC Blood Group");
091                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "CP Commercial Product");
092                                  this.add(XON.class, false, 1, 0, new Object[]{ getMessage() }, "CP Manufacturer");
093                                  this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "CP Lot Number");
094                                  this.add(NM.class, true, 1, 0, new Object[]{ getMessage() }, "BP Quantity");
095                                  this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "BP Amount");
096                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "BP Units");
097                                  this.add(CWE.class, true, 1, 0, new Object[]{ getMessage() }, "BP Transfusion/Disposition Status");
098                                              this.add(ID.class, true, 1, 1, new Object[]{ getMessage(), new Integer(511) }, "BP Message Status");
099                                  this.add(DTM.class, true, 1, 0, new Object[]{ getMessage() }, "BP Date/Time of Status");
100                                  this.add(XCN.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Administrator");
101                                  this.add(XCN.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Verifier");
102                                  this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Start Date/Time of Status");
103                                  this.add(DTM.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion End Date/Time of Status");
104                                  this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "BP Adverse Reaction Type");
105                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "BP Transfusion Interrupted Reason");
106                                  this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "BP Unique ID");
107       } catch(HL7Exception e) {
108          log.error("Unexpected error creating BTX - this is probably a bug in the source code generator.", e);
109       }
110    }
111
112
113
114    /**
115     * Returns
116     * BTX-1: "Set ID - BTX" - creates it if necessary
117     */
118    public SI getSetIDBTX() { 
119                SI retVal = this.getTypedField(1, 0);
120                return retVal;
121    }
122    
123    /**
124     * Returns
125     * BTX-1: "Set ID - BTX" - creates it if necessary
126     */
127    public SI getBtx1_SetIDBTX() { 
128                SI retVal = this.getTypedField(1, 0);
129                return retVal;
130    }
131
132
133
134    /**
135     * Returns
136     * BTX-2: "BC Donation ID" - creates it if necessary
137     */
138    public EI getBCDonationID() { 
139                EI retVal = this.getTypedField(2, 0);
140                return retVal;
141    }
142    
143    /**
144     * Returns
145     * BTX-2: "BC Donation ID" - creates it if necessary
146     */
147    public EI getBtx2_BCDonationID() { 
148                EI retVal = this.getTypedField(2, 0);
149                return retVal;
150    }
151
152
153
154    /**
155     * Returns
156     * BTX-3: "BC Component" - creates it if necessary
157     */
158    public CNE getBCComponent() { 
159                CNE retVal = this.getTypedField(3, 0);
160                return retVal;
161    }
162    
163    /**
164     * Returns
165     * BTX-3: "BC Component" - creates it if necessary
166     */
167    public CNE getBtx3_BCComponent() { 
168                CNE retVal = this.getTypedField(3, 0);
169                return retVal;
170    }
171
172
173
174    /**
175     * Returns
176     * BTX-4: "BC Blood Group" - creates it if necessary
177     */
178    public CNE getBCBloodGroup() { 
179                CNE retVal = this.getTypedField(4, 0);
180                return retVal;
181    }
182    
183    /**
184     * Returns
185     * BTX-4: "BC Blood Group" - creates it if necessary
186     */
187    public CNE getBtx4_BCBloodGroup() { 
188                CNE retVal = this.getTypedField(4, 0);
189                return retVal;
190    }
191
192
193
194    /**
195     * Returns
196     * BTX-5: "CP Commercial Product" - creates it if necessary
197     */
198    public CWE getCPCommercialProduct() { 
199                CWE retVal = this.getTypedField(5, 0);
200                return retVal;
201    }
202    
203    /**
204     * Returns
205     * BTX-5: "CP Commercial Product" - creates it if necessary
206     */
207    public CWE getBtx5_CPCommercialProduct() { 
208                CWE retVal = this.getTypedField(5, 0);
209                return retVal;
210    }
211
212
213
214    /**
215     * Returns
216     * BTX-6: "CP Manufacturer" - creates it if necessary
217     */
218    public XON getCPManufacturer() { 
219                XON retVal = this.getTypedField(6, 0);
220                return retVal;
221    }
222    
223    /**
224     * Returns
225     * BTX-6: "CP Manufacturer" - creates it if necessary
226     */
227    public XON getBtx6_CPManufacturer() { 
228                XON retVal = this.getTypedField(6, 0);
229                return retVal;
230    }
231
232
233
234    /**
235     * Returns
236     * BTX-7: "CP Lot Number" - creates it if necessary
237     */
238    public EI getCPLotNumber() { 
239                EI retVal = this.getTypedField(7, 0);
240                return retVal;
241    }
242    
243    /**
244     * Returns
245     * BTX-7: "CP Lot Number" - creates it if necessary
246     */
247    public EI getBtx7_CPLotNumber() { 
248                EI retVal = this.getTypedField(7, 0);
249                return retVal;
250    }
251
252
253
254    /**
255     * Returns
256     * BTX-8: "BP Quantity" - creates it if necessary
257     */
258    public NM getBPQuantity() { 
259                NM retVal = this.getTypedField(8, 0);
260                return retVal;
261    }
262    
263    /**
264     * Returns
265     * BTX-8: "BP Quantity" - creates it if necessary
266     */
267    public NM getBtx8_BPQuantity() { 
268                NM retVal = this.getTypedField(8, 0);
269                return retVal;
270    }
271
272
273
274    /**
275     * Returns
276     * BTX-9: "BP Amount" - creates it if necessary
277     */
278    public NM getBPAmount() { 
279                NM retVal = this.getTypedField(9, 0);
280                return retVal;
281    }
282    
283    /**
284     * Returns
285     * BTX-9: "BP Amount" - creates it if necessary
286     */
287    public NM getBtx9_BPAmount() { 
288                NM retVal = this.getTypedField(9, 0);
289                return retVal;
290    }
291
292
293
294    /**
295     * Returns
296     * BTX-10: "BP Units" - creates it if necessary
297     */
298    public CWE getBPUnits() { 
299                CWE retVal = this.getTypedField(10, 0);
300                return retVal;
301    }
302    
303    /**
304     * Returns
305     * BTX-10: "BP Units" - creates it if necessary
306     */
307    public CWE getBtx10_BPUnits() { 
308                CWE retVal = this.getTypedField(10, 0);
309                return retVal;
310    }
311
312
313
314    /**
315     * Returns
316     * BTX-11: "BP Transfusion/Disposition Status" - creates it if necessary
317     */
318    public CWE getBPTransfusionDispositionStatus() { 
319                CWE retVal = this.getTypedField(11, 0);
320                return retVal;
321    }
322    
323    /**
324     * Returns
325     * BTX-11: "BP Transfusion/Disposition Status" - creates it if necessary
326     */
327    public CWE getBtx11_BPTransfusionDispositionStatus() { 
328                CWE retVal = this.getTypedField(11, 0);
329                return retVal;
330    }
331
332
333
334    /**
335     * Returns
336     * BTX-12: "BP Message Status" - creates it if necessary
337     */
338    public ID getBPMessageStatus() { 
339                ID retVal = this.getTypedField(12, 0);
340                return retVal;
341    }
342    
343    /**
344     * Returns
345     * BTX-12: "BP Message Status" - creates it if necessary
346     */
347    public ID getBtx12_BPMessageStatus() { 
348                ID retVal = this.getTypedField(12, 0);
349                return retVal;
350    }
351
352
353
354    /**
355     * Returns
356     * BTX-13: "BP Date/Time of Status" - creates it if necessary
357     */
358    public DTM getBPDateTimeOfStatus() { 
359                DTM retVal = this.getTypedField(13, 0);
360                return retVal;
361    }
362    
363    /**
364     * Returns
365     * BTX-13: "BP Date/Time of Status" - creates it if necessary
366     */
367    public DTM getBtx13_BPDateTimeOfStatus() { 
368                DTM retVal = this.getTypedField(13, 0);
369                return retVal;
370    }
371
372
373
374    /**
375     * Returns
376     * BTX-14: "BP Transfusion Administrator" - creates it if necessary
377     */
378    public XCN getBPTransfusionAdministrator() { 
379                XCN retVal = this.getTypedField(14, 0);
380                return retVal;
381    }
382    
383    /**
384     * Returns
385     * BTX-14: "BP Transfusion Administrator" - creates it if necessary
386     */
387    public XCN getBtx14_BPTransfusionAdministrator() { 
388                XCN retVal = this.getTypedField(14, 0);
389                return retVal;
390    }
391
392
393
394    /**
395     * Returns
396     * BTX-15: "BP Transfusion Verifier" - creates it if necessary
397     */
398    public XCN getBPTransfusionVerifier() { 
399                XCN retVal = this.getTypedField(15, 0);
400                return retVal;
401    }
402    
403    /**
404     * Returns
405     * BTX-15: "BP Transfusion Verifier" - creates it if necessary
406     */
407    public XCN getBtx15_BPTransfusionVerifier() { 
408                XCN retVal = this.getTypedField(15, 0);
409                return retVal;
410    }
411
412
413
414    /**
415     * Returns
416     * BTX-16: "BP Transfusion Start Date/Time of Status" - creates it if necessary
417     */
418    public DTM getBPTransfusionStartDateTimeOfStatus() { 
419                DTM retVal = this.getTypedField(16, 0);
420                return retVal;
421    }
422    
423    /**
424     * Returns
425     * BTX-16: "BP Transfusion Start Date/Time of Status" - creates it if necessary
426     */
427    public DTM getBtx16_BPTransfusionStartDateTimeOfStatus() { 
428                DTM retVal = this.getTypedField(16, 0);
429                return retVal;
430    }
431
432
433
434    /**
435     * Returns
436     * BTX-17: "BP Transfusion End Date/Time of Status" - creates it if necessary
437     */
438    public DTM getBPTransfusionEndDateTimeOfStatus() { 
439                DTM retVal = this.getTypedField(17, 0);
440                return retVal;
441    }
442    
443    /**
444     * Returns
445     * BTX-17: "BP Transfusion End Date/Time of Status" - creates it if necessary
446     */
447    public DTM getBtx17_BPTransfusionEndDateTimeOfStatus() { 
448                DTM retVal = this.getTypedField(17, 0);
449                return retVal;
450    }
451
452
453    /**
454     * Returns all repetitions of BP Adverse Reaction Type (BTX-18).
455     */
456    public CWE[] getBPAdverseReactionType() {
457        CWE[] retVal = this.getTypedField(18, new CWE[0]);
458        return retVal;
459    }
460
461
462    /**
463     * Returns all repetitions of BP Adverse Reaction Type (BTX-18).
464     */
465    public CWE[] getBtx18_BPAdverseReactionType() {
466        CWE[] retVal = this.getTypedField(18, new CWE[0]);
467        return retVal;
468    }
469
470
471    /**
472     * Returns a count of the current number of repetitions of BP Adverse Reaction Type (BTX-18).
473     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
474     * it will return zero.
475     */
476    public int getBPAdverseReactionTypeReps() {
477        return this.getReps(18);
478    }
479
480
481    /**
482     * Returns a specific repetition of
483     * BTX-18: "BP Adverse Reaction Type" - creates it if necessary
484     *
485     * @param rep The repetition index (0-indexed)
486     */
487    public CWE getBPAdverseReactionType(int rep) { 
488                CWE retVal = this.getTypedField(18, rep);
489                return retVal;
490    }
491
492    /**
493     * Returns a specific repetition of
494     * BTX-18: "BP Adverse Reaction Type" - creates it if necessary
495     *
496     * @param rep The repetition index (0-indexed)
497     */
498    public CWE getBtx18_BPAdverseReactionType(int rep) { 
499                CWE retVal = this.getTypedField(18, rep);
500                return retVal;
501    }
502
503    /**
504     * Returns a count of the current number of repetitions of BP Adverse Reaction Type (BTX-18).
505     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
506     * it will return zero.
507     */
508    public int getBtx18_BPAdverseReactionTypeReps() {
509        return this.getReps(18);
510    }
511
512
513    /**
514     * Inserts a repetition of
515     * BTX-18: "BP Adverse Reaction Type" at a specific index
516     *
517     * @param rep The repetition index (0-indexed)
518     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
519     */
520    public CWE insertBPAdverseReactionType(int rep) throws HL7Exception { 
521        return (CWE) super.insertRepetition(18, rep);
522    }
523
524
525    /**
526     * Inserts a repetition of
527     * BTX-18: "BP Adverse Reaction Type" at a specific index
528     *
529     * @param rep The repetition index (0-indexed)
530     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
531     */
532    public CWE insertBtx18_BPAdverseReactionType(int rep) throws HL7Exception { 
533        return (CWE) super.insertRepetition(18, rep);
534    }
535
536
537    /**
538     * Removes a repetition of
539     * BTX-18: "BP Adverse Reaction Type" at a specific index
540     *
541     * @param rep The repetition index (0-indexed)
542     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
543     */
544    public CWE removeBPAdverseReactionType(int rep) throws HL7Exception { 
545        return (CWE) super.removeRepetition(18, rep);
546    }
547
548
549    /**
550     * Removes a repetition of
551     * BTX-18: "BP Adverse Reaction Type" at a specific index
552     *
553     * @param rep The repetition index (0-indexed)
554     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
555     */
556    public CWE removeBtx18_BPAdverseReactionType(int rep) throws HL7Exception { 
557        return (CWE) super.removeRepetition(18, rep);
558    }
559
560
561
562
563    /**
564     * Returns
565     * BTX-19: "BP Transfusion Interrupted Reason" - creates it if necessary
566     */
567    public CWE getBPTransfusionInterruptedReason() { 
568                CWE retVal = this.getTypedField(19, 0);
569                return retVal;
570    }
571    
572    /**
573     * Returns
574     * BTX-19: "BP Transfusion Interrupted Reason" - creates it if necessary
575     */
576    public CWE getBtx19_BPTransfusionInterruptedReason() { 
577                CWE retVal = this.getTypedField(19, 0);
578                return retVal;
579    }
580
581
582
583    /**
584     * Returns
585     * BTX-20: "BP Unique ID" - creates it if necessary
586     */
587    public EI getBPUniqueID() { 
588                EI retVal = this.getTypedField(20, 0);
589                return retVal;
590    }
591    
592    /**
593     * Returns
594     * BTX-20: "BP Unique ID" - creates it if necessary
595     */
596    public EI getBtx20_BPUniqueID() { 
597                EI retVal = this.getTypedField(20, 0);
598                return retVal;
599    }
600
601
602
603
604
605    /** {@inheritDoc} */   
606    protected Type createNewTypeWithoutReflection(int field) {
607       switch (field) {
608          case 0: return new SI(getMessage());
609          case 1: return new EI(getMessage());
610          case 2: return new CNE(getMessage());
611          case 3: return new CNE(getMessage());
612          case 4: return new CWE(getMessage());
613          case 5: return new XON(getMessage());
614          case 6: return new EI(getMessage());
615          case 7: return new NM(getMessage());
616          case 8: return new NM(getMessage());
617          case 9: return new CWE(getMessage());
618          case 10: return new CWE(getMessage());
619          case 11: return new ID(getMessage(), new Integer( 511 ));
620          case 12: return new DTM(getMessage());
621          case 13: return new XCN(getMessage());
622          case 14: return new XCN(getMessage());
623          case 15: return new DTM(getMessage());
624          case 16: return new DTM(getMessage());
625          case 17: return new CWE(getMessage());
626          case 18: return new CWE(getMessage());
627          case 19: return new EI(getMessage());
628          default: return null;
629       }
630   }
631
632
633}
634