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.segment;
035
036// import ca.uhn.hl7v2.model.v26.group.*;
037import ca.uhn.hl7v2.model.v26.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047/**
048 *<p>Represents an HL7 REL message segment (Clinical Relationship Segment). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>REL-1: Set ID -REL (SI) <b>optional </b>
052     * <li>REL-2: Relationship Type (CWE) <b> </b>
053     * <li>REL-3: This Relationship Instance Identifier (EI) <b> </b>
054     * <li>REL-4: Source Information Instance Identifier (EI) <b> </b>
055     * <li>REL-5: Target Information Instance Identifier (EI) <b> </b>
056     * <li>REL-6: Asserting Entity Instance ID (EI) <b>optional </b>
057     * <li>REL-7: Asserting Person (XCN) <b>optional </b>
058     * <li>REL-8: Asserting Organization (XON) <b>optional </b>
059     * <li>REL-9: Assertor Address (XAD) <b>optional </b>
060     * <li>REL-10: Assertor Contact (XTN) <b>optional </b>
061     * <li>REL-11: Assertion Date Range (DR) <b>optional </b>
062     * <li>REL-12: Negation Indicator (ID) <b>optional </b>
063     * <li>REL-13: Certainty of Relationship (CWE) <b>optional </b>
064     * <li>REL-14: Priority No (NM) <b>optional </b>
065     * <li>REL-15: Priority  Sequence No (rel preference for consideration) (NM) <b>optional </b>
066     * <li>REL-16: Separability Indicator (ID) <b>optional </b>
067 * </ul>
068 */
069@SuppressWarnings("unused")
070public class REL extends AbstractSegment {
071
072    /** 
073     * Creates a new REL segment
074     */
075    public REL(Group parent, ModelClassFactory factory) {
076       super(parent, factory);
077       init(factory);
078    }
079
080    private void init(ModelClassFactory factory) {
081       try {
082                                  this.add(SI.class, false, 1, 4, new Object[]{ getMessage() }, "Set ID -REL");
083                                  this.add(CWE.class, true, 1, 705, new Object[]{ getMessage() }, "Relationship Type");
084                                  this.add(EI.class, true, 1, 60, new Object[]{ getMessage() }, "This Relationship Instance Identifier");
085                                  this.add(EI.class, true, 1, 60, new Object[]{ getMessage() }, "Source Information Instance Identifier");
086                                  this.add(EI.class, true, 1, 60, new Object[]{ getMessage() }, "Target Information Instance Identifier");
087                                  this.add(EI.class, false, 1, 60, new Object[]{ getMessage() }, "Asserting Entity Instance ID");
088                                  this.add(XCN.class, false, 1, 250, new Object[]{ getMessage() }, "Asserting Person");
089                                  this.add(XON.class, false, 1, 250, new Object[]{ getMessage() }, "Asserting Organization");
090                                  this.add(XAD.class, false, 1, 250, new Object[]{ getMessage() }, "Assertor Address");
091                                  this.add(XTN.class, false, 1, 250, new Object[]{ getMessage() }, "Assertor Contact");
092                                  this.add(DR.class, false, 1, 53, new Object[]{ getMessage() }, "Assertion Date Range");
093                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Negation Indicator");
094                                  this.add(CWE.class, false, 1, 705, new Object[]{ getMessage() }, "Certainty of Relationship");
095                                  this.add(NM.class, false, 1, 26, new Object[]{ getMessage() }, "Priority No");
096                                  this.add(NM.class, false, 1, 250, new Object[]{ getMessage() }, "Priority  Sequence No (rel preference for consideration)");
097                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Separability Indicator");
098       } catch(HL7Exception e) {
099          log.error("Unexpected error creating REL - this is probably a bug in the source code generator.", e);
100       }
101    }
102
103
104
105    /**
106     * Returns
107     * REL-1: "Set ID -REL" - creates it if necessary
108     */
109    public SI getSetIDREL() { 
110                SI retVal = this.getTypedField(1, 0);
111                return retVal;
112    }
113    
114    /**
115     * Returns
116     * REL-1: "Set ID -REL" - creates it if necessary
117     */
118    public SI getRel1_SetIDREL() { 
119                SI retVal = this.getTypedField(1, 0);
120                return retVal;
121    }
122
123
124
125    /**
126     * Returns
127     * REL-2: "Relationship Type" - creates it if necessary
128     */
129    public CWE getRelationshipType() { 
130                CWE retVal = this.getTypedField(2, 0);
131                return retVal;
132    }
133    
134    /**
135     * Returns
136     * REL-2: "Relationship Type" - creates it if necessary
137     */
138    public CWE getRel2_RelationshipType() { 
139                CWE retVal = this.getTypedField(2, 0);
140                return retVal;
141    }
142
143
144
145    /**
146     * Returns
147     * REL-3: "This Relationship Instance Identifier" - creates it if necessary
148     */
149    public EI getThisRelationshipInstanceIdentifier() { 
150                EI retVal = this.getTypedField(3, 0);
151                return retVal;
152    }
153    
154    /**
155     * Returns
156     * REL-3: "This Relationship Instance Identifier" - creates it if necessary
157     */
158    public EI getRel3_ThisRelationshipInstanceIdentifier() { 
159                EI retVal = this.getTypedField(3, 0);
160                return retVal;
161    }
162
163
164
165    /**
166     * Returns
167     * REL-4: "Source Information Instance Identifier" - creates it if necessary
168     */
169    public EI getSourceInformationInstanceIdentifier() { 
170                EI retVal = this.getTypedField(4, 0);
171                return retVal;
172    }
173    
174    /**
175     * Returns
176     * REL-4: "Source Information Instance Identifier" - creates it if necessary
177     */
178    public EI getRel4_SourceInformationInstanceIdentifier() { 
179                EI retVal = this.getTypedField(4, 0);
180                return retVal;
181    }
182
183
184
185    /**
186     * Returns
187     * REL-5: "Target Information Instance Identifier" - creates it if necessary
188     */
189    public EI getTargetInformationInstanceIdentifier() { 
190                EI retVal = this.getTypedField(5, 0);
191                return retVal;
192    }
193    
194    /**
195     * Returns
196     * REL-5: "Target Information Instance Identifier" - creates it if necessary
197     */
198    public EI getRel5_TargetInformationInstanceIdentifier() { 
199                EI retVal = this.getTypedField(5, 0);
200                return retVal;
201    }
202
203
204
205    /**
206     * Returns
207     * REL-6: "Asserting Entity Instance ID" - creates it if necessary
208     */
209    public EI getAssertingEntityInstanceID() { 
210                EI retVal = this.getTypedField(6, 0);
211                return retVal;
212    }
213    
214    /**
215     * Returns
216     * REL-6: "Asserting Entity Instance ID" - creates it if necessary
217     */
218    public EI getRel6_AssertingEntityInstanceID() { 
219                EI retVal = this.getTypedField(6, 0);
220                return retVal;
221    }
222
223
224
225    /**
226     * Returns
227     * REL-7: "Asserting Person" - creates it if necessary
228     */
229    public XCN getAssertingPerson() { 
230                XCN retVal = this.getTypedField(7, 0);
231                return retVal;
232    }
233    
234    /**
235     * Returns
236     * REL-7: "Asserting Person" - creates it if necessary
237     */
238    public XCN getRel7_AssertingPerson() { 
239                XCN retVal = this.getTypedField(7, 0);
240                return retVal;
241    }
242
243
244
245    /**
246     * Returns
247     * REL-8: "Asserting Organization" - creates it if necessary
248     */
249    public XON getAssertingOrganization() { 
250                XON retVal = this.getTypedField(8, 0);
251                return retVal;
252    }
253    
254    /**
255     * Returns
256     * REL-8: "Asserting Organization" - creates it if necessary
257     */
258    public XON getRel8_AssertingOrganization() { 
259                XON retVal = this.getTypedField(8, 0);
260                return retVal;
261    }
262
263
264
265    /**
266     * Returns
267     * REL-9: "Assertor Address" - creates it if necessary
268     */
269    public XAD getAssertorAddress() { 
270                XAD retVal = this.getTypedField(9, 0);
271                return retVal;
272    }
273    
274    /**
275     * Returns
276     * REL-9: "Assertor Address" - creates it if necessary
277     */
278    public XAD getRel9_AssertorAddress() { 
279                XAD retVal = this.getTypedField(9, 0);
280                return retVal;
281    }
282
283
284
285    /**
286     * Returns
287     * REL-10: "Assertor Contact" - creates it if necessary
288     */
289    public XTN getAssertorContact() { 
290                XTN retVal = this.getTypedField(10, 0);
291                return retVal;
292    }
293    
294    /**
295     * Returns
296     * REL-10: "Assertor Contact" - creates it if necessary
297     */
298    public XTN getRel10_AssertorContact() { 
299                XTN retVal = this.getTypedField(10, 0);
300                return retVal;
301    }
302
303
304
305    /**
306     * Returns
307     * REL-11: "Assertion Date Range" - creates it if necessary
308     */
309    public DR getAssertionDateRange() { 
310                DR retVal = this.getTypedField(11, 0);
311                return retVal;
312    }
313    
314    /**
315     * Returns
316     * REL-11: "Assertion Date Range" - creates it if necessary
317     */
318    public DR getRel11_AssertionDateRange() { 
319                DR retVal = this.getTypedField(11, 0);
320                return retVal;
321    }
322
323
324
325    /**
326     * Returns
327     * REL-12: "Negation Indicator" - creates it if necessary
328     */
329    public ID getNegationIndicator() { 
330                ID retVal = this.getTypedField(12, 0);
331                return retVal;
332    }
333    
334    /**
335     * Returns
336     * REL-12: "Negation Indicator" - creates it if necessary
337     */
338    public ID getRel12_NegationIndicator() { 
339                ID retVal = this.getTypedField(12, 0);
340                return retVal;
341    }
342
343
344
345    /**
346     * Returns
347     * REL-13: "Certainty of Relationship" - creates it if necessary
348     */
349    public CWE getCertaintyOfRelationship() { 
350                CWE retVal = this.getTypedField(13, 0);
351                return retVal;
352    }
353    
354    /**
355     * Returns
356     * REL-13: "Certainty of Relationship" - creates it if necessary
357     */
358    public CWE getRel13_CertaintyOfRelationship() { 
359                CWE retVal = this.getTypedField(13, 0);
360                return retVal;
361    }
362
363
364
365    /**
366     * Returns
367     * REL-14: "Priority No" - creates it if necessary
368     */
369    public NM getPriorityNo() { 
370                NM retVal = this.getTypedField(14, 0);
371                return retVal;
372    }
373    
374    /**
375     * Returns
376     * REL-14: "Priority No" - creates it if necessary
377     */
378    public NM getRel14_PriorityNo() { 
379                NM retVal = this.getTypedField(14, 0);
380                return retVal;
381    }
382
383
384
385    /**
386     * Returns
387     * REL-15: "Priority  Sequence No (rel preference for consideration)" - creates it if necessary
388     */
389    public NM getPrioritySequenceNoRelpreferenceforconsideration() { 
390                NM retVal = this.getTypedField(15, 0);
391                return retVal;
392    }
393    
394    /**
395     * Returns
396     * REL-15: "Priority  Sequence No (rel preference for consideration)" - creates it if necessary
397     */
398    public NM getRel15_PrioritySequenceNoRelpreferenceforconsideration() { 
399                NM retVal = this.getTypedField(15, 0);
400                return retVal;
401    }
402
403
404
405    /**
406     * Returns
407     * REL-16: "Separability Indicator" - creates it if necessary
408     */
409    public ID getSeparabilityIndicator() { 
410                ID retVal = this.getTypedField(16, 0);
411                return retVal;
412    }
413    
414    /**
415     * Returns
416     * REL-16: "Separability Indicator" - creates it if necessary
417     */
418    public ID getRel16_SeparabilityIndicator() { 
419                ID retVal = this.getTypedField(16, 0);
420                return retVal;
421    }
422
423
424
425
426
427    /** {@inheritDoc} */   
428    protected Type createNewTypeWithoutReflection(int field) {
429       switch (field) {
430          case 0: return new SI(getMessage());
431          case 1: return new CWE(getMessage());
432          case 2: return new EI(getMessage());
433          case 3: return new EI(getMessage());
434          case 4: return new EI(getMessage());
435          case 5: return new EI(getMessage());
436          case 6: return new XCN(getMessage());
437          case 7: return new XON(getMessage());
438          case 8: return new XAD(getMessage());
439          case 9: return new XTN(getMessage());
440          case 10: return new DR(getMessage());
441          case 11: return new ID(getMessage(), new Integer( 136 ));
442          case 12: return new CWE(getMessage());
443          case 13: return new NM(getMessage());
444          case 14: return new NM(getMessage());
445          case 15: return new ID(getMessage(), new Integer( 136 ));
446          default: return null;
447       }
448   }
449
450
451}
452