1 /* 2 * This class is an auto-generated source file for a HAPI 3 * HL7 v2.x standard structure class. 4 * 5 * For more information, visit: http://hl7api.sourceforge.net/ 6 * 7 * The contents of this file are subject to the Mozilla Public License Version 1.1 8 * (the "License"); you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 10 * Software distributed under the License is distributed on an "AS IS" basis, 11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 12 * specific language governing rights and limitations under the License. 13 * 14 * The Original Code is "[file_name]". Description: 15 * "[one_line_description]" 16 * 17 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 18 * 2012. All Rights Reserved. 19 * 20 * Contributor(s): ______________________________________. 21 * 22 * Alternatively, the contents of this file may be used under the terms of the 23 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are 24 * applicable instead of those above. If you wish to allow use of your version of this 25 * file only under the terms of the GPL and not to allow others to use your version 26 * of this file under the MPL, indicate your decision by deleting the provisions above 27 * and replace them with the notice and other provisions required by the GPL License. 28 * If you do not delete the provisions above, a recipient may use your version of 29 * this file under either the MPL or the GPL. 30 * 31 */ 32 33 34 package ca.uhn.hl7v2.model.v27.group; 35 36 import ca.uhn.hl7v2.model.v27.segment.*; 37 38 import ca.uhn.hl7v2.HL7Exception; 39 import ca.uhn.hl7v2.parser.ModelClassFactory; 40 import ca.uhn.hl7v2.model.*; 41 42 /** 43 * <p>Represents a CCI_I22_CLINICAL_HISTORY_DETAIL group structure (a Group object). 44 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together. 45 * This Group contains the following elements: 46 * </p> 47 * <ul> 48 * <li>1: OBR (Observation Request) <b> choice</b></li> 49 * <li>2: ODS (Dietary Orders, Supplements, and Preferences) <b> choice</b></li> 50 * <li>3: PR1 (Procedures) <b> choice</b></li> 51 * <li>4: RF1 (Referral Information) <b> choice</b></li> 52 * <li>5: AL1 (Patient Allergy Information) <b> choice</b></li> 53 * <li>6: IAM (Patient Adverse Reaction Information) <b> choice</b></li> 54 * <li>7: ACC (Accident) <b> choice</b></li> 55 * <li>8: RMI (Risk Management Incident) <b> choice</b></li> 56 * <li>9: DB1 (Disability) <b> choice</b></li> 57 * <li>10: DG1 (Diagnosis) <b> choice</b></li> 58 * <li>11: DRG (Diagnosis Related Group) <b> choice</b></li> 59 * <li>12: PDA (Patient Death and Autopsy) <b> choice</b></li> 60 * <li>13: OBX (Observation/Result) <b>optional repeating </b></li> 61 * </ul> 62 * <p> 63 * Note that this structure has "choice" elements. This means that one of the 64 * structures above marked as "choice" must be present, but no more than one. 65 * </p> 66 */ 67 //@SuppressWarnings("unused") 68 public class CCI_I22_CLINICAL_HISTORY_DETAIL extends AbstractGroup { 69 70 /** 71 * Creates a new CCI_I22_CLINICAL_HISTORY_DETAIL group 72 */ 73 public CCI_I22_CLINICAL_HISTORY_DETAIL(Group parent, ModelClassFactory factory) { 74 super(parent, factory); 75 init(factory); 76 } 77 78 private void init(ModelClassFactory factory) { 79 try { 80 this.add(OBR.class, true, false, true); 81 this.add(ODS.class, true, false, true); 82 this.add(PR1.class, true, false, true); 83 this.add(RF1.class, true, false, true); 84 this.add(AL1.class, true, false, true); 85 this.add(IAM.class, true, false, true); 86 this.add(ACC.class, true, false, true); 87 this.add(RMI.class, true, false, true); 88 this.add(DB1.class, true, false, true); 89 this.add(DG1.class, true, false, true); 90 this.add(DRG.class, true, false, true); 91 this.add(PDA.class, true, false, true); 92 this.add(OBX.class, false, true, false); 93 } catch(HL7Exception e) { 94 log.error("Unexpected error creating CCI_I22_CLINICAL_HISTORY_DETAIL - this is probably a bug in the source code generator.", e); 95 } 96 } 97 98 /** 99 * Returns "2.7" 100 */ 101 public String getVersion() { 102 return "2.7"; 103 } 104 105 106 107 /** 108 * Returns 109 * OBR (Observation Request) - creates it if necessary 110 */ 111 public OBR getOBR() { 112 OBR retVal = getTyped("OBR", OBR.class); 113 return retVal; 114 } 115 116 117 118 119 /** 120 * Returns 121 * ODS (Dietary Orders, Supplements, and Preferences) - creates it if necessary 122 */ 123 public ODS getODS() { 124 ODS retVal = getTyped("ODS", ODS.class); 125 return retVal; 126 } 127 128 129 130 131 /** 132 * Returns 133 * PR1 (Procedures) - creates it if necessary 134 */ 135 public PR1 getPR1() { 136 PR1 retVal = getTyped("PR1", PR1.class); 137 return retVal; 138 } 139 140 141 142 143 /** 144 * Returns 145 * RF1 (Referral Information) - creates it if necessary 146 */ 147 public RF1 getRF1() { 148 RF1 retVal = getTyped("RF1", RF1.class); 149 return retVal; 150 } 151 152 153 154 155 /** 156 * Returns 157 * AL1 (Patient Allergy Information) - creates it if necessary 158 */ 159 public AL1 getAL1() { 160 AL1 retVal = getTyped("AL1", AL1.class); 161 return retVal; 162 } 163 164 165 166 167 /** 168 * Returns 169 * IAM (Patient Adverse Reaction Information) - creates it if necessary 170 */ 171 public IAM getIAM() { 172 IAM retVal = getTyped("IAM", IAM.class); 173 return retVal; 174 } 175 176 177 178 179 /** 180 * Returns 181 * ACC (Accident) - creates it if necessary 182 */ 183 public ACC getACC() { 184 ACC retVal = getTyped("ACC", ACC.class); 185 return retVal; 186 } 187 188 189 190 191 /** 192 * Returns 193 * RMI (Risk Management Incident) - creates it if necessary 194 */ 195 public RMI getRMI() { 196 RMI retVal = getTyped("RMI", RMI.class); 197 return retVal; 198 } 199 200 201 202 203 /** 204 * Returns 205 * DB1 (Disability) - creates it if necessary 206 */ 207 public DB1 getDB1() { 208 DB1 retVal = getTyped("DB1", DB1.class); 209 return retVal; 210 } 211 212 213 214 215 /** 216 * Returns 217 * DG1 (Diagnosis) - creates it if necessary 218 */ 219 public DG1 getDG1() { 220 DG1 retVal = getTyped("DG1", DG1.class); 221 return retVal; 222 } 223 224 225 226 227 /** 228 * Returns 229 * DRG (Diagnosis Related Group) - creates it if necessary 230 */ 231 public DRG getDRG() { 232 DRG retVal = getTyped("DRG", DRG.class); 233 return retVal; 234 } 235 236 237 238 239 /** 240 * Returns 241 * PDA (Patient Death and Autopsy) - creates it if necessary 242 */ 243 public PDA getPDA() { 244 PDA retVal = getTyped("PDA", PDA.class); 245 return retVal; 246 } 247 248 249 250 251 /** 252 * Returns 253 * the first repetition of 254 * OBX (Observation/Result) - creates it if necessary 255 */ 256 public OBX getOBX() { 257 OBX retVal = getTyped("OBX", OBX.class); 258 return retVal; 259 } 260 261 262 /** 263 * Returns a specific repetition of 264 * OBX (Observation/Result) - creates it if necessary 265 * 266 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 267 * @throws HL7Exception if the repetition requested is more than one 268 * greater than the number of existing repetitions. 269 */ 270 public OBX getOBX(int rep) { 271 OBX retVal = getTyped("OBX", rep, OBX.class); 272 return retVal; 273 } 274 275 /** 276 * Returns the number of existing repetitions of OBX 277 */ 278 public int getOBXReps() { 279 return getReps("OBX"); 280 } 281 282 /** 283 * <p> 284 * Returns a non-modifiable List containing all current existing repetitions of OBX. 285 * <p> 286 * <p> 287 * Note that unlike {@link #getOBX()}, this method will not create any reps 288 * if none are already present, so an empty list may be returned. 289 * </p> 290 */ 291 public java.util.List<OBX> getOBXAll() throws HL7Exception { 292 return getAllAsList("OBX", OBX.class); 293 } 294 295 /** 296 * Inserts a specific repetition of OBX (Observation/Result) 297 * @see AbstractGroup#insertRepetition(Structure, int) 298 */ 299 public void insertOBX(OBX structure, int rep) throws HL7Exception { 300 super.insertRepetition("OBX", structure, rep); 301 } 302 303 304 /** 305 * Inserts a specific repetition of OBX (Observation/Result) 306 * @see AbstractGroup#insertRepetition(Structure, int) 307 */ 308 public OBX insertOBX(int rep) throws HL7Exception { 309 return (OBX)super.insertRepetition("OBX", rep); 310 } 311 312 313 /** 314 * Removes a specific repetition of OBX (Observation/Result) 315 * @see AbstractGroup#removeRepetition(String, int) 316 */ 317 public OBX removeOBX(int rep) throws HL7Exception { 318 return (OBX)super.removeRepetition("OBX", rep); 319 } 320 321 322 323 } 324