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