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