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
008 package ca.uhn.hl7v2.model.v24.group;
009
010 import ca.uhn.hl7v2.model.v24.segment.*;
011
012 import ca.uhn.log.HapiLogFactory;
013 import ca.uhn.hl7v2.HL7Exception;
014 import ca.uhn.hl7v2.parser.ModelClassFactory;
015 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016 import ca.uhn.hl7v2.model.AbstractMessage;
017 import ca.uhn.hl7v2.model.Group;
018 import ca.uhn.hl7v2.model.AbstractGroup;
019 import ca.uhn.hl7v2.model.GenericSegment;
020
021 /**
022 * <p>Represents a PPP_PCB_GOAL group structure (a Group object).
023 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
024 * This Group contains the following elements:
025 * </p>
026 * <ul>
027 * <li>1: GOL (Goal Detail) <b> </b></li>
028 * <li>2: NTE (Notes and Comments) <b>optional repeating</b></li>
029 * <li>3: VAR (Variance) <b>optional repeating</b></li>
030 * <li>4: PPP_PCB_GOAL_ROLE (a Group object) <b>optional repeating</b></li>
031 * <li>5: PPP_PCB_GOAL_OBSERVATION (a Group object) <b>optional repeating</b></li>
032 * </ul>
033 */
034 public class PPP_PCB_GOAL extends AbstractGroup {
035
036 /**
037 * Creates a new PPP_PCB_GOAL group
038 */
039 public PPP_PCB_GOAL(Group parent, ModelClassFactory factory) {
040 super(parent, factory);
041 init(factory);
042 }
043
044 private void init(ModelClassFactory factory) {
045 try {
046 this.add(GOL.class, true, false);
047 this.add(NTE.class, false, true);
048 this.add(VAR.class, false, true);
049 this.add(PPP_PCB_GOAL_ROLE.class, false, true);
050 this.add(PPP_PCB_GOAL_OBSERVATION.class, false, true);
051 } catch(HL7Exception e) {
052 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PPP_PCB_GOAL - this is probably a bug in the source code generator.", e);
053 }
054 }
055
056 /**
057 * Returns "2.4"
058 */
059 public String getVersion() {
060 return "2.4";
061 }
062
063
064
065 /**
066 * Returns
067 * GOL (Goal Detail) - creates it if necessary
068 */
069 public GOL getGOL() {
070 GOL ret = null;
071 try {
072 ret = (GOL)this.get("GOL");
073 } catch(HL7Exception e) {
074 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
075 throw new RuntimeException(e);
076 }
077 return ret;
078 }
079
080
081
082
083 /**
084 * Returns
085 * the first repetition of
086 * NTE (Notes and Comments) - creates it if necessary
087 */
088 public NTE getNTE() {
089 NTE ret = null;
090 try {
091 ret = (NTE)this.get("NTE");
092 } catch(HL7Exception e) {
093 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
094 throw new RuntimeException(e);
095 }
096 return ret;
097 }
098
099
100 /**
101 * Returns a specific repetition of
102 * NTE (Notes and Comments) - creates it if necessary
103 *
104 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
105 * @throws HL7Exception if the repetition requested is more than one
106 * greater than the number of existing repetitions.
107 */
108 public NTE getNTE(int rep) {
109 NTE ret = null;
110 try {
111 ret = (NTE)this.get("NTE", rep);
112 } catch(HL7Exception e) {
113 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
114 throw new RuntimeException(e);
115 }
116 return ret;
117 }
118
119 /**
120 * Returns the number of existing repetitions of NTE
121 */
122 public int getNTEReps() {
123 int reps = -1;
124 try {
125 reps = this.getAll("NTE").length;
126 } catch (HL7Exception e) {
127 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
128 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
129 throw new RuntimeException(message);
130 }
131 return reps;
132 }
133
134 /**
135 * Inserts a specific repetition of NTE (Notes and Comments)
136 * @see AbstractGroup#insertRepetition(Structure, int)
137 */
138 public void insertNTE(NTE structure, int rep) throws HL7Exception {
139 super.insertRepetition("NTE", structure, rep);
140 }
141
142
143 /**
144 * Inserts a specific repetition of NTE (Notes and Comments)
145 * @see AbstractGroup#insertRepetition(Structure, int)
146 */
147 public NTE insertNTE(int rep) throws HL7Exception {
148 return (NTE)super.insertRepetition("NTE", rep);
149 }
150
151
152 /**
153 * Removes a specific repetition of NTE (Notes and Comments)
154 * @see AbstractGroup#removeRepetition(String, int)
155 */
156 public NTE removeNTE(int rep) throws HL7Exception {
157 return (NTE)super.removeRepetition("NTE", rep);
158 }
159
160
161
162 /**
163 * Returns
164 * the first repetition of
165 * VAR (Variance) - creates it if necessary
166 */
167 public VAR getVAR() {
168 VAR ret = null;
169 try {
170 ret = (VAR)this.get("VAR");
171 } catch(HL7Exception e) {
172 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
173 throw new RuntimeException(e);
174 }
175 return ret;
176 }
177
178
179 /**
180 * Returns a specific repetition of
181 * VAR (Variance) - creates it if necessary
182 *
183 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
184 * @throws HL7Exception if the repetition requested is more than one
185 * greater than the number of existing repetitions.
186 */
187 public VAR getVAR(int rep) {
188 VAR ret = null;
189 try {
190 ret = (VAR)this.get("VAR", rep);
191 } catch(HL7Exception e) {
192 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
193 throw new RuntimeException(e);
194 }
195 return ret;
196 }
197
198 /**
199 * Returns the number of existing repetitions of VAR
200 */
201 public int getVARReps() {
202 int reps = -1;
203 try {
204 reps = this.getAll("VAR").length;
205 } catch (HL7Exception e) {
206 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
207 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
208 throw new RuntimeException(message);
209 }
210 return reps;
211 }
212
213 /**
214 * Inserts a specific repetition of VAR (Variance)
215 * @see AbstractGroup#insertRepetition(Structure, int)
216 */
217 public void insertVAR(VAR structure, int rep) throws HL7Exception {
218 super.insertRepetition("VAR", structure, rep);
219 }
220
221
222 /**
223 * Inserts a specific repetition of VAR (Variance)
224 * @see AbstractGroup#insertRepetition(Structure, int)
225 */
226 public VAR insertVAR(int rep) throws HL7Exception {
227 return (VAR)super.insertRepetition("VAR", rep);
228 }
229
230
231 /**
232 * Removes a specific repetition of VAR (Variance)
233 * @see AbstractGroup#removeRepetition(String, int)
234 */
235 public VAR removeVAR(int rep) throws HL7Exception {
236 return (VAR)super.removeRepetition("VAR", rep);
237 }
238
239
240
241 /**
242 * Returns
243 * the first repetition of
244 * GOAL_ROLE (a Group object) - creates it if necessary
245 */
246 public PPP_PCB_GOAL_ROLE getGOAL_ROLE() {
247 PPP_PCB_GOAL_ROLE ret = null;
248 try {
249 ret = (PPP_PCB_GOAL_ROLE)this.get("GOAL_ROLE");
250 } catch(HL7Exception e) {
251 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
252 throw new RuntimeException(e);
253 }
254 return ret;
255 }
256
257
258 /**
259 * Returns a specific repetition of
260 * GOAL_ROLE (a Group object) - creates it if necessary
261 *
262 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
263 * @throws HL7Exception if the repetition requested is more than one
264 * greater than the number of existing repetitions.
265 */
266 public PPP_PCB_GOAL_ROLE getGOAL_ROLE(int rep) {
267 PPP_PCB_GOAL_ROLE ret = null;
268 try {
269 ret = (PPP_PCB_GOAL_ROLE)this.get("GOAL_ROLE", rep);
270 } catch(HL7Exception e) {
271 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
272 throw new RuntimeException(e);
273 }
274 return ret;
275 }
276
277 /**
278 * Returns the number of existing repetitions of GOAL_ROLE
279 */
280 public int getGOAL_ROLEReps() {
281 int reps = -1;
282 try {
283 reps = this.getAll("GOAL_ROLE").length;
284 } catch (HL7Exception e) {
285 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
286 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
287 throw new RuntimeException(message);
288 }
289 return reps;
290 }
291
292 /**
293 * Inserts a specific repetition of GOAL_ROLE (a Group object)
294 * @see AbstractGroup#insertRepetition(Structure, int)
295 */
296 public void insertGOAL_ROLE(PPP_PCB_GOAL_ROLE structure, int rep) throws HL7Exception {
297 super.insertRepetition("GOAL_ROLE", structure, rep);
298 }
299
300
301 /**
302 * Inserts a specific repetition of GOAL_ROLE (a Group object)
303 * @see AbstractGroup#insertRepetition(Structure, int)
304 */
305 public PPP_PCB_GOAL_ROLE insertGOAL_ROLE(int rep) throws HL7Exception {
306 return (PPP_PCB_GOAL_ROLE)super.insertRepetition("GOAL_ROLE", rep);
307 }
308
309
310 /**
311 * Removes a specific repetition of GOAL_ROLE (a Group object)
312 * @see AbstractGroup#removeRepetition(String, int)
313 */
314 public PPP_PCB_GOAL_ROLE removeGOAL_ROLE(int rep) throws HL7Exception {
315 return (PPP_PCB_GOAL_ROLE)super.removeRepetition("GOAL_ROLE", rep);
316 }
317
318
319
320 /**
321 * Returns
322 * the first repetition of
323 * GOAL_OBSERVATION (a Group object) - creates it if necessary
324 */
325 public PPP_PCB_GOAL_OBSERVATION getGOAL_OBSERVATION() {
326 PPP_PCB_GOAL_OBSERVATION ret = null;
327 try {
328 ret = (PPP_PCB_GOAL_OBSERVATION)this.get("GOAL_OBSERVATION");
329 } catch(HL7Exception e) {
330 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
331 throw new RuntimeException(e);
332 }
333 return ret;
334 }
335
336
337 /**
338 * Returns a specific repetition of
339 * GOAL_OBSERVATION (a Group object) - creates it if necessary
340 *
341 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
342 * @throws HL7Exception if the repetition requested is more than one
343 * greater than the number of existing repetitions.
344 */
345 public PPP_PCB_GOAL_OBSERVATION getGOAL_OBSERVATION(int rep) {
346 PPP_PCB_GOAL_OBSERVATION ret = null;
347 try {
348 ret = (PPP_PCB_GOAL_OBSERVATION)this.get("GOAL_OBSERVATION", rep);
349 } catch(HL7Exception e) {
350 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
351 throw new RuntimeException(e);
352 }
353 return ret;
354 }
355
356 /**
357 * Returns the number of existing repetitions of GOAL_OBSERVATION
358 */
359 public int getGOAL_OBSERVATIONReps() {
360 int reps = -1;
361 try {
362 reps = this.getAll("GOAL_OBSERVATION").length;
363 } catch (HL7Exception e) {
364 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
365 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
366 throw new RuntimeException(message);
367 }
368 return reps;
369 }
370
371 /**
372 * Inserts a specific repetition of GOAL_OBSERVATION (a Group object)
373 * @see AbstractGroup#insertRepetition(Structure, int)
374 */
375 public void insertGOAL_OBSERVATION(PPP_PCB_GOAL_OBSERVATION structure, int rep) throws HL7Exception {
376 super.insertRepetition("GOAL_OBSERVATION", structure, rep);
377 }
378
379
380 /**
381 * Inserts a specific repetition of GOAL_OBSERVATION (a Group object)
382 * @see AbstractGroup#insertRepetition(Structure, int)
383 */
384 public PPP_PCB_GOAL_OBSERVATION insertGOAL_OBSERVATION(int rep) throws HL7Exception {
385 return (PPP_PCB_GOAL_OBSERVATION)super.insertRepetition("GOAL_OBSERVATION", rep);
386 }
387
388
389 /**
390 * Removes a specific repetition of GOAL_OBSERVATION (a Group object)
391 * @see AbstractGroup#removeRepetition(String, int)
392 */
393 public PPP_PCB_GOAL_OBSERVATION removeGOAL_OBSERVATION(int rep) throws HL7Exception {
394 return (PPP_PCB_GOAL_OBSERVATION)super.removeRepetition("GOAL_OBSERVATION", rep);
395 }
396
397
398
399 }
400