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 033package ca.uhn.hl7v2.model.v231.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 * <p>Represents an HL7 PPN (performing person time stamp) data type. 042 * This type consists of the following components:</p> 043 * <ul> 044 * <li>ID number (ST) (ST) 045 * <li>family+last name (FN) 046 * <li>given name (ST) 047 * <li>middle initial or name (ST) 048 * <li>suffix (e.g., JR or III) (ST) 049 * <li>prefix (e.g., DR) (ST) 050 * <li>degree (e.g., MD) (IS) 051 * <li>source table (IS) 052 * <li>assigning authority (HD) 053 * <li>name type code (ID) 054 * <li>identifier check digit (ST) 055 * <li>code identifying the check digit scheme employed (ID) 056 * <li>identifier type code (IS) 057 * <li>assigning facility (HD) 058 * <li>Date/Time Action Performed (TS) 059 * <li>Name Representation code (ID) 060 * </ul> 061 */ 062@SuppressWarnings("unused") 063public class PPN extends AbstractComposite { 064 065 private Type[] data; 066 067 /** 068 * Creates a new PPN type 069 */ 070 public PPN(Message message) { 071 super(message); 072 init(); 073 } 074 075 private void init() { 076 data = new Type[16]; 077 data[0] = new ST(getMessage()); 078 data[1] = new FN(getMessage()); 079 data[2] = new ST(getMessage()); 080 data[3] = new ST(getMessage()); 081 data[4] = new ST(getMessage()); 082 data[5] = new ST(getMessage()); 083 data[6] = new IS(getMessage(), 0); 084 data[7] = new IS(getMessage(), 0); 085 data[8] = new HD(getMessage()); 086 data[9] = new ID(getMessage(), 0); 087 data[10] = new ST(getMessage()); 088 data[11] = new ID(getMessage(), 0); 089 data[12] = new IS(getMessage(), 0); 090 data[13] = new HD(getMessage()); 091 data[14] = new TS(getMessage()); 092 data[15] = new ID(getMessage(), 0); 093 } 094 095 096 /** 097 * Returns an array containing the data elements. 098 */ 099 public Type[] getComponents() { 100 return this.data; 101 } 102 103 /** 104 * Returns an individual data component. 105 * 106 * @param number The component number (0-indexed) 107 * @throws DataTypeException if the given element number is out of range. 108 */ 109 public Type getComponent(int number) throws DataTypeException { 110 111 try { 112 return this.data[number]; 113 } catch (ArrayIndexOutOfBoundsException e) { 114 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 115 } 116 } 117 118 119 /** 120 * Returns ID number (ST) (component 1). This is a convenience method that saves you from 121 * casting and handling an exception. 122 */ 123 public ST getIDNumber() { 124 return getTyped(0, ST.class); 125 } 126 127 128 /** 129 * Returns ID number (ST) (component 1). This is a convenience method that saves you from 130 * casting and handling an exception. 131 */ 132 public ST getPpn1_IDNumber() { 133 return getTyped(0, ST.class); 134 } 135 136 137 /** 138 * Returns family+last name (component 2). This is a convenience method that saves you from 139 * casting and handling an exception. 140 */ 141 public FN getFamilyLastName() { 142 return getTyped(1, FN.class); 143 } 144 145 146 /** 147 * Returns family+last name (component 2). This is a convenience method that saves you from 148 * casting and handling an exception. 149 */ 150 public FN getPpn2_FamilyLastName() { 151 return getTyped(1, FN.class); 152 } 153 154 155 /** 156 * Returns given name (component 3). This is a convenience method that saves you from 157 * casting and handling an exception. 158 */ 159 public ST getGivenName() { 160 return getTyped(2, ST.class); 161 } 162 163 164 /** 165 * Returns given name (component 3). This is a convenience method that saves you from 166 * casting and handling an exception. 167 */ 168 public ST getPpn3_GivenName() { 169 return getTyped(2, ST.class); 170 } 171 172 173 /** 174 * Returns middle initial or name (component 4). This is a convenience method that saves you from 175 * casting and handling an exception. 176 */ 177 public ST getMiddleInitialOrName() { 178 return getTyped(3, ST.class); 179 } 180 181 182 /** 183 * Returns middle initial or name (component 4). This is a convenience method that saves you from 184 * casting and handling an exception. 185 */ 186 public ST getPpn4_MiddleInitialOrName() { 187 return getTyped(3, ST.class); 188 } 189 190 191 /** 192 * Returns suffix (e.g., JR or III) (component 5). This is a convenience method that saves you from 193 * casting and handling an exception. 194 */ 195 public ST getSuffixEgJRorIII() { 196 return getTyped(4, ST.class); 197 } 198 199 200 /** 201 * Returns suffix (e.g., JR or III) (component 5). This is a convenience method that saves you from 202 * casting and handling an exception. 203 */ 204 public ST getPpn5_SuffixEgJRorIII() { 205 return getTyped(4, ST.class); 206 } 207 208 209 /** 210 * Returns prefix (e.g., DR) (component 6). This is a convenience method that saves you from 211 * casting and handling an exception. 212 */ 213 public ST getPrefixEgDR() { 214 return getTyped(5, ST.class); 215 } 216 217 218 /** 219 * Returns prefix (e.g., DR) (component 6). This is a convenience method that saves you from 220 * casting and handling an exception. 221 */ 222 public ST getPpn6_PrefixEgDR() { 223 return getTyped(5, ST.class); 224 } 225 226 227 /** 228 * Returns degree (e.g., MD) (component 7). This is a convenience method that saves you from 229 * casting and handling an exception. 230 */ 231 public IS getDegreeEgMD() { 232 return getTyped(6, IS.class); 233 } 234 235 236 /** 237 * Returns degree (e.g., MD) (component 7). This is a convenience method that saves you from 238 * casting and handling an exception. 239 */ 240 public IS getPpn7_DegreeEgMD() { 241 return getTyped(6, IS.class); 242 } 243 244 245 /** 246 * Returns source table (component 8). This is a convenience method that saves you from 247 * casting and handling an exception. 248 */ 249 public IS getSourceTable() { 250 return getTyped(7, IS.class); 251 } 252 253 254 /** 255 * Returns source table (component 8). This is a convenience method that saves you from 256 * casting and handling an exception. 257 */ 258 public IS getPpn8_SourceTable() { 259 return getTyped(7, IS.class); 260 } 261 262 263 /** 264 * Returns assigning authority (component 9). This is a convenience method that saves you from 265 * casting and handling an exception. 266 */ 267 public HD getAssigningAuthority() { 268 return getTyped(8, HD.class); 269 } 270 271 272 /** 273 * Returns assigning authority (component 9). This is a convenience method that saves you from 274 * casting and handling an exception. 275 */ 276 public HD getPpn9_AssigningAuthority() { 277 return getTyped(8, HD.class); 278 } 279 280 281 /** 282 * Returns name type code (component 10). This is a convenience method that saves you from 283 * casting and handling an exception. 284 */ 285 public ID getNameTypeCode() { 286 return getTyped(9, ID.class); 287 } 288 289 290 /** 291 * Returns name type code (component 10). This is a convenience method that saves you from 292 * casting and handling an exception. 293 */ 294 public ID getPpn10_NameTypeCode() { 295 return getTyped(9, ID.class); 296 } 297 298 299 /** 300 * Returns identifier check digit (component 11). This is a convenience method that saves you from 301 * casting and handling an exception. 302 */ 303 public ST getIdentifierCheckDigit() { 304 return getTyped(10, ST.class); 305 } 306 307 308 /** 309 * Returns identifier check digit (component 11). This is a convenience method that saves you from 310 * casting and handling an exception. 311 */ 312 public ST getPpn11_IdentifierCheckDigit() { 313 return getTyped(10, ST.class); 314 } 315 316 317 /** 318 * Returns code identifying the check digit scheme employed (component 12). This is a convenience method that saves you from 319 * casting and handling an exception. 320 */ 321 public ID getCodeIdentifyingTheCheckDigitSchemeEmployed() { 322 return getTyped(11, ID.class); 323 } 324 325 326 /** 327 * Returns code identifying the check digit scheme employed (component 12). This is a convenience method that saves you from 328 * casting and handling an exception. 329 */ 330 public ID getPpn12_CodeIdentifyingTheCheckDigitSchemeEmployed() { 331 return getTyped(11, ID.class); 332 } 333 334 335 /** 336 * Returns identifier type code (component 13). This is a convenience method that saves you from 337 * casting and handling an exception. 338 */ 339 public IS getIdentifierTypeCode() { 340 return getTyped(12, IS.class); 341 } 342 343 344 /** 345 * Returns identifier type code (component 13). This is a convenience method that saves you from 346 * casting and handling an exception. 347 */ 348 public IS getPpn13_IdentifierTypeCode() { 349 return getTyped(12, IS.class); 350 } 351 352 353 /** 354 * Returns assigning facility (component 14). This is a convenience method that saves you from 355 * casting and handling an exception. 356 */ 357 public HD getAssigningFacility() { 358 return getTyped(13, HD.class); 359 } 360 361 362 /** 363 * Returns assigning facility (component 14). This is a convenience method that saves you from 364 * casting and handling an exception. 365 */ 366 public HD getPpn14_AssigningFacility() { 367 return getTyped(13, HD.class); 368 } 369 370 371 /** 372 * Returns Date/Time Action Performed (component 15). This is a convenience method that saves you from 373 * casting and handling an exception. 374 */ 375 public TS getDateTimeActionPerformed() { 376 return getTyped(14, TS.class); 377 } 378 379 380 /** 381 * Returns Date/Time Action Performed (component 15). This is a convenience method that saves you from 382 * casting and handling an exception. 383 */ 384 public TS getPpn15_DateTimeActionPerformed() { 385 return getTyped(14, TS.class); 386 } 387 388 389 /** 390 * Returns Name Representation code (component 16). This is a convenience method that saves you from 391 * casting and handling an exception. 392 */ 393 public ID getNameRepresentationCode() { 394 return getTyped(15, ID.class); 395 } 396 397 398 /** 399 * Returns Name Representation code (component 16). This is a convenience method that saves you from 400 * casting and handling an exception. 401 */ 402 public ID getPpn16_NameRepresentationCode() { 403 return getTyped(15, ID.class); 404 } 405 406 407 408} 409