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.v251.segment;
035
036// import ca.uhn.hl7v2.model.v251.group.*;
037import ca.uhn.hl7v2.model.v251.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 NSC message segment (Application Status Change). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>NSC-1: Application Change Type (IS) <b> </b>
052     * <li>NSC-2: Current CPU (ST) <b>optional </b>
053     * <li>NSC-3: Current Fileserver (ST) <b>optional </b>
054     * <li>NSC-4: Current Application (HD) <b>optional </b>
055     * <li>NSC-5: Current Facility (HD) <b>optional </b>
056     * <li>NSC-6: New CPU (ST) <b>optional </b>
057     * <li>NSC-7: New Fileserver (ST) <b>optional </b>
058     * <li>NSC-8: New Application (HD) <b>optional </b>
059     * <li>NSC-9: New Facility (HD) <b>optional </b>
060 * </ul>
061 */
062@SuppressWarnings("unused")
063public class NSC extends AbstractSegment {
064
065    /** 
066     * Creates a new NSC segment
067     */
068    public NSC(Group parent, ModelClassFactory factory) {
069       super(parent, factory);
070       init(factory);
071    }
072
073    private void init(ModelClassFactory factory) {
074       try {
075                                              this.add(IS.class, true, 1, 4, new Object[]{ getMessage(), new Integer(409) }, "Application Change Type");
076                                  this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Current CPU");
077                                  this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Current Fileserver");
078                                  this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "Current Application");
079                                  this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "Current Facility");
080                                  this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "New CPU");
081                                  this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "New Fileserver");
082                                  this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "New Application");
083                                  this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "New Facility");
084       } catch(HL7Exception e) {
085          log.error("Unexpected error creating NSC - this is probably a bug in the source code generator.", e);
086       }
087    }
088
089
090
091    /**
092     * Returns
093     * NSC-1: "Application Change Type" - creates it if necessary
094     */
095    public IS getApplicationChangeType() { 
096                IS retVal = this.getTypedField(1, 0);
097                return retVal;
098    }
099    
100    /**
101     * Returns
102     * NSC-1: "Application Change Type" - creates it if necessary
103     */
104    public IS getNsc1_ApplicationChangeType() { 
105                IS retVal = this.getTypedField(1, 0);
106                return retVal;
107    }
108
109
110
111    /**
112     * Returns
113     * NSC-2: "Current CPU" - creates it if necessary
114     */
115    public ST getCurrentCPU() { 
116                ST retVal = this.getTypedField(2, 0);
117                return retVal;
118    }
119    
120    /**
121     * Returns
122     * NSC-2: "Current CPU" - creates it if necessary
123     */
124    public ST getNsc2_CurrentCPU() { 
125                ST retVal = this.getTypedField(2, 0);
126                return retVal;
127    }
128
129
130
131    /**
132     * Returns
133     * NSC-3: "Current Fileserver" - creates it if necessary
134     */
135    public ST getCurrentFileserver() { 
136                ST retVal = this.getTypedField(3, 0);
137                return retVal;
138    }
139    
140    /**
141     * Returns
142     * NSC-3: "Current Fileserver" - creates it if necessary
143     */
144    public ST getNsc3_CurrentFileserver() { 
145                ST retVal = this.getTypedField(3, 0);
146                return retVal;
147    }
148
149
150
151    /**
152     * Returns
153     * NSC-4: "Current Application" - creates it if necessary
154     */
155    public HD getCurrentApplication() { 
156                HD retVal = this.getTypedField(4, 0);
157                return retVal;
158    }
159    
160    /**
161     * Returns
162     * NSC-4: "Current Application" - creates it if necessary
163     */
164    public HD getNsc4_CurrentApplication() { 
165                HD retVal = this.getTypedField(4, 0);
166                return retVal;
167    }
168
169
170
171    /**
172     * Returns
173     * NSC-5: "Current Facility" - creates it if necessary
174     */
175    public HD getCurrentFacility() { 
176                HD retVal = this.getTypedField(5, 0);
177                return retVal;
178    }
179    
180    /**
181     * Returns
182     * NSC-5: "Current Facility" - creates it if necessary
183     */
184    public HD getNsc5_CurrentFacility() { 
185                HD retVal = this.getTypedField(5, 0);
186                return retVal;
187    }
188
189
190
191    /**
192     * Returns
193     * NSC-6: "New CPU" - creates it if necessary
194     */
195    public ST getNewCPU() { 
196                ST retVal = this.getTypedField(6, 0);
197                return retVal;
198    }
199    
200    /**
201     * Returns
202     * NSC-6: "New CPU" - creates it if necessary
203     */
204    public ST getNsc6_NewCPU() { 
205                ST retVal = this.getTypedField(6, 0);
206                return retVal;
207    }
208
209
210
211    /**
212     * Returns
213     * NSC-7: "New Fileserver" - creates it if necessary
214     */
215    public ST getNewFileserver() { 
216                ST retVal = this.getTypedField(7, 0);
217                return retVal;
218    }
219    
220    /**
221     * Returns
222     * NSC-7: "New Fileserver" - creates it if necessary
223     */
224    public ST getNsc7_NewFileserver() { 
225                ST retVal = this.getTypedField(7, 0);
226                return retVal;
227    }
228
229
230
231    /**
232     * Returns
233     * NSC-8: "New Application" - creates it if necessary
234     */
235    public HD getNewApplication() { 
236                HD retVal = this.getTypedField(8, 0);
237                return retVal;
238    }
239    
240    /**
241     * Returns
242     * NSC-8: "New Application" - creates it if necessary
243     */
244    public HD getNsc8_NewApplication() { 
245                HD retVal = this.getTypedField(8, 0);
246                return retVal;
247    }
248
249
250
251    /**
252     * Returns
253     * NSC-9: "New Facility" - creates it if necessary
254     */
255    public HD getNewFacility() { 
256                HD retVal = this.getTypedField(9, 0);
257                return retVal;
258    }
259    
260    /**
261     * Returns
262     * NSC-9: "New Facility" - creates it if necessary
263     */
264    public HD getNsc9_NewFacility() { 
265                HD retVal = this.getTypedField(9, 0);
266                return retVal;
267    }
268
269
270
271
272
273    /** {@inheritDoc} */   
274    protected Type createNewTypeWithoutReflection(int field) {
275       switch (field) {
276          case 0: return new IS(getMessage(), new Integer( 409 ));
277          case 1: return new ST(getMessage());
278          case 2: return new ST(getMessage());
279          case 3: return new HD(getMessage());
280          case 4: return new HD(getMessage());
281          case 5: return new ST(getMessage());
282          case 6: return new ST(getMessage());
283          case 7: return new HD(getMessage());
284          case 8: return new HD(getMessage());
285          default: return null;
286       }
287   }
288
289
290}
291