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