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 033 034package ca.uhn.hl7v2.model.v251.message; 035 036import ca.uhn.hl7v2.model.v251.group.*; 037import ca.uhn.hl7v2.model.v251.segment.*; 038 039import java.util.List; 040 041import ca.uhn.hl7v2.HL7Exception; 042import ca.uhn.hl7v2.parser.ModelClassFactory; 043import ca.uhn.hl7v2.parser.DefaultModelClassFactory; 044import ca.uhn.hl7v2.model.AbstractMessage; 045 046/** 047 * <p>Represents a RTB_Z74 message structure (see chapter 4.6.2). This structure contains the 048 * following elements: </p> 049 * <ul> 050 * <li>1: MSH (Message Header) <b> </b></li> 051 * <li>2: MSA (Message Acknowledgment) <b> </b></li> 052 * <li>3: ERR (Error) <b>optional repeating</b></li> 053 * <li>4: SFT (Software Segment) <b>optional repeating</b></li> 054 * <li>5: QAK (Query Acknowledgment) <b> </b></li> 055 * <li>6: QPD (Query Parameter Definition) <b> </b></li> 056 * <li>7: RTB_Z74_ROW_DEFINITION (a Group object) <b>optional </b></li> 057 * <li>8: DSC (Continuation Pointer) <b>optional </b></li> 058 * </ul> 059 */ 060@SuppressWarnings("unused") 061public class RTB_Z74 extends AbstractMessage { 062 063 /** 064 * Creates a new RTB_Z74 message with DefaultModelClassFactory. 065 */ 066 public RTB_Z74() { 067 this(new DefaultModelClassFactory()); 068 } 069 070 /** 071 * Creates a new RTB_Z74 message with custom ModelClassFactory. 072 */ 073 public RTB_Z74(ModelClassFactory factory) { 074 super(factory); 075 init(factory); 076 } 077 078 private void init(ModelClassFactory factory) { 079 try { 080 this.add(MSH.class, true, false); 081 this.add(MSA.class, true, false); 082 this.add(ERR.class, false, true); 083 this.add(SFT.class, false, true); 084 this.add(QAK.class, true, false); 085 this.add(QPD.class, true, false); 086 this.add(RTB_Z74_ROW_DEFINITION.class, false, false); 087 this.add(DSC.class, false, false); 088 } catch(HL7Exception e) { 089 log.error("Unexpected error creating RTB_Z74 - this is probably a bug in the source code generator.", e); 090 } 091 } 092 093 /** 094 * Returns "2.5.1" 095 */ 096 public String getVersion() { 097 return "2.5.1"; 098 } 099 100 101 102 /** 103 * Returns 104 * MSH (Message Header) - creates it if necessary 105 */ 106 public MSH getMSH() { 107 return getTyped("MSH", MSH.class); 108 } 109 110 111 112 113 /** 114 * Returns 115 * MSA (Message Acknowledgment) - creates it if necessary 116 */ 117 public MSA getMSA() { 118 return getTyped("MSA", MSA.class); 119 } 120 121 122 123 124 /** 125 * Returns 126 * the first repetition of 127 * ERR (Error) - creates it if necessary 128 */ 129 public ERR getERR() { 130 return getTyped("ERR", ERR.class); 131 } 132 133 134 /** 135 * Returns a specific repetition of 136 * ERR (Error) - creates it if necessary 137 * 138 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 139 * @throws HL7Exception if the repetition requested is more than one 140 * greater than the number of existing repetitions. 141 */ 142 public ERR getERR(int rep) { 143 return getTyped("ERR", rep, ERR.class); 144 } 145 146 /** 147 * Returns the number of existing repetitions of ERR 148 */ 149 public int getERRReps() { 150 return getReps("ERR"); 151 } 152 153 /** 154 * <p> 155 * Returns a non-modifiable List containing all current existing repetitions of ERR. 156 * <p> 157 * <p> 158 * Note that unlike {@link #getERR()}, this method will not create any reps 159 * if none are already present, so an empty list may be returned. 160 * </p> 161 */ 162 public List<ERR> getERRAll() throws HL7Exception { 163 return getAllAsList("ERR", ERR.class); 164 } 165 166 /** 167 * Inserts a specific repetition of ERR (Error) 168 * @see AbstractGroup#insertRepetition(Structure, int) 169 */ 170 public void insertERR(ERR structure, int rep) throws HL7Exception { 171 super.insertRepetition( "ERR", structure, rep); 172 } 173 174 175 /** 176 * Inserts a specific repetition of ERR (Error) 177 * @see AbstractGroup#insertRepetition(Structure, int) 178 */ 179 public ERR insertERR(int rep) throws HL7Exception { 180 return (ERR)super.insertRepetition("ERR", rep); 181 } 182 183 184 /** 185 * Removes a specific repetition of ERR (Error) 186 * @see AbstractGroup#removeRepetition(String, int) 187 */ 188 public ERR removeERR(int rep) throws HL7Exception { 189 return (ERR)super.removeRepetition("ERR", rep); 190 } 191 192 193 194 /** 195 * Returns 196 * the first repetition of 197 * SFT (Software Segment) - creates it if necessary 198 */ 199 public SFT getSFT() { 200 return getTyped("SFT", SFT.class); 201 } 202 203 204 /** 205 * Returns a specific repetition of 206 * SFT (Software Segment) - creates it if necessary 207 * 208 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 209 * @throws HL7Exception if the repetition requested is more than one 210 * greater than the number of existing repetitions. 211 */ 212 public SFT getSFT(int rep) { 213 return getTyped("SFT", rep, SFT.class); 214 } 215 216 /** 217 * Returns the number of existing repetitions of SFT 218 */ 219 public int getSFTReps() { 220 return getReps("SFT"); 221 } 222 223 /** 224 * <p> 225 * Returns a non-modifiable List containing all current existing repetitions of SFT. 226 * <p> 227 * <p> 228 * Note that unlike {@link #getSFT()}, this method will not create any reps 229 * if none are already present, so an empty list may be returned. 230 * </p> 231 */ 232 public List<SFT> getSFTAll() throws HL7Exception { 233 return getAllAsList("SFT", SFT.class); 234 } 235 236 /** 237 * Inserts a specific repetition of SFT (Software Segment) 238 * @see AbstractGroup#insertRepetition(Structure, int) 239 */ 240 public void insertSFT(SFT structure, int rep) throws HL7Exception { 241 super.insertRepetition( "SFT", structure, rep); 242 } 243 244 245 /** 246 * Inserts a specific repetition of SFT (Software Segment) 247 * @see AbstractGroup#insertRepetition(Structure, int) 248 */ 249 public SFT insertSFT(int rep) throws HL7Exception { 250 return (SFT)super.insertRepetition("SFT", rep); 251 } 252 253 254 /** 255 * Removes a specific repetition of SFT (Software Segment) 256 * @see AbstractGroup#removeRepetition(String, int) 257 */ 258 public SFT removeSFT(int rep) throws HL7Exception { 259 return (SFT)super.removeRepetition("SFT", rep); 260 } 261 262 263 264 /** 265 * Returns 266 * QAK (Query Acknowledgment) - creates it if necessary 267 */ 268 public QAK getQAK() { 269 return getTyped("QAK", QAK.class); 270 } 271 272 273 274 275 /** 276 * Returns 277 * QPD (Query Parameter Definition) - creates it if necessary 278 */ 279 public QPD getQPD() { 280 return getTyped("QPD", QPD.class); 281 } 282 283 284 285 286 /** 287 * Returns 288 * ROW_DEFINITION (a Group object) - creates it if necessary 289 */ 290 public RTB_Z74_ROW_DEFINITION getROW_DEFINITION() { 291 return getTyped("ROW_DEFINITION", RTB_Z74_ROW_DEFINITION.class); 292 } 293 294 295 296 297 /** 298 * Returns 299 * DSC (Continuation Pointer) - creates it if necessary 300 */ 301 public DSC getDSC() { 302 return getTyped("DSC", DSC.class); 303 } 304 305 306 307 308} 309