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.v24.segment;
35  
36  // import ca.uhn.hl7v2.model.v24.group.*;
37  import ca.uhn.hl7v2.model.v24.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 OM2 message segment (Numeric Observation). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>OM2-1: Sequence Number - Test/ Observation Master File (NM) <b>optional </b>
53       * <li>OM2-2: Units of Measure (CE) <b>optional </b>
54       * <li>OM2-3: Range of Decimal Precision (NM) <b>optional repeating</b>
55       * <li>OM2-4: Corresponding SI Units of Measure (CE) <b>optional </b>
56       * <li>OM2-5: SI Conversion Factor (TX) <b>optional </b>
57       * <li>OM2-6: Reference (Normal) Range - Ordinal and Continuous Observations (RFR) <b>optional </b>
58       * <li>OM2-7: Critical Range for Ordinal and Continuous Observations (NR) <b>optional </b>
59       * <li>OM2-8: Absolute Range for Ordinal and Continuous Observations (RFR) <b>optional </b>
60       * <li>OM2-9: Delta Check Criteria (DLT) <b>optional repeating</b>
61       * <li>OM2-10: Minimum Meaningful Increments (NM) <b>optional </b>
62   * </ul>
63   */
64  @SuppressWarnings("unused")
65  public class OM2 extends AbstractSegment {
66  
67      /** 
68       * Creates a new OM2 segment
69       */
70      public OM2(Group parent, ModelClassFactory factory) {
71         super(parent, factory);
72         init(factory);
73      }
74  
75      private void init(ModelClassFactory factory) {
76         try {
77                                    this.add(NM.class, false, 1, 4, new Object[]{ getMessage() }, "Sequence Number - Test/ Observation Master File");
78                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Units of Measure");
79                                    this.add(NM.class, false, 0, 10, new Object[]{ getMessage() }, "Range of Decimal Precision");
80                                    this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Corresponding SI Units of Measure");
81                                    this.add(TX.class, false, 1, 60, new Object[]{ getMessage() }, "SI Conversion Factor");
82                                    this.add(RFR.class, false, 1, 250, new Object[]{ getMessage() }, "Reference (Normal) Range - Ordinal and Continuous Observations");
83                                    this.add(NR.class, false, 1, 205, new Object[]{ getMessage() }, "Critical Range for Ordinal and Continuous Observations");
84                                    this.add(RFR.class, false, 1, 250, new Object[]{ getMessage() }, "Absolute Range for Ordinal and Continuous Observations");
85                                    this.add(DLT.class, false, 0, 250, new Object[]{ getMessage() }, "Delta Check Criteria");
86                                    this.add(NM.class, false, 1, 20, new Object[]{ getMessage() }, "Minimum Meaningful Increments");
87         } catch(HL7Exception e) {
88            log.error("Unexpected error creating OM2 - this is probably a bug in the source code generator.", e);
89         }
90      }
91  
92  
93  
94      /**
95       * Returns
96       * OM2-1: "Sequence Number - Test/ Observation Master File" - creates it if necessary
97       */
98      public NM getSequenceNumberTestObservationMasterFile() { 
99  		NM retVal = this.getTypedField(1, 0);
100 		return retVal;
101     }
102     
103     /**
104      * Returns
105      * OM2-1: "Sequence Number - Test/ Observation Master File" - creates it if necessary
106      */
107     public NM getOm21_SequenceNumberTestObservationMasterFile() { 
108 		NM retVal = this.getTypedField(1, 0);
109 		return retVal;
110     }
111 
112 
113 
114     /**
115      * Returns
116      * OM2-2: "Units of Measure" - creates it if necessary
117      */
118     public CE getUnitsOfMeasure() { 
119 		CE retVal = this.getTypedField(2, 0);
120 		return retVal;
121     }
122     
123     /**
124      * Returns
125      * OM2-2: "Units of Measure" - creates it if necessary
126      */
127     public CE getOm22_UnitsOfMeasure() { 
128 		CE retVal = this.getTypedField(2, 0);
129 		return retVal;
130     }
131 
132 
133     /**
134      * Returns all repetitions of Range of Decimal Precision (OM2-3).
135      */
136     public NM[] getRangeOfDecimalPrecision() {
137     	NM[] retVal = this.getTypedField(3, new NM[0]);
138     	return retVal;
139     }
140 
141 
142     /**
143      * Returns all repetitions of Range of Decimal Precision (OM2-3).
144      */
145     public NM[] getOm23_RangeOfDecimalPrecision() {
146     	NM[] retVal = this.getTypedField(3, new NM[0]);
147     	return retVal;
148     }
149 
150 
151     /**
152      * Returns a count of the current number of repetitions of Range of Decimal Precision (OM2-3).
153      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
154      * it will return zero.
155      */
156     public int getRangeOfDecimalPrecisionReps() {
157     	return this.getReps(3);
158     }
159 
160 
161     /**
162      * Returns a specific repetition of
163      * OM2-3: "Range of Decimal Precision" - creates it if necessary
164      *
165      * @param rep The repetition index (0-indexed)
166      */
167     public NM getRangeOfDecimalPrecision(int rep) { 
168 		NM retVal = this.getTypedField(3, rep);
169 		return retVal;
170     }
171 
172     /**
173      * Returns a specific repetition of
174      * OM2-3: "Range of Decimal Precision" - creates it if necessary
175      *
176      * @param rep The repetition index (0-indexed)
177      */
178     public NM getOm23_RangeOfDecimalPrecision(int rep) { 
179 		NM retVal = this.getTypedField(3, rep);
180 		return retVal;
181     }
182 
183     /**
184      * Returns a count of the current number of repetitions of Range of Decimal Precision (OM2-3).
185      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
186      * it will return zero.
187      */
188     public int getOm23_RangeOfDecimalPrecisionReps() {
189     	return this.getReps(3);
190     }
191 
192 
193     /**
194      * Inserts a repetition of
195      * OM2-3: "Range of Decimal Precision" at a specific index
196      *
197      * @param rep The repetition index (0-indexed)
198      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
199      */
200     public NM insertRangeOfDecimalPrecision(int rep) throws HL7Exception { 
201         return (NM) super.insertRepetition(3, rep);
202     }
203 
204 
205     /**
206      * Inserts a repetition of
207      * OM2-3: "Range of Decimal Precision" at a specific index
208      *
209      * @param rep The repetition index (0-indexed)
210      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
211      */
212     public NM insertOm23_RangeOfDecimalPrecision(int rep) throws HL7Exception { 
213         return (NM) super.insertRepetition(3, rep);
214     }
215 
216 
217     /**
218      * Removes a repetition of
219      * OM2-3: "Range of Decimal Precision" at a specific index
220      *
221      * @param rep The repetition index (0-indexed)
222      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
223      */
224     public NM removeRangeOfDecimalPrecision(int rep) throws HL7Exception { 
225         return (NM) super.removeRepetition(3, rep);
226     }
227 
228 
229     /**
230      * Removes a repetition of
231      * OM2-3: "Range of Decimal Precision" at a specific index
232      *
233      * @param rep The repetition index (0-indexed)
234      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
235      */
236     public NM removeOm23_RangeOfDecimalPrecision(int rep) throws HL7Exception { 
237         return (NM) super.removeRepetition(3, rep);
238     }
239 
240 
241 
242 
243     /**
244      * Returns
245      * OM2-4: "Corresponding SI Units of Measure" - creates it if necessary
246      */
247     public CE getCorrespondingSIUnitsOfMeasure() { 
248 		CE retVal = this.getTypedField(4, 0);
249 		return retVal;
250     }
251     
252     /**
253      * Returns
254      * OM2-4: "Corresponding SI Units of Measure" - creates it if necessary
255      */
256     public CE getOm24_CorrespondingSIUnitsOfMeasure() { 
257 		CE retVal = this.getTypedField(4, 0);
258 		return retVal;
259     }
260 
261 
262 
263     /**
264      * Returns
265      * OM2-5: "SI Conversion Factor" - creates it if necessary
266      */
267     public TX getSIConversionFactor() { 
268 		TX retVal = this.getTypedField(5, 0);
269 		return retVal;
270     }
271     
272     /**
273      * Returns
274      * OM2-5: "SI Conversion Factor" - creates it if necessary
275      */
276     public TX getOm25_SIConversionFactor() { 
277 		TX retVal = this.getTypedField(5, 0);
278 		return retVal;
279     }
280 
281 
282 
283     /**
284      * Returns
285      * OM2-6: "Reference (Normal) Range - Ordinal and Continuous Observations" - creates it if necessary
286      */
287     public RFR getReferenceNormalRangeOrdinalAndContinuousObservations() { 
288 		RFR retVal = this.getTypedField(6, 0);
289 		return retVal;
290     }
291     
292     /**
293      * Returns
294      * OM2-6: "Reference (Normal) Range - Ordinal and Continuous Observations" - creates it if necessary
295      */
296     public RFR getOm26_ReferenceNormalRangeOrdinalAndContinuousObservations() { 
297 		RFR retVal = this.getTypedField(6, 0);
298 		return retVal;
299     }
300 
301 
302 
303     /**
304      * Returns
305      * OM2-7: "Critical Range for Ordinal and Continuous Observations" - creates it if necessary
306      */
307     public NR getCriticalRangeForOrdinalAndContinuousObservations() { 
308 		NR retVal = this.getTypedField(7, 0);
309 		return retVal;
310     }
311     
312     /**
313      * Returns
314      * OM2-7: "Critical Range for Ordinal and Continuous Observations" - creates it if necessary
315      */
316     public NR getOm27_CriticalRangeForOrdinalAndContinuousObservations() { 
317 		NR retVal = this.getTypedField(7, 0);
318 		return retVal;
319     }
320 
321 
322 
323     /**
324      * Returns
325      * OM2-8: "Absolute Range for Ordinal and Continuous Observations" - creates it if necessary
326      */
327     public RFR getAbsoluteRangeForOrdinalAndContinuousObservations() { 
328 		RFR retVal = this.getTypedField(8, 0);
329 		return retVal;
330     }
331     
332     /**
333      * Returns
334      * OM2-8: "Absolute Range for Ordinal and Continuous Observations" - creates it if necessary
335      */
336     public RFR getOm28_AbsoluteRangeForOrdinalAndContinuousObservations() { 
337 		RFR retVal = this.getTypedField(8, 0);
338 		return retVal;
339     }
340 
341 
342     /**
343      * Returns all repetitions of Delta Check Criteria (OM2-9).
344      */
345     public DLT[] getDeltaCheckCriteria() {
346     	DLT[] retVal = this.getTypedField(9, new DLT[0]);
347     	return retVal;
348     }
349 
350 
351     /**
352      * Returns all repetitions of Delta Check Criteria (OM2-9).
353      */
354     public DLT[] getOm29_DeltaCheckCriteria() {
355     	DLT[] retVal = this.getTypedField(9, new DLT[0]);
356     	return retVal;
357     }
358 
359 
360     /**
361      * Returns a count of the current number of repetitions of Delta Check Criteria (OM2-9).
362      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
363      * it will return zero.
364      */
365     public int getDeltaCheckCriteriaReps() {
366     	return this.getReps(9);
367     }
368 
369 
370     /**
371      * Returns a specific repetition of
372      * OM2-9: "Delta Check Criteria" - creates it if necessary
373      *
374      * @param rep The repetition index (0-indexed)
375      */
376     public DLT getDeltaCheckCriteria(int rep) { 
377 		DLT retVal = this.getTypedField(9, rep);
378 		return retVal;
379     }
380 
381     /**
382      * Returns a specific repetition of
383      * OM2-9: "Delta Check Criteria" - creates it if necessary
384      *
385      * @param rep The repetition index (0-indexed)
386      */
387     public DLT getOm29_DeltaCheckCriteria(int rep) { 
388 		DLT retVal = this.getTypedField(9, rep);
389 		return retVal;
390     }
391 
392     /**
393      * Returns a count of the current number of repetitions of Delta Check Criteria (OM2-9).
394      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
395      * it will return zero.
396      */
397     public int getOm29_DeltaCheckCriteriaReps() {
398     	return this.getReps(9);
399     }
400 
401 
402     /**
403      * Inserts a repetition of
404      * OM2-9: "Delta Check Criteria" at a specific index
405      *
406      * @param rep The repetition index (0-indexed)
407      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
408      */
409     public DLT insertDeltaCheckCriteria(int rep) throws HL7Exception { 
410         return (DLT) super.insertRepetition(9, rep);
411     }
412 
413 
414     /**
415      * Inserts a repetition of
416      * OM2-9: "Delta Check Criteria" at a specific index
417      *
418      * @param rep The repetition index (0-indexed)
419      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
420      */
421     public DLT insertOm29_DeltaCheckCriteria(int rep) throws HL7Exception { 
422         return (DLT) super.insertRepetition(9, rep);
423     }
424 
425 
426     /**
427      * Removes a repetition of
428      * OM2-9: "Delta Check Criteria" at a specific index
429      *
430      * @param rep The repetition index (0-indexed)
431      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
432      */
433     public DLT removeDeltaCheckCriteria(int rep) throws HL7Exception { 
434         return (DLT) super.removeRepetition(9, rep);
435     }
436 
437 
438     /**
439      * Removes a repetition of
440      * OM2-9: "Delta Check Criteria" at a specific index
441      *
442      * @param rep The repetition index (0-indexed)
443      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
444      */
445     public DLT removeOm29_DeltaCheckCriteria(int rep) throws HL7Exception { 
446         return (DLT) super.removeRepetition(9, rep);
447     }
448 
449 
450 
451 
452     /**
453      * Returns
454      * OM2-10: "Minimum Meaningful Increments" - creates it if necessary
455      */
456     public NM getMinimumMeaningfulIncrements() { 
457 		NM retVal = this.getTypedField(10, 0);
458 		return retVal;
459     }
460     
461     /**
462      * Returns
463      * OM2-10: "Minimum Meaningful Increments" - creates it if necessary
464      */
465     public NM getOm210_MinimumMeaningfulIncrements() { 
466 		NM retVal = this.getTypedField(10, 0);
467 		return retVal;
468     }
469 
470 
471 
472 
473 
474     /** {@inheritDoc} */   
475     protected Type createNewTypeWithoutReflection(int field) {
476        switch (field) {
477           case 0: return new NM(getMessage());
478           case 1: return new CE(getMessage());
479           case 2: return new NM(getMessage());
480           case 3: return new CE(getMessage());
481           case 4: return new TX(getMessage());
482           case 5: return new RFR(getMessage());
483           case 6: return new NR(getMessage());
484           case 7: return new RFR(getMessage());
485           case 8: return new DLT(getMessage());
486           case 9: return new NM(getMessage());
487           default: return null;
488        }
489    }
490 
491 
492 }
493