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 PEX_P07_PEX_CAUSE 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: PCR (Possible Causal Relationship) <b> </b></li>
028 * <li>2: PEX_P07_RX_ORDER (a Group object) <b>optional </b></li>
029 * <li>3: PEX_P07_RX_ADMINISTRATION (a Group object) <b>optional repeating</b></li>
030 * <li>4: PRB (Problem Details) <b>optional repeating</b></li>
031 * <li>5: OBX (Observation/Result) <b>optional repeating</b></li>
032 * <li>6: NTE (Notes and Comments) <b>optional repeating</b></li>
033 * <li>7: PEX_P07_ASSOCIATED_PERSON (a Group object) <b>optional </b></li>
034 * <li>8: PEX_P07_STUDY (a Group object) <b>optional repeating</b></li>
035 * </ul>
036 */
037 public class PEX_P07_PEX_CAUSE extends AbstractGroup {
038
039 /**
040 * Creates a new PEX_P07_PEX_CAUSE group
041 */
042 public PEX_P07_PEX_CAUSE(Group parent, ModelClassFactory factory) {
043 super(parent, factory);
044 init(factory);
045 }
046
047 private void init(ModelClassFactory factory) {
048 try {
049 this.add(PCR.class, true, false);
050 this.add(PEX_P07_RX_ORDER.class, false, false);
051 this.add(PEX_P07_RX_ADMINISTRATION.class, false, true);
052 this.add(PRB.class, false, true);
053 this.add(OBX.class, false, true);
054 this.add(NTE.class, false, true);
055 this.add(PEX_P07_ASSOCIATED_PERSON.class, false, false);
056 this.add(PEX_P07_STUDY.class, false, true);
057 } catch(HL7Exception e) {
058 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PEX_P07_PEX_CAUSE - this is probably a bug in the source code generator.", e);
059 }
060 }
061
062 /**
063 * Returns "2.4"
064 */
065 public String getVersion() {
066 return "2.4";
067 }
068
069
070
071 /**
072 * Returns
073 * PCR (Possible Causal Relationship) - creates it if necessary
074 */
075 public PCR getPCR() {
076 PCR ret = null;
077 try {
078 ret = (PCR)this.get("PCR");
079 } catch(HL7Exception e) {
080 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
081 throw new RuntimeException(e);
082 }
083 return ret;
084 }
085
086
087
088
089 /**
090 * Returns
091 * RX_ORDER (a Group object) - creates it if necessary
092 */
093 public PEX_P07_RX_ORDER getRX_ORDER() {
094 PEX_P07_RX_ORDER ret = null;
095 try {
096 ret = (PEX_P07_RX_ORDER)this.get("RX_ORDER");
097 } catch(HL7Exception e) {
098 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
099 throw new RuntimeException(e);
100 }
101 return ret;
102 }
103
104
105
106
107 /**
108 * Returns
109 * the first repetition of
110 * RX_ADMINISTRATION (a Group object) - creates it if necessary
111 */
112 public PEX_P07_RX_ADMINISTRATION getRX_ADMINISTRATION() {
113 PEX_P07_RX_ADMINISTRATION ret = null;
114 try {
115 ret = (PEX_P07_RX_ADMINISTRATION)this.get("RX_ADMINISTRATION");
116 } catch(HL7Exception e) {
117 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
118 throw new RuntimeException(e);
119 }
120 return ret;
121 }
122
123
124 /**
125 * Returns a specific repetition of
126 * RX_ADMINISTRATION (a Group object) - creates it if necessary
127 *
128 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
129 * @throws HL7Exception if the repetition requested is more than one
130 * greater than the number of existing repetitions.
131 */
132 public PEX_P07_RX_ADMINISTRATION getRX_ADMINISTRATION(int rep) {
133 PEX_P07_RX_ADMINISTRATION ret = null;
134 try {
135 ret = (PEX_P07_RX_ADMINISTRATION)this.get("RX_ADMINISTRATION", rep);
136 } catch(HL7Exception e) {
137 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
138 throw new RuntimeException(e);
139 }
140 return ret;
141 }
142
143 /**
144 * Returns the number of existing repetitions of RX_ADMINISTRATION
145 */
146 public int getRX_ADMINISTRATIONReps() {
147 int reps = -1;
148 try {
149 reps = this.getAll("RX_ADMINISTRATION").length;
150 } catch (HL7Exception e) {
151 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
152 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
153 throw new RuntimeException(message);
154 }
155 return reps;
156 }
157
158 /**
159 * Inserts a specific repetition of RX_ADMINISTRATION (a Group object)
160 * @see AbstractGroup#insertRepetition(Structure, int)
161 */
162 public void insertRX_ADMINISTRATION(PEX_P07_RX_ADMINISTRATION structure, int rep) throws HL7Exception {
163 super.insertRepetition("RX_ADMINISTRATION", structure, rep);
164 }
165
166
167 /**
168 * Inserts a specific repetition of RX_ADMINISTRATION (a Group object)
169 * @see AbstractGroup#insertRepetition(Structure, int)
170 */
171 public PEX_P07_RX_ADMINISTRATION insertRX_ADMINISTRATION(int rep) throws HL7Exception {
172 return (PEX_P07_RX_ADMINISTRATION)super.insertRepetition("RX_ADMINISTRATION", rep);
173 }
174
175
176 /**
177 * Removes a specific repetition of RX_ADMINISTRATION (a Group object)
178 * @see AbstractGroup#removeRepetition(String, int)
179 */
180 public PEX_P07_RX_ADMINISTRATION removeRX_ADMINISTRATION(int rep) throws HL7Exception {
181 return (PEX_P07_RX_ADMINISTRATION)super.removeRepetition("RX_ADMINISTRATION", rep);
182 }
183
184
185
186 /**
187 * Returns
188 * the first repetition of
189 * PRB (Problem Details) - creates it if necessary
190 */
191 public PRB getPRB() {
192 PRB ret = null;
193 try {
194 ret = (PRB)this.get("PRB");
195 } catch(HL7Exception e) {
196 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
197 throw new RuntimeException(e);
198 }
199 return ret;
200 }
201
202
203 /**
204 * Returns a specific repetition of
205 * PRB (Problem Details) - creates it if necessary
206 *
207 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
208 * @throws HL7Exception if the repetition requested is more than one
209 * greater than the number of existing repetitions.
210 */
211 public PRB getPRB(int rep) {
212 PRB ret = null;
213 try {
214 ret = (PRB)this.get("PRB", rep);
215 } catch(HL7Exception e) {
216 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
217 throw new RuntimeException(e);
218 }
219 return ret;
220 }
221
222 /**
223 * Returns the number of existing repetitions of PRB
224 */
225 public int getPRBReps() {
226 int reps = -1;
227 try {
228 reps = this.getAll("PRB").length;
229 } catch (HL7Exception e) {
230 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
231 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
232 throw new RuntimeException(message);
233 }
234 return reps;
235 }
236
237 /**
238 * Inserts a specific repetition of PRB (Problem Details)
239 * @see AbstractGroup#insertRepetition(Structure, int)
240 */
241 public void insertPRB(PRB structure, int rep) throws HL7Exception {
242 super.insertRepetition("PRB", structure, rep);
243 }
244
245
246 /**
247 * Inserts a specific repetition of PRB (Problem Details)
248 * @see AbstractGroup#insertRepetition(Structure, int)
249 */
250 public PRB insertPRB(int rep) throws HL7Exception {
251 return (PRB)super.insertRepetition("PRB", rep);
252 }
253
254
255 /**
256 * Removes a specific repetition of PRB (Problem Details)
257 * @see AbstractGroup#removeRepetition(String, int)
258 */
259 public PRB removePRB(int rep) throws HL7Exception {
260 return (PRB)super.removeRepetition("PRB", rep);
261 }
262
263
264
265 /**
266 * Returns
267 * the first repetition of
268 * OBX (Observation/Result) - creates it if necessary
269 */
270 public OBX getOBX() {
271 OBX ret = null;
272 try {
273 ret = (OBX)this.get("OBX");
274 } catch(HL7Exception e) {
275 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
276 throw new RuntimeException(e);
277 }
278 return ret;
279 }
280
281
282 /**
283 * Returns a specific repetition of
284 * OBX (Observation/Result) - creates it if necessary
285 *
286 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
287 * @throws HL7Exception if the repetition requested is more than one
288 * greater than the number of existing repetitions.
289 */
290 public OBX getOBX(int rep) {
291 OBX ret = null;
292 try {
293 ret = (OBX)this.get("OBX", rep);
294 } catch(HL7Exception e) {
295 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
296 throw new RuntimeException(e);
297 }
298 return ret;
299 }
300
301 /**
302 * Returns the number of existing repetitions of OBX
303 */
304 public int getOBXReps() {
305 int reps = -1;
306 try {
307 reps = this.getAll("OBX").length;
308 } catch (HL7Exception e) {
309 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
310 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
311 throw new RuntimeException(message);
312 }
313 return reps;
314 }
315
316 /**
317 * Inserts a specific repetition of OBX (Observation/Result)
318 * @see AbstractGroup#insertRepetition(Structure, int)
319 */
320 public void insertOBX(OBX structure, int rep) throws HL7Exception {
321 super.insertRepetition("OBX", structure, rep);
322 }
323
324
325 /**
326 * Inserts a specific repetition of OBX (Observation/Result)
327 * @see AbstractGroup#insertRepetition(Structure, int)
328 */
329 public OBX insertOBX(int rep) throws HL7Exception {
330 return (OBX)super.insertRepetition("OBX", rep);
331 }
332
333
334 /**
335 * Removes a specific repetition of OBX (Observation/Result)
336 * @see AbstractGroup#removeRepetition(String, int)
337 */
338 public OBX removeOBX(int rep) throws HL7Exception {
339 return (OBX)super.removeRepetition("OBX", rep);
340 }
341
342
343
344 /**
345 * Returns
346 * the first repetition of
347 * NTE (Notes and Comments) - creates it if necessary
348 */
349 public NTE getNTE() {
350 NTE ret = null;
351 try {
352 ret = (NTE)this.get("NTE");
353 } catch(HL7Exception e) {
354 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
355 throw new RuntimeException(e);
356 }
357 return ret;
358 }
359
360
361 /**
362 * Returns a specific repetition of
363 * NTE (Notes and Comments) - creates it if necessary
364 *
365 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
366 * @throws HL7Exception if the repetition requested is more than one
367 * greater than the number of existing repetitions.
368 */
369 public NTE getNTE(int rep) {
370 NTE ret = null;
371 try {
372 ret = (NTE)this.get("NTE", rep);
373 } catch(HL7Exception e) {
374 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
375 throw new RuntimeException(e);
376 }
377 return ret;
378 }
379
380 /**
381 * Returns the number of existing repetitions of NTE
382 */
383 public int getNTEReps() {
384 int reps = -1;
385 try {
386 reps = this.getAll("NTE").length;
387 } catch (HL7Exception e) {
388 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
389 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
390 throw new RuntimeException(message);
391 }
392 return reps;
393 }
394
395 /**
396 * Inserts a specific repetition of NTE (Notes and Comments)
397 * @see AbstractGroup#insertRepetition(Structure, int)
398 */
399 public void insertNTE(NTE structure, int rep) throws HL7Exception {
400 super.insertRepetition("NTE", structure, rep);
401 }
402
403
404 /**
405 * Inserts a specific repetition of NTE (Notes and Comments)
406 * @see AbstractGroup#insertRepetition(Structure, int)
407 */
408 public NTE insertNTE(int rep) throws HL7Exception {
409 return (NTE)super.insertRepetition("NTE", rep);
410 }
411
412
413 /**
414 * Removes a specific repetition of NTE (Notes and Comments)
415 * @see AbstractGroup#removeRepetition(String, int)
416 */
417 public NTE removeNTE(int rep) throws HL7Exception {
418 return (NTE)super.removeRepetition("NTE", rep);
419 }
420
421
422
423 /**
424 * Returns
425 * ASSOCIATED_PERSON (a Group object) - creates it if necessary
426 */
427 public PEX_P07_ASSOCIATED_PERSON getASSOCIATED_PERSON() {
428 PEX_P07_ASSOCIATED_PERSON ret = null;
429 try {
430 ret = (PEX_P07_ASSOCIATED_PERSON)this.get("ASSOCIATED_PERSON");
431 } catch(HL7Exception e) {
432 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
433 throw new RuntimeException(e);
434 }
435 return ret;
436 }
437
438
439
440
441 /**
442 * Returns
443 * the first repetition of
444 * STUDY (a Group object) - creates it if necessary
445 */
446 public PEX_P07_STUDY getSTUDY() {
447 PEX_P07_STUDY ret = null;
448 try {
449 ret = (PEX_P07_STUDY)this.get("STUDY");
450 } catch(HL7Exception e) {
451 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
452 throw new RuntimeException(e);
453 }
454 return ret;
455 }
456
457
458 /**
459 * Returns a specific repetition of
460 * STUDY (a Group object) - creates it if necessary
461 *
462 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
463 * @throws HL7Exception if the repetition requested is more than one
464 * greater than the number of existing repetitions.
465 */
466 public PEX_P07_STUDY getSTUDY(int rep) {
467 PEX_P07_STUDY ret = null;
468 try {
469 ret = (PEX_P07_STUDY)this.get("STUDY", rep);
470 } catch(HL7Exception e) {
471 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
472 throw new RuntimeException(e);
473 }
474 return ret;
475 }
476
477 /**
478 * Returns the number of existing repetitions of STUDY
479 */
480 public int getSTUDYReps() {
481 int reps = -1;
482 try {
483 reps = this.getAll("STUDY").length;
484 } catch (HL7Exception e) {
485 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
486 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
487 throw new RuntimeException(message);
488 }
489 return reps;
490 }
491
492 /**
493 * Inserts a specific repetition of STUDY (a Group object)
494 * @see AbstractGroup#insertRepetition(Structure, int)
495 */
496 public void insertSTUDY(PEX_P07_STUDY structure, int rep) throws HL7Exception {
497 super.insertRepetition("STUDY", structure, rep);
498 }
499
500
501 /**
502 * Inserts a specific repetition of STUDY (a Group object)
503 * @see AbstractGroup#insertRepetition(Structure, int)
504 */
505 public PEX_P07_STUDY insertSTUDY(int rep) throws HL7Exception {
506 return (PEX_P07_STUDY)super.insertRepetition("STUDY", rep);
507 }
508
509
510 /**
511 * Removes a specific repetition of STUDY (a Group object)
512 * @see AbstractGroup#removeRepetition(String, int)
513 */
514 public PEX_P07_STUDY removeSTUDY(int rep) throws HL7Exception {
515 return (PEX_P07_STUDY)super.removeRepetition("STUDY", rep);
516 }
517
518
519
520 }
521