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.v26.group; 035 036import ca.uhn.hl7v2.model.v26.segment.*; 037 038import java.util.List; 039 040import ca.uhn.hl7v2.HL7Exception; 041import ca.uhn.hl7v2.parser.ModelClassFactory; 042import ca.uhn.hl7v2.model.*; 043 044/** 045 * <p>Represents a SIU_S12_PATIENT group structure (a Group object). 046 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together. 047 * This Group contains the following elements: 048 * </p> 049 * <ul> 050 * <li>1: PID (Patient Identification) <b> </b></li> 051 * <li>2: PD1 (Patient Additional Demographic) <b>optional </b></li> 052 * <li>3: PV1 (Patient Visit) <b>optional </b></li> 053 * <li>4: PV2 (Patient Visit - Additional Information) <b>optional </b></li> 054 * <li>5: OBX (Observation/Result) <b>optional repeating</b></li> 055 * <li>6: DG1 (Diagnosis) <b>optional repeating</b></li> 056 * </ul> 057 */ 058@SuppressWarnings("unused") 059public class SIU_S12_PATIENT extends AbstractGroup { 060 061 /** 062 * Creates a new SIU_S12_PATIENT group 063 */ 064 public SIU_S12_PATIENT(Group parent, ModelClassFactory factory) { 065 super(parent, factory); 066 init(factory); 067 } 068 069 private void init(ModelClassFactory factory) { 070 try { 071 this.add(PID.class, true, false); 072 this.add(PD1.class, false, false); 073 this.add(PV1.class, false, false); 074 this.add(PV2.class, false, false); 075 this.add(OBX.class, false, true); 076 this.add(DG1.class, false, true); 077 } catch(HL7Exception e) { 078 log.error("Unexpected error creating SIU_S12_PATIENT - this is probably a bug in the source code generator.", e); 079 } 080 } 081 082 /** 083 * Returns "2.6" 084 */ 085 public String getVersion() { 086 return "2.6"; 087 } 088 089 090 091 /** 092 * Returns 093 * PID (Patient Identification) - creates it if necessary 094 */ 095 public PID getPID() { 096 PID retVal = getTyped("PID", PID.class); 097 return retVal; 098 } 099 100 101 102 103 /** 104 * Returns 105 * PD1 (Patient Additional Demographic) - creates it if necessary 106 */ 107 public PD1 getPD1() { 108 PD1 retVal = getTyped("PD1", PD1.class); 109 return retVal; 110 } 111 112 113 114 115 /** 116 * Returns 117 * PV1 (Patient Visit) - creates it if necessary 118 */ 119 public PV1 getPV1() { 120 PV1 retVal = getTyped("PV1", PV1.class); 121 return retVal; 122 } 123 124 125 126 127 /** 128 * Returns 129 * PV2 (Patient Visit - Additional Information) - creates it if necessary 130 */ 131 public PV2 getPV2() { 132 PV2 retVal = getTyped("PV2", PV2.class); 133 return retVal; 134 } 135 136 137 138 139 /** 140 * Returns 141 * the first repetition of 142 * OBX (Observation/Result) - creates it if necessary 143 */ 144 public OBX getOBX() { 145 OBX retVal = getTyped("OBX", OBX.class); 146 return retVal; 147 } 148 149 150 /** 151 * Returns a specific repetition of 152 * OBX (Observation/Result) - creates it if necessary 153 * 154 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 155 * @throws HL7Exception if the repetition requested is more than one 156 * greater than the number of existing repetitions. 157 */ 158 public OBX getOBX(int rep) { 159 OBX retVal = getTyped("OBX", rep, OBX.class); 160 return retVal; 161 } 162 163 /** 164 * Returns the number of existing repetitions of OBX 165 */ 166 public int getOBXReps() { 167 return getReps("OBX"); 168 } 169 170 /** 171 * <p> 172 * Returns a non-modifiable List containing all current existing repetitions of OBX. 173 * <p> 174 * <p> 175 * Note that unlike {@link #getOBX()}, this method will not create any reps 176 * if none are already present, so an empty list may be returned. 177 * </p> 178 */ 179 public List<OBX> getOBXAll() throws HL7Exception { 180 return getAllAsList("OBX", OBX.class); 181 } 182 183 /** 184 * Inserts a specific repetition of OBX (Observation/Result) 185 * @see AbstractGroup#insertRepetition(Structure, int) 186 */ 187 public void insertOBX(OBX structure, int rep) throws HL7Exception { 188 super.insertRepetition("OBX", structure, rep); 189 } 190 191 192 /** 193 * Inserts a specific repetition of OBX (Observation/Result) 194 * @see AbstractGroup#insertRepetition(Structure, int) 195 */ 196 public OBX insertOBX(int rep) throws HL7Exception { 197 return (OBX)super.insertRepetition("OBX", rep); 198 } 199 200 201 /** 202 * Removes a specific repetition of OBX (Observation/Result) 203 * @see AbstractGroup#removeRepetition(String, int) 204 */ 205 public OBX removeOBX(int rep) throws HL7Exception { 206 return (OBX)super.removeRepetition("OBX", rep); 207 } 208 209 210 211 /** 212 * Returns 213 * the first repetition of 214 * DG1 (Diagnosis) - creates it if necessary 215 */ 216 public DG1 getDG1() { 217 DG1 retVal = getTyped("DG1", DG1.class); 218 return retVal; 219 } 220 221 222 /** 223 * Returns a specific repetition of 224 * DG1 (Diagnosis) - creates it if necessary 225 * 226 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) 227 * @throws HL7Exception if the repetition requested is more than one 228 * greater than the number of existing repetitions. 229 */ 230 public DG1 getDG1(int rep) { 231 DG1 retVal = getTyped("DG1", rep, DG1.class); 232 return retVal; 233 } 234 235 /** 236 * Returns the number of existing repetitions of DG1 237 */ 238 public int getDG1Reps() { 239 return getReps("DG1"); 240 } 241 242 /** 243 * <p> 244 * Returns a non-modifiable List containing all current existing repetitions of DG1. 245 * <p> 246 * <p> 247 * Note that unlike {@link #getDG1()}, this method will not create any reps 248 * if none are already present, so an empty list may be returned. 249 * </p> 250 */ 251 public List<DG1> getDG1All() throws HL7Exception { 252 return getAllAsList("DG1", DG1.class); 253 } 254 255 /** 256 * Inserts a specific repetition of DG1 (Diagnosis) 257 * @see AbstractGroup#insertRepetition(Structure, int) 258 */ 259 public void insertDG1(DG1 structure, int rep) throws HL7Exception { 260 super.insertRepetition("DG1", structure, rep); 261 } 262 263 264 /** 265 * Inserts a specific repetition of DG1 (Diagnosis) 266 * @see AbstractGroup#insertRepetition(Structure, int) 267 */ 268 public DG1 insertDG1(int rep) throws HL7Exception { 269 return (DG1)super.insertRepetition("DG1", rep); 270 } 271 272 273 /** 274 * Removes a specific repetition of DG1 (Diagnosis) 275 * @see AbstractGroup#removeRepetition(String, int) 276 */ 277 public DG1 removeDG1(int rep) throws HL7Exception { 278 return (DG1)super.removeRepetition("DG1", rep); 279 } 280 281 282 283} 284