View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v251.segment;
35  
36  // import ca.uhn.hl7v2.model.v251.group.*;
37  import ca.uhn.hl7v2.model.v251.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 BTX message segment (Blood Product Transfusion/Disposition). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>BTX-1: Set ID - BTX (SI) <b> </b>
53       * <li>BTX-2: BC Donation ID (EI) <b>optional </b>
54       * <li>BTX-3: BC Component (CNE) <b>optional </b>
55       * <li>BTX-4: BC Blood Group (CNE) <b>optional </b>
56       * <li>BTX-5: CP Commercial Product (CWE) <b>optional </b>
57       * <li>BTX-6: CP Manufacturer (XON) <b>optional </b>
58       * <li>BTX-7: CP Lot Number (EI) <b>optional </b>
59       * <li>BTX-8: BP Quantity (NM) <b> </b>
60       * <li>BTX-9: BP Amount (NM) <b>optional </b>
61       * <li>BTX-10: BP Units (CE) <b>optional </b>
62       * <li>BTX-11: BP Transfusion/Disposition Status (CWE) <b> </b>
63       * <li>BTX-12: BP Message Status (ID) <b> </b>
64       * <li>BTX-13: BP Date/Time of Status (TS) <b> </b>
65       * <li>BTX-14: BP Administrator (XCN) <b>optional </b>
66       * <li>BTX-15: BP Verifier (XCN) <b>optional </b>
67       * <li>BTX-16: BP Transfusion Start Date/Time of Status (TS) <b>optional </b>
68       * <li>BTX-17: BP Transfusion End Date/Time of Status (TS) <b>optional </b>
69       * <li>BTX-18: BP Adverse Reaction Type (CWE) <b>optional repeating</b>
70       * <li>BTX-19: BP Transfusion Interrupted Reason (CWE) <b>optional </b>
71   * </ul>
72   */
73  @SuppressWarnings("unused")
74  public class BTX extends AbstractSegment {
75  
76      /** 
77       * Creates a new BTX segment
78       */
79      public BTX(Group parent, ModelClassFactory factory) {
80         super(parent, factory);
81         init(factory);
82      }
83  
84      private void init(ModelClassFactory factory) {
85         try {
86                                    this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - BTX");
87                                    this.add(EI.class, false, 1, 22, new Object[]{ getMessage() }, "BC Donation ID");
88                                    this.add(CNE.class, false, 1, 250, new Object[]{ getMessage() }, "BC Component");
89                                    this.add(CNE.class, false, 1, 250, new Object[]{ getMessage() }, "BC Blood Group");
90                                    this.add(CWE.class, false, 1, 250, new Object[]{ getMessage() }, "CP Commercial Product");
91                                    this.add(XON.class, false, 1, 250, new Object[]{ getMessage() }, "CP Manufacturer");
92                                    this.add(EI.class, false, 1, 22, new Object[]{ getMessage() }, "CP Lot Number");
93                                    this.add(NM.class, true, 1, 5, new Object[]{ getMessage() }, "BP Quantity");
94                                    this.add(NM.class, false, 1, 5, new Object[]{ getMessage() }, "BP Amount");
95                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "BP Units");
96                                    this.add(CWE.class, true, 1, 250, new Object[]{ getMessage() }, "BP Transfusion/Disposition Status");
97                                                this.add(ID.class, true, 1, 1, new Object[]{ getMessage(), new Integer(511) }, "BP Message Status");
98                                    this.add(TS.class, true, 1, 26, new Object[]{ getMessage() }, "BP Date/Time of Status");
99                                    this.add(XCN.class, false, 1, 250, new Object[]{ getMessage() }, "BP Administrator");
100                                   this.add(XCN.class, false, 1, 250, new Object[]{ getMessage() }, "BP Verifier");
101                                   this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "BP Transfusion Start Date/Time of Status");
102                                   this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "BP Transfusion End Date/Time of Status");
103                                   this.add(CWE.class, false, 0, 250, new Object[]{ getMessage() }, "BP Adverse Reaction Type");
104                                   this.add(CWE.class, false, 1, 250, new Object[]{ getMessage() }, "BP Transfusion Interrupted Reason");
105        } catch(HL7Exception e) {
106           log.error("Unexpected error creating BTX - this is probably a bug in the source code generator.", e);
107        }
108     }
109 
110 
111 
112     /**
113      * Returns
114      * BTX-1: "Set ID - BTX" - creates it if necessary
115      */
116     public SI getSetIDBTX() { 
117 		SI retVal = this.getTypedField(1, 0);
118 		return retVal;
119     }
120     
121     /**
122      * Returns
123      * BTX-1: "Set ID - BTX" - creates it if necessary
124      */
125     public SI getBtx1_SetIDBTX() { 
126 		SI retVal = this.getTypedField(1, 0);
127 		return retVal;
128     }
129 
130 
131 
132     /**
133      * Returns
134      * BTX-2: "BC Donation ID" - creates it if necessary
135      */
136     public EI getBCDonationID() { 
137 		EI retVal = this.getTypedField(2, 0);
138 		return retVal;
139     }
140     
141     /**
142      * Returns
143      * BTX-2: "BC Donation ID" - creates it if necessary
144      */
145     public EI getBtx2_BCDonationID() { 
146 		EI retVal = this.getTypedField(2, 0);
147 		return retVal;
148     }
149 
150 
151 
152     /**
153      * Returns
154      * BTX-3: "BC Component" - creates it if necessary
155      */
156     public CNE getBCComponent() { 
157 		CNE retVal = this.getTypedField(3, 0);
158 		return retVal;
159     }
160     
161     /**
162      * Returns
163      * BTX-3: "BC Component" - creates it if necessary
164      */
165     public CNE getBtx3_BCComponent() { 
166 		CNE retVal = this.getTypedField(3, 0);
167 		return retVal;
168     }
169 
170 
171 
172     /**
173      * Returns
174      * BTX-4: "BC Blood Group" - creates it if necessary
175      */
176     public CNE getBCBloodGroup() { 
177 		CNE retVal = this.getTypedField(4, 0);
178 		return retVal;
179     }
180     
181     /**
182      * Returns
183      * BTX-4: "BC Blood Group" - creates it if necessary
184      */
185     public CNE getBtx4_BCBloodGroup() { 
186 		CNE retVal = this.getTypedField(4, 0);
187 		return retVal;
188     }
189 
190 
191 
192     /**
193      * Returns
194      * BTX-5: "CP Commercial Product" - creates it if necessary
195      */
196     public CWE getCPCommercialProduct() { 
197 		CWE retVal = this.getTypedField(5, 0);
198 		return retVal;
199     }
200     
201     /**
202      * Returns
203      * BTX-5: "CP Commercial Product" - creates it if necessary
204      */
205     public CWE getBtx5_CPCommercialProduct() { 
206 		CWE retVal = this.getTypedField(5, 0);
207 		return retVal;
208     }
209 
210 
211 
212     /**
213      * Returns
214      * BTX-6: "CP Manufacturer" - creates it if necessary
215      */
216     public XON getCPManufacturer() { 
217 		XON retVal = this.getTypedField(6, 0);
218 		return retVal;
219     }
220     
221     /**
222      * Returns
223      * BTX-6: "CP Manufacturer" - creates it if necessary
224      */
225     public XON getBtx6_CPManufacturer() { 
226 		XON retVal = this.getTypedField(6, 0);
227 		return retVal;
228     }
229 
230 
231 
232     /**
233      * Returns
234      * BTX-7: "CP Lot Number" - creates it if necessary
235      */
236     public EI getCPLotNumber() { 
237 		EI retVal = this.getTypedField(7, 0);
238 		return retVal;
239     }
240     
241     /**
242      * Returns
243      * BTX-7: "CP Lot Number" - creates it if necessary
244      */
245     public EI getBtx7_CPLotNumber() { 
246 		EI retVal = this.getTypedField(7, 0);
247 		return retVal;
248     }
249 
250 
251 
252     /**
253      * Returns
254      * BTX-8: "BP Quantity" - creates it if necessary
255      */
256     public NM getBPQuantity() { 
257 		NM retVal = this.getTypedField(8, 0);
258 		return retVal;
259     }
260     
261     /**
262      * Returns
263      * BTX-8: "BP Quantity" - creates it if necessary
264      */
265     public NM getBtx8_BPQuantity() { 
266 		NM retVal = this.getTypedField(8, 0);
267 		return retVal;
268     }
269 
270 
271 
272     /**
273      * Returns
274      * BTX-9: "BP Amount" - creates it if necessary
275      */
276     public NM getBPAmount() { 
277 		NM retVal = this.getTypedField(9, 0);
278 		return retVal;
279     }
280     
281     /**
282      * Returns
283      * BTX-9: "BP Amount" - creates it if necessary
284      */
285     public NM getBtx9_BPAmount() { 
286 		NM retVal = this.getTypedField(9, 0);
287 		return retVal;
288     }
289 
290 
291 
292     /**
293      * Returns
294      * BTX-10: "BP Units" - creates it if necessary
295      */
296     public CE getBPUnits() { 
297 		CE retVal = this.getTypedField(10, 0);
298 		return retVal;
299     }
300     
301     /**
302      * Returns
303      * BTX-10: "BP Units" - creates it if necessary
304      */
305     public CE getBtx10_BPUnits() { 
306 		CE retVal = this.getTypedField(10, 0);
307 		return retVal;
308     }
309 
310 
311 
312     /**
313      * Returns
314      * BTX-11: "BP Transfusion/Disposition Status" - creates it if necessary
315      */
316     public CWE getBPTransfusionDispositionStatus() { 
317 		CWE retVal = this.getTypedField(11, 0);
318 		return retVal;
319     }
320     
321     /**
322      * Returns
323      * BTX-11: "BP Transfusion/Disposition Status" - creates it if necessary
324      */
325     public CWE getBtx11_BPTransfusionDispositionStatus() { 
326 		CWE retVal = this.getTypedField(11, 0);
327 		return retVal;
328     }
329 
330 
331 
332     /**
333      * Returns
334      * BTX-12: "BP Message Status" - creates it if necessary
335      */
336     public ID getBPMessageStatus() { 
337 		ID retVal = this.getTypedField(12, 0);
338 		return retVal;
339     }
340     
341     /**
342      * Returns
343      * BTX-12: "BP Message Status" - creates it if necessary
344      */
345     public ID getBtx12_BPMessageStatus() { 
346 		ID retVal = this.getTypedField(12, 0);
347 		return retVal;
348     }
349 
350 
351 
352     /**
353      * Returns
354      * BTX-13: "BP Date/Time of Status" - creates it if necessary
355      */
356     public TS getBPDateTimeOfStatus() { 
357 		TS retVal = this.getTypedField(13, 0);
358 		return retVal;
359     }
360     
361     /**
362      * Returns
363      * BTX-13: "BP Date/Time of Status" - creates it if necessary
364      */
365     public TS getBtx13_BPDateTimeOfStatus() { 
366 		TS retVal = this.getTypedField(13, 0);
367 		return retVal;
368     }
369 
370 
371 
372     /**
373      * Returns
374      * BTX-14: "BP Administrator" - creates it if necessary
375      */
376     public XCN getBPAdministrator() { 
377 		XCN retVal = this.getTypedField(14, 0);
378 		return retVal;
379     }
380     
381     /**
382      * Returns
383      * BTX-14: "BP Administrator" - creates it if necessary
384      */
385     public XCN getBtx14_BPAdministrator() { 
386 		XCN retVal = this.getTypedField(14, 0);
387 		return retVal;
388     }
389 
390 
391 
392     /**
393      * Returns
394      * BTX-15: "BP Verifier" - creates it if necessary
395      */
396     public XCN getBPVerifier() { 
397 		XCN retVal = this.getTypedField(15, 0);
398 		return retVal;
399     }
400     
401     /**
402      * Returns
403      * BTX-15: "BP Verifier" - creates it if necessary
404      */
405     public XCN getBtx15_BPVerifier() { 
406 		XCN retVal = this.getTypedField(15, 0);
407 		return retVal;
408     }
409 
410 
411 
412     /**
413      * Returns
414      * BTX-16: "BP Transfusion Start Date/Time of Status" - creates it if necessary
415      */
416     public TS getBPTransfusionStartDateTimeOfStatus() { 
417 		TS retVal = this.getTypedField(16, 0);
418 		return retVal;
419     }
420     
421     /**
422      * Returns
423      * BTX-16: "BP Transfusion Start Date/Time of Status" - creates it if necessary
424      */
425     public TS getBtx16_BPTransfusionStartDateTimeOfStatus() { 
426 		TS retVal = this.getTypedField(16, 0);
427 		return retVal;
428     }
429 
430 
431 
432     /**
433      * Returns
434      * BTX-17: "BP Transfusion End Date/Time of Status" - creates it if necessary
435      */
436     public TS getBPTransfusionEndDateTimeOfStatus() { 
437 		TS retVal = this.getTypedField(17, 0);
438 		return retVal;
439     }
440     
441     /**
442      * Returns
443      * BTX-17: "BP Transfusion End Date/Time of Status" - creates it if necessary
444      */
445     public TS getBtx17_BPTransfusionEndDateTimeOfStatus() { 
446 		TS retVal = this.getTypedField(17, 0);
447 		return retVal;
448     }
449 
450 
451     /**
452      * Returns all repetitions of BP Adverse Reaction Type (BTX-18).
453      */
454     public CWE[] getBPAdverseReactionType() {
455     	CWE[] retVal = this.getTypedField(18, new CWE[0]);
456     	return retVal;
457     }
458 
459 
460     /**
461      * Returns all repetitions of BP Adverse Reaction Type (BTX-18).
462      */
463     public CWE[] getBtx18_BPAdverseReactionType() {
464     	CWE[] retVal = this.getTypedField(18, new CWE[0]);
465     	return retVal;
466     }
467 
468 
469     /**
470      * Returns a count of the current number of repetitions of BP Adverse Reaction Type (BTX-18).
471      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
472      * it will return zero.
473      */
474     public int getBPAdverseReactionTypeReps() {
475     	return this.getReps(18);
476     }
477 
478 
479     /**
480      * Returns a specific repetition of
481      * BTX-18: "BP Adverse Reaction Type" - creates it if necessary
482      *
483      * @param rep The repetition index (0-indexed)
484      */
485     public CWE getBPAdverseReactionType(int rep) { 
486 		CWE retVal = this.getTypedField(18, rep);
487 		return retVal;
488     }
489 
490     /**
491      * Returns a specific repetition of
492      * BTX-18: "BP Adverse Reaction Type" - creates it if necessary
493      *
494      * @param rep The repetition index (0-indexed)
495      */
496     public CWE getBtx18_BPAdverseReactionType(int rep) { 
497 		CWE retVal = this.getTypedField(18, rep);
498 		return retVal;
499     }
500 
501     /**
502      * Returns a count of the current number of repetitions of BP Adverse Reaction Type (BTX-18).
503      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
504      * it will return zero.
505      */
506     public int getBtx18_BPAdverseReactionTypeReps() {
507     	return this.getReps(18);
508     }
509 
510 
511     /**
512      * Inserts a repetition of
513      * BTX-18: "BP Adverse Reaction Type" at a specific index
514      *
515      * @param rep The repetition index (0-indexed)
516      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
517      */
518     public CWE insertBPAdverseReactionType(int rep) throws HL7Exception { 
519         return (CWE) super.insertRepetition(18, rep);
520     }
521 
522 
523     /**
524      * Inserts a repetition of
525      * BTX-18: "BP Adverse Reaction Type" at a specific index
526      *
527      * @param rep The repetition index (0-indexed)
528      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
529      */
530     public CWE insertBtx18_BPAdverseReactionType(int rep) throws HL7Exception { 
531         return (CWE) super.insertRepetition(18, rep);
532     }
533 
534 
535     /**
536      * Removes a repetition of
537      * BTX-18: "BP Adverse Reaction Type" at a specific index
538      *
539      * @param rep The repetition index (0-indexed)
540      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
541      */
542     public CWE removeBPAdverseReactionType(int rep) throws HL7Exception { 
543         return (CWE) super.removeRepetition(18, rep);
544     }
545 
546 
547     /**
548      * Removes a repetition of
549      * BTX-18: "BP Adverse Reaction Type" at a specific index
550      *
551      * @param rep The repetition index (0-indexed)
552      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
553      */
554     public CWE removeBtx18_BPAdverseReactionType(int rep) throws HL7Exception { 
555         return (CWE) super.removeRepetition(18, rep);
556     }
557 
558 
559 
560 
561     /**
562      * Returns
563      * BTX-19: "BP Transfusion Interrupted Reason" - creates it if necessary
564      */
565     public CWE getBPTransfusionInterruptedReason() { 
566 		CWE retVal = this.getTypedField(19, 0);
567 		return retVal;
568     }
569     
570     /**
571      * Returns
572      * BTX-19: "BP Transfusion Interrupted Reason" - creates it if necessary
573      */
574     public CWE getBtx19_BPTransfusionInterruptedReason() { 
575 		CWE retVal = this.getTypedField(19, 0);
576 		return retVal;
577     }
578 
579 
580 
581 
582 
583     /** {@inheritDoc} */   
584     protected Type createNewTypeWithoutReflection(int field) {
585        switch (field) {
586           case 0: return new SI(getMessage());
587           case 1: return new EI(getMessage());
588           case 2: return new CNE(getMessage());
589           case 3: return new CNE(getMessage());
590           case 4: return new CWE(getMessage());
591           case 5: return new XON(getMessage());
592           case 6: return new EI(getMessage());
593           case 7: return new NM(getMessage());
594           case 8: return new NM(getMessage());
595           case 9: return new CE(getMessage());
596           case 10: return new CWE(getMessage());
597           case 11: return new ID(getMessage(), new Integer( 511 ));
598           case 12: return new TS(getMessage());
599           case 13: return new XCN(getMessage());
600           case 14: return new XCN(getMessage());
601           case 15: return new TS(getMessage());
602           case 16: return new TS(getMessage());
603           case 17: return new CWE(getMessage());
604           case 18: return new CWE(getMessage());
605           default: return null;
606        }
607    }
608 
609 
610 }
611