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.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 * <p>Represents an HL7 XON (Extended Composite Name and ID for organizations (2.8.47)) 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) (NM) 047 * <li>check digit (ST) 048 * <li>code identifying the check digit scheme employed (ID) 049 * <li>assigning authority (HD) 050 * <li>identifier type code (IS) 051 * <li>assigning facility ID (HD) 052 * </ul> 053 */ 054@SuppressWarnings("unused") 055public class XON extends AbstractComposite { 056 057 private Type[] data; 058 059 /** 060 * Creates a new XON type 061 */ 062 public XON(Message message) { 063 super(message); 064 init(); 065 } 066 067 private void init() { 068 data = new Type[8]; 069 data[0] = new ST(getMessage()); 070 data[1] = new IS(getMessage(), 0); 071 data[2] = new NM(getMessage()); 072 data[3] = new ST(getMessage()); 073 data[4] = new ID(getMessage(), 0); 074 data[5] = new HD(getMessage()); 075 data[6] = new IS(getMessage(), 0); 076 data[7] = new HD(getMessage()); 077 } 078 079 080 /** 081 * Returns an array containing the data elements. 082 */ 083 public Type[] getComponents() { 084 return this.data; 085 } 086 087 /** 088 * Returns an individual data component. 089 * 090 * @param number The component number (0-indexed) 091 * @throws DataTypeException if the given element number is out of range. 092 */ 093 public Type getComponent(int number) throws DataTypeException { 094 095 try { 096 return this.data[number]; 097 } catch (ArrayIndexOutOfBoundsException e) { 098 throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); 099 } 100 } 101 102 103 /** 104 * Returns organization name (component 1). This is a convenience method that saves you from 105 * casting and handling an exception. 106 */ 107 public ST getOrganizationName() { 108 return getTyped(0, ST.class); 109 } 110 111 112 /** 113 * Returns organization name (component 1). This is a convenience method that saves you from 114 * casting and handling an exception. 115 */ 116 public ST getXon1_OrganizationName() { 117 return getTyped(0, ST.class); 118 } 119 120 121 /** 122 * Returns organization name type code (component 2). This is a convenience method that saves you from 123 * casting and handling an exception. 124 */ 125 public IS getOrganizationNameTypeCode() { 126 return getTyped(1, IS.class); 127 } 128 129 130 /** 131 * Returns organization name type code (component 2). This is a convenience method that saves you from 132 * casting and handling an exception. 133 */ 134 public IS getXon2_OrganizationNameTypeCode() { 135 return getTyped(1, IS.class); 136 } 137 138 139 /** 140 * Returns ID number (NM) (component 3). This is a convenience method that saves you from 141 * casting and handling an exception. 142 */ 143 public NM getIDNumber() { 144 return getTyped(2, NM.class); 145 } 146 147 148 /** 149 * Returns ID number (NM) (component 3). This is a convenience method that saves you from 150 * casting and handling an exception. 151 */ 152 public NM getXon3_IDNumber() { 153 return getTyped(2, NM.class); 154 } 155 156 157 /** 158 * Returns check digit (component 4). This is a convenience method that saves you from 159 * casting and handling an exception. 160 */ 161 public ST getCheckDigit() { 162 return getTyped(3, ST.class); 163 } 164 165 166 /** 167 * Returns check digit (component 4). This is a convenience method that saves you from 168 * casting and handling an exception. 169 */ 170 public ST getXon4_CheckDigit() { 171 return getTyped(3, ST.class); 172 } 173 174 175 /** 176 * Returns code identifying the check digit scheme employed (component 5). This is a convenience method that saves you from 177 * casting and handling an exception. 178 */ 179 public ID getCodeIdentifyingTheCheckDigitSchemeEmployed() { 180 return getTyped(4, ID.class); 181 } 182 183 184 /** 185 * Returns code identifying the check digit scheme employed (component 5). This is a convenience method that saves you from 186 * casting and handling an exception. 187 */ 188 public ID getXon5_CodeIdentifyingTheCheckDigitSchemeEmployed() { 189 return getTyped(4, ID.class); 190 } 191 192 193 /** 194 * Returns assigning authority (component 6). This is a convenience method that saves you from 195 * casting and handling an exception. 196 */ 197 public HD getAssigningAuthority() { 198 return getTyped(5, HD.class); 199 } 200 201 202 /** 203 * Returns assigning authority (component 6). This is a convenience method that saves you from 204 * casting and handling an exception. 205 */ 206 public HD getXon6_AssigningAuthority() { 207 return getTyped(5, HD.class); 208 } 209 210 211 /** 212 * Returns identifier type code (component 7). This is a convenience method that saves you from 213 * casting and handling an exception. 214 */ 215 public IS getIdentifierTypeCode() { 216 return getTyped(6, IS.class); 217 } 218 219 220 /** 221 * Returns identifier type code (component 7). This is a convenience method that saves you from 222 * casting and handling an exception. 223 */ 224 public IS getXon7_IdentifierTypeCode() { 225 return getTyped(6, IS.class); 226 } 227 228 229 /** 230 * Returns assigning facility ID (component 8). This is a convenience method that saves you from 231 * casting and handling an exception. 232 */ 233 public HD getAssigningFacilityID() { 234 return getTyped(7, HD.class); 235 } 236 237 238 /** 239 * Returns assigning facility ID (component 8). This is a convenience method that saves you from 240 * casting and handling an exception. 241 */ 242 public HD getXon8_AssigningFacilityID() { 243 return getTyped(7, HD.class); 244 } 245 246 247 248} 249