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.v251.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 XON (Extended Composite Name and Identification Number for Organizations) data type. 042 * This type consists of the following components:</p> 043 * <ul> 044 * <li>Organization Name (ST) 045 * <li>Organization Name Type Code (IS) 046 * <li>ID Number (NM) 047 * <li>Check Digit (NM) 048 * <li>Check Digit Scheme (ID) 049 * <li>Assigning Authority (HD) 050 * <li>Identifier Type Code (ID) 051 * <li>Assigning Facility (HD) 052 * <li>Name Representation Code (ID) 053 * <li>Organization Identifier (ST) 054 * </ul> 055 */ 056@SuppressWarnings("unused") 057public class XON extends AbstractComposite { 058 059 private Type[] data; 060 061 /** 062 * Creates a new XON type 063 */ 064 public XON(Message message) { 065 super(message); 066 init(); 067 } 068 069 private void init() { 070 data = new Type[10]; 071 data[0] = new ST(getMessage()); 072 data[1] = new IS(getMessage(), 204); 073 data[2] = new NM(getMessage()); 074 data[3] = new NM(getMessage()); 075 data[4] = new ID(getMessage(), 61); 076 data[5] = new HD(getMessage()); 077 data[6] = new ID(getMessage(), 203); 078 data[7] = new HD(getMessage()); 079 data[8] = new ID(getMessage(), 465); 080 data[9] = new ST(getMessage()); 081 } 082 083 084 /** 085 * Returns an array containing the data elements. 086 */ 087 public Type[] getComponents() { 088 return this.data; 089 } 090 091 /** 092 * Returns an individual data component. 093 * 094 * @param number The component number (0-indexed) 095 * @throws DataTypeException if the given element number is out of range. 096 */ 097 public Type getComponent(int number) throws DataTypeException { 098 099 try { 100 return this.data[number]; 101 } catch (ArrayIndexOutOfBoundsException e) { 102 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 103 } 104 } 105 106 107 /** 108 * Returns Organization Name (component 1). This is a convenience method that saves you from 109 * casting and handling an exception. 110 */ 111 public ST getOrganizationName() { 112 return getTyped(0, ST.class); 113 } 114 115 116 /** 117 * Returns Organization Name (component 1). This is a convenience method that saves you from 118 * casting and handling an exception. 119 */ 120 public ST getXon1_OrganizationName() { 121 return getTyped(0, ST.class); 122 } 123 124 125 /** 126 * Returns Organization Name Type Code (component 2). This is a convenience method that saves you from 127 * casting and handling an exception. 128 */ 129 public IS getOrganizationNameTypeCode() { 130 return getTyped(1, IS.class); 131 } 132 133 134 /** 135 * Returns Organization Name Type Code (component 2). This is a convenience method that saves you from 136 * casting and handling an exception. 137 */ 138 public IS getXon2_OrganizationNameTypeCode() { 139 return getTyped(1, IS.class); 140 } 141 142 143 /** 144 * Returns ID Number (component 3). This is a convenience method that saves you from 145 * casting and handling an exception. 146 */ 147 public NM getIDNumber() { 148 return getTyped(2, NM.class); 149 } 150 151 152 /** 153 * Returns ID Number (component 3). This is a convenience method that saves you from 154 * casting and handling an exception. 155 */ 156 public NM getXon3_IDNumber() { 157 return getTyped(2, NM.class); 158 } 159 160 161 /** 162 * Returns Check Digit (component 4). This is a convenience method that saves you from 163 * casting and handling an exception. 164 */ 165 public NM getCheckDigit() { 166 return getTyped(3, NM.class); 167 } 168 169 170 /** 171 * Returns Check Digit (component 4). This is a convenience method that saves you from 172 * casting and handling an exception. 173 */ 174 public NM getXon4_CheckDigit() { 175 return getTyped(3, NM.class); 176 } 177 178 179 /** 180 * Returns Check Digit Scheme (component 5). This is a convenience method that saves you from 181 * casting and handling an exception. 182 */ 183 public ID getCheckDigitScheme() { 184 return getTyped(4, ID.class); 185 } 186 187 188 /** 189 * Returns Check Digit Scheme (component 5). This is a convenience method that saves you from 190 * casting and handling an exception. 191 */ 192 public ID getXon5_CheckDigitScheme() { 193 return getTyped(4, ID.class); 194 } 195 196 197 /** 198 * Returns Assigning Authority (component 6). This is a convenience method that saves you from 199 * casting and handling an exception. 200 */ 201 public HD getAssigningAuthority() { 202 return getTyped(5, HD.class); 203 } 204 205 206 /** 207 * Returns Assigning Authority (component 6). This is a convenience method that saves you from 208 * casting and handling an exception. 209 */ 210 public HD getXon6_AssigningAuthority() { 211 return getTyped(5, HD.class); 212 } 213 214 215 /** 216 * Returns Identifier Type Code (component 7). This is a convenience method that saves you from 217 * casting and handling an exception. 218 */ 219 public ID getIdentifierTypeCode() { 220 return getTyped(6, ID.class); 221 } 222 223 224 /** 225 * Returns Identifier Type Code (component 7). This is a convenience method that saves you from 226 * casting and handling an exception. 227 */ 228 public ID getXon7_IdentifierTypeCode() { 229 return getTyped(6, ID.class); 230 } 231 232 233 /** 234 * Returns Assigning Facility (component 8). This is a convenience method that saves you from 235 * casting and handling an exception. 236 */ 237 public HD getAssigningFacility() { 238 return getTyped(7, HD.class); 239 } 240 241 242 /** 243 * Returns Assigning Facility (component 8). This is a convenience method that saves you from 244 * casting and handling an exception. 245 */ 246 public HD getXon8_AssigningFacility() { 247 return getTyped(7, HD.class); 248 } 249 250 251 /** 252 * Returns Name Representation Code (component 9). This is a convenience method that saves you from 253 * casting and handling an exception. 254 */ 255 public ID getNameRepresentationCode() { 256 return getTyped(8, ID.class); 257 } 258 259 260 /** 261 * Returns Name Representation Code (component 9). This is a convenience method that saves you from 262 * casting and handling an exception. 263 */ 264 public ID getXon9_NameRepresentationCode() { 265 return getTyped(8, ID.class); 266 } 267 268 269 /** 270 * Returns Organization Identifier (component 10). This is a convenience method that saves you from 271 * casting and handling an exception. 272 */ 273 public ST getOrganizationIdentifier() { 274 return getTyped(9, ST.class); 275 } 276 277 278 /** 279 * Returns Organization Identifier (component 10). This is a convenience method that saves you from 280 * casting and handling an exception. 281 */ 282 public ST getXon10_OrganizationIdentifier() { 283 return getTyped(9, ST.class); 284 } 285 286 287 288} 289