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.v23.message;
35
36 import ca.uhn.hl7v2.model.v23.group.*;
37 import ca.uhn.hl7v2.model.v23.segment.*;
38
39 import ca.uhn.hl7v2.HL7Exception;
40 import ca.uhn.hl7v2.parser.ModelClassFactory;
41 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
42 import ca.uhn.hl7v2.model.*;
43
44
45 /**
46 * <p>Represents a SRM_S01 message structure (see chapter ?). This structure contains the
47 * following elements: </p>
48 * <ul>
49 * <li>1: MSH (Message header segment) <b> </b> </li>
50 * <li>2: ARQ (Appointment Request) <b> </b> </li>
51 * <li>3: APR (Appointment Preferences) <b>optional </b> </li>
52 * <li>4: NTE (Notes and comments segment) <b>optional repeating</b> </li>
53 * <li>5: SRM_S01_PATIENT (a Group object) <b>optional repeating</b> </li>
54 * <li>6: SRM_S01_RESOURCES (a Group object) <b> repeating</b> </li>
55 * </ul>
56 */
57 //@SuppressWarnings("unused")
58 public class SRM_S01 extends AbstractMessage {
59
60 /**
61 * Creates a new SRM_S01 message with DefaultModelClassFactory.
62 */
63 public SRM_S01() {
64 this(new DefaultModelClassFactory());
65 }
66
67 /**
68 * Creates a new SRM_S01 message with custom ModelClassFactory.
69 */
70 public SRM_S01(ModelClassFactory factory) {
71 super(factory);
72 init(factory);
73 }
74
75 private void init(ModelClassFactory factory) {
76 try {
77 this.add(MSH.class, true, false);
78 this.add(ARQ.class, true, false);
79 this.add(APR.class, false, false);
80 this.add(NTE.class, false, true);
81 this.add(SRM_S01_PATIENT.class, false, true);
82 this.add(SRM_S01_RESOURCES.class, true, true);
83 } catch(HL7Exception e) {
84 log.error("Unexpected error creating SRM_S01 - this is probably a bug in the source code generator.", e);
85 }
86 }
87
88
89 /**
90 * Returns "2.3"
91 */
92 public String getVersion() {
93 return "2.3";
94 }
95
96
97
98
99 /**
100 * <p>
101 * Returns
102 * MSH (Message header segment) - creates it if necessary
103 * </p>
104 *
105 *
106 */
107 public MSH getMSH() {
108 return getTyped("MSH", MSH.class);
109 }
110
111
112
113
114
115 /**
116 * <p>
117 * Returns
118 * ARQ (Appointment Request) - creates it if necessary
119 * </p>
120 *
121 *
122 */
123 public ARQ getARQ() {
124 return getTyped("ARQ", ARQ.class);
125 }
126
127
128
129
130
131 /**
132 * <p>
133 * Returns
134 * APR (Appointment Preferences) - creates it if necessary
135 * </p>
136 *
137 *
138 */
139 public APR getAPR() {
140 return getTyped("APR", APR.class);
141 }
142
143
144
145
146
147 /**
148 * <p>
149 * Returns
150 * the first repetition of
151 * NTE (Notes and comments segment) - creates it if necessary
152 * </p>
153 *
154 *
155 */
156 public NTE getNTE() {
157 return getTyped("NTE", NTE.class);
158 }
159
160
161 /**
162 * <p>
163 * Returns a specific repetition of
164 * NTE (Notes and comments segment) - creates it if necessary
165 * </p>
166 *
167 *
168 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
169 * @throws HL7Exception if the repetition requested is more than one
170 * greater than the number of existing repetitions.
171 */
172 public NTE getNTE(int rep) {
173 return getTyped("NTE", rep, NTE.class);
174 }
175
176 /**
177 * <p>
178 * Returns the number of existing repetitions of NTE
179 * </p>
180 *
181 */
182 public int getNTEReps() {
183 return getReps("NTE");
184 }
185
186 /**
187 * <p>
188 * Returns a non-modifiable List containing all current existing repetitions of NTE.
189 * <p>
190 * <p>
191 * Note that unlike {@link #getNTE()}, this method will not create any reps
192 * if none are already present, so an empty list may be returned.
193 * </p>
194 *
195 */
196 public java.util.List<NTE> getNTEAll() throws HL7Exception {
197 return getAllAsList("NTE", NTE.class);
198 }
199
200 /**
201 * <p>
202 * Inserts a specific repetition of NTE (Notes and comments segment)
203 * </p>
204 *
205 *
206 * @see AbstractGroup#insertRepetition(Structure, int)
207 */
208 public void insertNTE(NTE structure, int rep) throws HL7Exception {
209 super.insertRepetition( "NTE", structure, rep);
210 }
211
212
213 /**
214 * <p>
215 * Inserts a specific repetition of NTE (Notes and comments segment)
216 * </p>
217 *
218 *
219 * @see AbstractGroup#insertRepetition(Structure, int)
220 */
221 public NTE insertNTE(int rep) throws HL7Exception {
222 return (NTE)super.insertRepetition("NTE", rep);
223 }
224
225
226 /**
227 * <p>
228 * Removes a specific repetition of NTE (Notes and comments segment)
229 * </p>
230 *
231 *
232 * @see AbstractGroup#removeRepetition(String, int)
233 */
234 public NTE removeNTE(int rep) throws HL7Exception {
235 return (NTE)super.removeRepetition("NTE", rep);
236 }
237
238
239
240
241 /**
242 * <p>
243 * Returns
244 * the first repetition of
245 * PATIENT (a Group object) - creates it if necessary
246 * </p>
247 *
248 *
249 */
250 public SRM_S01_PATIENT getPATIENT() {
251 return getTyped("PATIENT", SRM_S01_PATIENT.class);
252 }
253
254
255 /**
256 * <p>
257 * Returns a specific repetition of
258 * PATIENT (a Group object) - creates it if necessary
259 * </p>
260 *
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 SRM_S01_PATIENT getPATIENT(int rep) {
267 return getTyped("PATIENT", rep, SRM_S01_PATIENT.class);
268 }
269
270 /**
271 * <p>
272 * Returns the number of existing repetitions of PATIENT
273 * </p>
274 *
275 */
276 public int getPATIENTReps() {
277 return getReps("PATIENT");
278 }
279
280 /**
281 * <p>
282 * Returns a non-modifiable List containing all current existing repetitions of PATIENT.
283 * <p>
284 * <p>
285 * Note that unlike {@link #getPATIENT()}, this method will not create any reps
286 * if none are already present, so an empty list may be returned.
287 * </p>
288 *
289 */
290 public java.util.List<SRM_S01_PATIENT> getPATIENTAll() throws HL7Exception {
291 return getAllAsList("PATIENT", SRM_S01_PATIENT.class);
292 }
293
294 /**
295 * <p>
296 * Inserts a specific repetition of PATIENT (a Group object)
297 * </p>
298 *
299 *
300 * @see AbstractGroup#insertRepetition(Structure, int)
301 */
302 public void insertPATIENT(SRM_S01_PATIENT structure, int rep) throws HL7Exception {
303 super.insertRepetition( "PATIENT", structure, rep);
304 }
305
306
307 /**
308 * <p>
309 * Inserts a specific repetition of PATIENT (a Group object)
310 * </p>
311 *
312 *
313 * @see AbstractGroup#insertRepetition(Structure, int)
314 */
315 public SRM_S01_PATIENT insertPATIENT(int rep) throws HL7Exception {
316 return (SRM_S01_PATIENT)super.insertRepetition("PATIENT", rep);
317 }
318
319
320 /**
321 * <p>
322 * Removes a specific repetition of PATIENT (a Group object)
323 * </p>
324 *
325 *
326 * @see AbstractGroup#removeRepetition(String, int)
327 */
328 public SRM_S01_PATIENT removePATIENT(int rep) throws HL7Exception {
329 return (SRM_S01_PATIENT)super.removeRepetition("PATIENT", rep);
330 }
331
332
333
334
335 /**
336 * <p>
337 * Returns
338 * the first repetition of
339 * RESOURCES (a Group object) - creates it if necessary
340 * </p>
341 *
342 *
343 */
344 public SRM_S01_RESOURCES getRESOURCES() {
345 return getTyped("RESOURCES", SRM_S01_RESOURCES.class);
346 }
347
348
349 /**
350 * <p>
351 * Returns a specific repetition of
352 * RESOURCES (a Group object) - creates it if necessary
353 * </p>
354 *
355 *
356 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
357 * @throws HL7Exception if the repetition requested is more than one
358 * greater than the number of existing repetitions.
359 */
360 public SRM_S01_RESOURCES getRESOURCES(int rep) {
361 return getTyped("RESOURCES", rep, SRM_S01_RESOURCES.class);
362 }
363
364 /**
365 * <p>
366 * Returns the number of existing repetitions of RESOURCES
367 * </p>
368 *
369 */
370 public int getRESOURCESReps() {
371 return getReps("RESOURCES");
372 }
373
374 /**
375 * <p>
376 * Returns a non-modifiable List containing all current existing repetitions of RESOURCES.
377 * <p>
378 * <p>
379 * Note that unlike {@link #getRESOURCES()}, this method will not create any reps
380 * if none are already present, so an empty list may be returned.
381 * </p>
382 *
383 */
384 public java.util.List<SRM_S01_RESOURCES> getRESOURCESAll() throws HL7Exception {
385 return getAllAsList("RESOURCES", SRM_S01_RESOURCES.class);
386 }
387
388 /**
389 * <p>
390 * Inserts a specific repetition of RESOURCES (a Group object)
391 * </p>
392 *
393 *
394 * @see AbstractGroup#insertRepetition(Structure, int)
395 */
396 public void insertRESOURCES(SRM_S01_RESOURCES structure, int rep) throws HL7Exception {
397 super.insertRepetition( "RESOURCES", structure, rep);
398 }
399
400
401 /**
402 * <p>
403 * Inserts a specific repetition of RESOURCES (a Group object)
404 * </p>
405 *
406 *
407 * @see AbstractGroup#insertRepetition(Structure, int)
408 */
409 public SRM_S01_RESOURCES insertRESOURCES(int rep) throws HL7Exception {
410 return (SRM_S01_RESOURCES)super.insertRepetition("RESOURCES", rep);
411 }
412
413
414 /**
415 * <p>
416 * Removes a specific repetition of RESOURCES (a Group object)
417 * </p>
418 *
419 *
420 * @see AbstractGroup#removeRepetition(String, int)
421 */
422 public SRM_S01_RESOURCES removeRESOURCES(int rep) throws HL7Exception {
423 return (SRM_S01_RESOURCES)super.removeRepetition("RESOURCES", rep);
424 }
425
426
427
428 }
429