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 "RPT.java". Description: 015 * "Composite class RPT" 016 * 017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 018 * 2013. 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 033package ca.uhn.hl7v2.model.v27.datatype; 034 035import ca.uhn.hl7v2.model.DataTypeException; 036import ca.uhn.hl7v2.model.Message; 037import ca.uhn.hl7v2.model.Type; 038import ca.uhn.hl7v2.model.AbstractComposite; 039 040 041/** 042 * <p>Represents an HL7 RPT (Repeat Pattern) data type. 043 * This type consists of the following components:</p> 044 * <ul> 045 * <li>Repeat Pattern Code (CWE) 046 * <li>Calendar Alignment (ID) 047 * <li>Phase Range Begin Value (NM) 048 * <li>Phase Range End Value (NM) 049 * <li>Period Quantity (NM) 050 * <li>Period Units (CWE) 051 * <li>Institution Specified Time (ID) 052 * <li>Event (ID) 053 * <li>Event Offset Quantity (NM) 054 * <li>Event Offset Units (CWE) 055 * <li>General Timing Specification (GTS) 056 * </ul> 057 */ 058@SuppressWarnings("unused") 059public class RPT extends AbstractComposite { 060 061 private Type[] data; 062 063 /** 064 * Creates a new RPT type 065 */ 066 public RPT(Message message) { 067 super(message); 068 init(); 069 } 070 071 private void init() { 072 data = new Type[11]; 073 data[0] = new CWE(getMessage()); 074 data[1] = new ID(getMessage(), 527); 075 data[2] = new NM(getMessage()); 076 data[3] = new NM(getMessage()); 077 data[4] = new NM(getMessage()); 078 data[5] = new CWE(getMessage()); 079 data[6] = new ID(getMessage(), 136); 080 data[7] = new ID(getMessage(), 528); 081 data[8] = new NM(getMessage()); 082 data[9] = new CWE(getMessage()); 083 data[10] = new GTS(getMessage()); 084 } 085 086 087 /** 088 * Returns an array containing the data elements. 089 */ 090 public Type[] getComponents() { 091 return this.data; 092 } 093 094 /** 095 * Returns an individual data component. 096 * 097 * @param number The component number (0-indexed) 098 * @throws DataTypeException if the given element number is out of range. 099 */ 100 public Type getComponent(int number) throws DataTypeException { 101 102 try { 103 return this.data[number]; 104 } catch (ArrayIndexOutOfBoundsException e) { 105 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 106 } 107 } 108 109 110 /** 111 * Returns Repeat Pattern Code (component 1). This is a convenience method that saves you from 112 * casting and handling an exception. 113 */ 114 public CWE getRepeatPatternCode() { 115 return getTyped(0, CWE.class); 116 } 117 118 119 /** 120 * Returns Repeat Pattern Code (component 1). This is a convenience method that saves you from 121 * casting and handling an exception. 122 */ 123 public CWE getRpt1_RepeatPatternCode() { 124 return getTyped(0, CWE.class); 125 } 126 127 128 /** 129 * Returns Calendar Alignment (component 2). This is a convenience method that saves you from 130 * casting and handling an exception. 131 */ 132 public ID getCalendarAlignment() { 133 return getTyped(1, ID.class); 134 } 135 136 137 /** 138 * Returns Calendar Alignment (component 2). This is a convenience method that saves you from 139 * casting and handling an exception. 140 */ 141 public ID getRpt2_CalendarAlignment() { 142 return getTyped(1, ID.class); 143 } 144 145 146 /** 147 * Returns Phase Range Begin Value (component 3). This is a convenience method that saves you from 148 * casting and handling an exception. 149 */ 150 public NM getPhaseRangeBeginValue() { 151 return getTyped(2, NM.class); 152 } 153 154 155 /** 156 * Returns Phase Range Begin Value (component 3). This is a convenience method that saves you from 157 * casting and handling an exception. 158 */ 159 public NM getRpt3_PhaseRangeBeginValue() { 160 return getTyped(2, NM.class); 161 } 162 163 164 /** 165 * Returns Phase Range End Value (component 4). This is a convenience method that saves you from 166 * casting and handling an exception. 167 */ 168 public NM getPhaseRangeEndValue() { 169 return getTyped(3, NM.class); 170 } 171 172 173 /** 174 * Returns Phase Range End Value (component 4). This is a convenience method that saves you from 175 * casting and handling an exception. 176 */ 177 public NM getRpt4_PhaseRangeEndValue() { 178 return getTyped(3, NM.class); 179 } 180 181 182 /** 183 * Returns Period Quantity (component 5). This is a convenience method that saves you from 184 * casting and handling an exception. 185 */ 186 public NM getPeriodQuantity() { 187 return getTyped(4, NM.class); 188 } 189 190 191 /** 192 * Returns Period Quantity (component 5). This is a convenience method that saves you from 193 * casting and handling an exception. 194 */ 195 public NM getRpt5_PeriodQuantity() { 196 return getTyped(4, NM.class); 197 } 198 199 200 /** 201 * Returns Period Units (component 6). This is a convenience method that saves you from 202 * casting and handling an exception. 203 */ 204 public CWE getPeriodUnits() { 205 return getTyped(5, CWE.class); 206 } 207 208 209 /** 210 * Returns Period Units (component 6). This is a convenience method that saves you from 211 * casting and handling an exception. 212 */ 213 public CWE getRpt6_PeriodUnits() { 214 return getTyped(5, CWE.class); 215 } 216 217 218 /** 219 * Returns Institution Specified Time (component 7). This is a convenience method that saves you from 220 * casting and handling an exception. 221 */ 222 public ID getInstitutionSpecifiedTime() { 223 return getTyped(6, ID.class); 224 } 225 226 227 /** 228 * Returns Institution Specified Time (component 7). This is a convenience method that saves you from 229 * casting and handling an exception. 230 */ 231 public ID getRpt7_InstitutionSpecifiedTime() { 232 return getTyped(6, ID.class); 233 } 234 235 236 /** 237 * Returns Event (component 8). This is a convenience method that saves you from 238 * casting and handling an exception. 239 */ 240 public ID getEvent() { 241 return getTyped(7, ID.class); 242 } 243 244 245 /** 246 * Returns Event (component 8). This is a convenience method that saves you from 247 * casting and handling an exception. 248 */ 249 public ID getRpt8_Event() { 250 return getTyped(7, ID.class); 251 } 252 253 254 /** 255 * Returns Event Offset Quantity (component 9). This is a convenience method that saves you from 256 * casting and handling an exception. 257 */ 258 public NM getEventOffsetQuantity() { 259 return getTyped(8, NM.class); 260 } 261 262 263 /** 264 * Returns Event Offset Quantity (component 9). This is a convenience method that saves you from 265 * casting and handling an exception. 266 */ 267 public NM getRpt9_EventOffsetQuantity() { 268 return getTyped(8, NM.class); 269 } 270 271 272 /** 273 * Returns Event Offset Units (component 10). This is a convenience method that saves you from 274 * casting and handling an exception. 275 */ 276 public CWE getEventOffsetUnits() { 277 return getTyped(9, CWE.class); 278 } 279 280 281 /** 282 * Returns Event Offset Units (component 10). This is a convenience method that saves you from 283 * casting and handling an exception. 284 */ 285 public CWE getRpt10_EventOffsetUnits() { 286 return getTyped(9, CWE.class); 287 } 288 289 290 /** 291 * Returns General Timing Specification (component 11). This is a convenience method that saves you from 292 * casting and handling an exception. 293 */ 294 public GTS getGeneralTimingSpecification() { 295 return getTyped(10, GTS.class); 296 } 297 298 299 /** 300 * Returns General Timing Specification (component 11). This is a convenience method that saves you from 301 * casting and handling an exception. 302 */ 303 public GTS getRpt11_GeneralTimingSpecification() { 304 return getTyped(10, GTS.class); 305 } 306 307 308 309} 310