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 NST message segment (Application control level statistics). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>NST-1: Statistics Available (ID) <b> </b>
052     * <li>NST-2: Source Identifier (ST) <b>optional </b>
053     * <li>NST-3: Source Type (ID) <b>optional </b>
054     * <li>NST-4: Statistics Start (DTM) <b>optional </b>
055     * <li>NST-5: Statistics End (DTM) <b>optional </b>
056     * <li>NST-6: Receive Character Count (NM) <b>optional </b>
057     * <li>NST-7: Send Character Count (NM) <b>optional </b>
058     * <li>NST-8: Messages Received (NM) <b>optional </b>
059     * <li>NST-9: Messages Sent (NM) <b>optional </b>
060     * <li>NST-10: Checksum Errors Received (NM) <b>optional </b>
061     * <li>NST-11: Length Errors Received (NM) <b>optional </b>
062     * <li>NST-12: Other Errors Received (NM) <b>optional </b>
063     * <li>NST-13: Connect Timeouts (NM) <b>optional </b>
064     * <li>NST-14: Receive Timeouts (NM) <b>optional </b>
065     * <li>NST-15: Application control-level Errors (NM) <b>optional </b>
066 * </ul>
067 */
068@SuppressWarnings("unused")
069public class NST extends AbstractSegment {
070
071    /** 
072     * Creates a new NST segment
073     */
074    public NST(Group parent, ModelClassFactory factory) {
075       super(parent, factory);
076       init(factory);
077    }
078
079    private void init(ModelClassFactory factory) {
080       try {
081                                              this.add(ID.class, true, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Statistics Available");
082                                  this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Source Identifier");
083                                              this.add(ID.class, false, 1, 3, new Object[]{ getMessage(), new Integer(332) }, "Source Type");
084                                  this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Statistics Start");
085                                  this.add(DTM.class, false, 1, 24, new Object[]{ getMessage() }, "Statistics End");
086                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Receive Character Count");
087                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Send Character Count");
088                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Messages Received");
089                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Messages Sent");
090                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Checksum Errors Received");
091                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Length Errors Received");
092                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Other Errors Received");
093                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Connect Timeouts");
094                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Receive Timeouts");
095                                  this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Application control-level Errors");
096       } catch(HL7Exception e) {
097          log.error("Unexpected error creating NST - this is probably a bug in the source code generator.", e);
098       }
099    }
100
101
102
103    /**
104     * Returns
105     * NST-1: "Statistics Available" - creates it if necessary
106     */
107    public ID getStatisticsAvailable() { 
108                ID retVal = this.getTypedField(1, 0);
109                return retVal;
110    }
111    
112    /**
113     * Returns
114     * NST-1: "Statistics Available" - creates it if necessary
115     */
116    public ID getNst1_StatisticsAvailable() { 
117                ID retVal = this.getTypedField(1, 0);
118                return retVal;
119    }
120
121
122
123    /**
124     * Returns
125     * NST-2: "Source Identifier" - creates it if necessary
126     */
127    public ST getSourceIdentifier() { 
128                ST retVal = this.getTypedField(2, 0);
129                return retVal;
130    }
131    
132    /**
133     * Returns
134     * NST-2: "Source Identifier" - creates it if necessary
135     */
136    public ST getNst2_SourceIdentifier() { 
137                ST retVal = this.getTypedField(2, 0);
138                return retVal;
139    }
140
141
142
143    /**
144     * Returns
145     * NST-3: "Source Type" - creates it if necessary
146     */
147    public ID getSourceType() { 
148                ID retVal = this.getTypedField(3, 0);
149                return retVal;
150    }
151    
152    /**
153     * Returns
154     * NST-3: "Source Type" - creates it if necessary
155     */
156    public ID getNst3_SourceType() { 
157                ID retVal = this.getTypedField(3, 0);
158                return retVal;
159    }
160
161
162
163    /**
164     * Returns
165     * NST-4: "Statistics Start" - creates it if necessary
166     */
167    public DTM getStatisticsStart() { 
168                DTM retVal = this.getTypedField(4, 0);
169                return retVal;
170    }
171    
172    /**
173     * Returns
174     * NST-4: "Statistics Start" - creates it if necessary
175     */
176    public DTM getNst4_StatisticsStart() { 
177                DTM retVal = this.getTypedField(4, 0);
178                return retVal;
179    }
180
181
182
183    /**
184     * Returns
185     * NST-5: "Statistics End" - creates it if necessary
186     */
187    public DTM getStatisticsEnd() { 
188                DTM retVal = this.getTypedField(5, 0);
189                return retVal;
190    }
191    
192    /**
193     * Returns
194     * NST-5: "Statistics End" - creates it if necessary
195     */
196    public DTM getNst5_StatisticsEnd() { 
197                DTM retVal = this.getTypedField(5, 0);
198                return retVal;
199    }
200
201
202
203    /**
204     * Returns
205     * NST-6: "Receive Character Count" - creates it if necessary
206     */
207    public NM getReceiveCharacterCount() { 
208                NM retVal = this.getTypedField(6, 0);
209                return retVal;
210    }
211    
212    /**
213     * Returns
214     * NST-6: "Receive Character Count" - creates it if necessary
215     */
216    public NM getNst6_ReceiveCharacterCount() { 
217                NM retVal = this.getTypedField(6, 0);
218                return retVal;
219    }
220
221
222
223    /**
224     * Returns
225     * NST-7: "Send Character Count" - creates it if necessary
226     */
227    public NM getSendCharacterCount() { 
228                NM retVal = this.getTypedField(7, 0);
229                return retVal;
230    }
231    
232    /**
233     * Returns
234     * NST-7: "Send Character Count" - creates it if necessary
235     */
236    public NM getNst7_SendCharacterCount() { 
237                NM retVal = this.getTypedField(7, 0);
238                return retVal;
239    }
240
241
242
243    /**
244     * Returns
245     * NST-8: "Messages Received" - creates it if necessary
246     */
247    public NM getMessagesReceived() { 
248                NM retVal = this.getTypedField(8, 0);
249                return retVal;
250    }
251    
252    /**
253     * Returns
254     * NST-8: "Messages Received" - creates it if necessary
255     */
256    public NM getNst8_MessagesReceived() { 
257                NM retVal = this.getTypedField(8, 0);
258                return retVal;
259    }
260
261
262
263    /**
264     * Returns
265     * NST-9: "Messages Sent" - creates it if necessary
266     */
267    public NM getMessagesSent() { 
268                NM retVal = this.getTypedField(9, 0);
269                return retVal;
270    }
271    
272    /**
273     * Returns
274     * NST-9: "Messages Sent" - creates it if necessary
275     */
276    public NM getNst9_MessagesSent() { 
277                NM retVal = this.getTypedField(9, 0);
278                return retVal;
279    }
280
281
282
283    /**
284     * Returns
285     * NST-10: "Checksum Errors Received" - creates it if necessary
286     */
287    public NM getChecksumErrorsReceived() { 
288                NM retVal = this.getTypedField(10, 0);
289                return retVal;
290    }
291    
292    /**
293     * Returns
294     * NST-10: "Checksum Errors Received" - creates it if necessary
295     */
296    public NM getNst10_ChecksumErrorsReceived() { 
297                NM retVal = this.getTypedField(10, 0);
298                return retVal;
299    }
300
301
302
303    /**
304     * Returns
305     * NST-11: "Length Errors Received" - creates it if necessary
306     */
307    public NM getLengthErrorsReceived() { 
308                NM retVal = this.getTypedField(11, 0);
309                return retVal;
310    }
311    
312    /**
313     * Returns
314     * NST-11: "Length Errors Received" - creates it if necessary
315     */
316    public NM getNst11_LengthErrorsReceived() { 
317                NM retVal = this.getTypedField(11, 0);
318                return retVal;
319    }
320
321
322
323    /**
324     * Returns
325     * NST-12: "Other Errors Received" - creates it if necessary
326     */
327    public NM getOtherErrorsReceived() { 
328                NM retVal = this.getTypedField(12, 0);
329                return retVal;
330    }
331    
332    /**
333     * Returns
334     * NST-12: "Other Errors Received" - creates it if necessary
335     */
336    public NM getNst12_OtherErrorsReceived() { 
337                NM retVal = this.getTypedField(12, 0);
338                return retVal;
339    }
340
341
342
343    /**
344     * Returns
345     * NST-13: "Connect Timeouts" - creates it if necessary
346     */
347    public NM getConnectTimeouts() { 
348                NM retVal = this.getTypedField(13, 0);
349                return retVal;
350    }
351    
352    /**
353     * Returns
354     * NST-13: "Connect Timeouts" - creates it if necessary
355     */
356    public NM getNst13_ConnectTimeouts() { 
357                NM retVal = this.getTypedField(13, 0);
358                return retVal;
359    }
360
361
362
363    /**
364     * Returns
365     * NST-14: "Receive Timeouts" - creates it if necessary
366     */
367    public NM getReceiveTimeouts() { 
368                NM retVal = this.getTypedField(14, 0);
369                return retVal;
370    }
371    
372    /**
373     * Returns
374     * NST-14: "Receive Timeouts" - creates it if necessary
375     */
376    public NM getNst14_ReceiveTimeouts() { 
377                NM retVal = this.getTypedField(14, 0);
378                return retVal;
379    }
380
381
382
383    /**
384     * Returns
385     * NST-15: "Application control-level Errors" - creates it if necessary
386     */
387    public NM getApplicationControlLevelErrors() { 
388                NM retVal = this.getTypedField(15, 0);
389                return retVal;
390    }
391    
392    /**
393     * Returns
394     * NST-15: "Application control-level Errors" - creates it if necessary
395     */
396    public NM getNst15_ApplicationControlLevelErrors() { 
397                NM retVal = this.getTypedField(15, 0);
398                return retVal;
399    }
400
401
402
403
404
405    /** {@inheritDoc} */   
406    protected Type createNewTypeWithoutReflection(int field) {
407       switch (field) {
408          case 0: return new ID(getMessage(), new Integer( 136 ));
409          case 1: return new ST(getMessage());
410          case 2: return new ID(getMessage(), new Integer( 332 ));
411          case 3: return new DTM(getMessage());
412          case 4: return new DTM(getMessage());
413          case 5: return new NM(getMessage());
414          case 6: return new NM(getMessage());
415          case 7: return new NM(getMessage());
416          case 8: return new NM(getMessage());
417          case 9: return new NM(getMessage());
418          case 10: return new NM(getMessage());
419          case 11: return new NM(getMessage());
420          case 12: return new NM(getMessage());
421          case 13: return new NM(getMessage());
422          case 14: return new NM(getMessage());
423          default: return null;
424       }
425   }
426
427
428}
429