View Javadoc
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.v25.segment;
35  
36  // import ca.uhn.hl7v2.model.v25.group.*;
37  import ca.uhn.hl7v2.model.v25.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 NSC message segment (Application Status Change). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>NSC-1: Application Change Type (IS) <b> </b>
53       * <li>NSC-2: Current CPU (ST) <b>optional </b>
54       * <li>NSC-3: Current Fileserver (ST) <b>optional </b>
55       * <li>NSC-4: Current Application (HD) <b>optional </b>
56       * <li>NSC-5: Current Facility (HD) <b>optional </b>
57       * <li>NSC-6: New CPU (ST) <b>optional </b>
58       * <li>NSC-7: New Fileserver (ST) <b>optional </b>
59       * <li>NSC-8: New Application (HD) <b>optional </b>
60       * <li>NSC-9: New Facility (HD) <b>optional </b>
61   * </ul>
62   */
63  @SuppressWarnings("unused")
64  public class NSC extends AbstractSegment {
65  
66      /** 
67       * Creates a new NSC segment
68       */
69      public NSC(Group parent, ModelClassFactory factory) {
70         super(parent, factory);
71         init(factory);
72      }
73  
74      private void init(ModelClassFactory factory) {
75         try {
76                                                this.add(IS.class, true, 1, 4, new Object[]{ getMessage(), new Integer(409) }, "Application Change Type");
77                                    this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Current CPU");
78                                    this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Current Fileserver");
79                                    this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "Current Application");
80                                    this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "Current Facility");
81                                    this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "New CPU");
82                                    this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "New Fileserver");
83                                    this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "New Application");
84                                    this.add(HD.class, false, 1, 30, new Object[]{ getMessage() }, "New Facility");
85         } catch(HL7Exception e) {
86            log.error("Unexpected error creating NSC - this is probably a bug in the source code generator.", e);
87         }
88      }
89  
90  
91  
92      /**
93       * Returns
94       * NSC-1: "Application Change Type" - creates it if necessary
95       */
96      public IS getApplicationChangeType() { 
97  		IS retVal = this.getTypedField(1, 0);
98  		return retVal;
99      }
100     
101     /**
102      * Returns
103      * NSC-1: "Application Change Type" - creates it if necessary
104      */
105     public IS getNsc1_ApplicationChangeType() { 
106 		IS retVal = this.getTypedField(1, 0);
107 		return retVal;
108     }
109 
110 
111 
112     /**
113      * Returns
114      * NSC-2: "Current CPU" - creates it if necessary
115      */
116     public ST getCurrentCPU() { 
117 		ST retVal = this.getTypedField(2, 0);
118 		return retVal;
119     }
120     
121     /**
122      * Returns
123      * NSC-2: "Current CPU" - creates it if necessary
124      */
125     public ST getNsc2_CurrentCPU() { 
126 		ST retVal = this.getTypedField(2, 0);
127 		return retVal;
128     }
129 
130 
131 
132     /**
133      * Returns
134      * NSC-3: "Current Fileserver" - creates it if necessary
135      */
136     public ST getCurrentFileserver() { 
137 		ST retVal = this.getTypedField(3, 0);
138 		return retVal;
139     }
140     
141     /**
142      * Returns
143      * NSC-3: "Current Fileserver" - creates it if necessary
144      */
145     public ST getNsc3_CurrentFileserver() { 
146 		ST retVal = this.getTypedField(3, 0);
147 		return retVal;
148     }
149 
150 
151 
152     /**
153      * Returns
154      * NSC-4: "Current Application" - creates it if necessary
155      */
156     public HD getCurrentApplication() { 
157 		HD retVal = this.getTypedField(4, 0);
158 		return retVal;
159     }
160     
161     /**
162      * Returns
163      * NSC-4: "Current Application" - creates it if necessary
164      */
165     public HD getNsc4_CurrentApplication() { 
166 		HD retVal = this.getTypedField(4, 0);
167 		return retVal;
168     }
169 
170 
171 
172     /**
173      * Returns
174      * NSC-5: "Current Facility" - creates it if necessary
175      */
176     public HD getCurrentFacility() { 
177 		HD retVal = this.getTypedField(5, 0);
178 		return retVal;
179     }
180     
181     /**
182      * Returns
183      * NSC-5: "Current Facility" - creates it if necessary
184      */
185     public HD getNsc5_CurrentFacility() { 
186 		HD retVal = this.getTypedField(5, 0);
187 		return retVal;
188     }
189 
190 
191 
192     /**
193      * Returns
194      * NSC-6: "New CPU" - creates it if necessary
195      */
196     public ST getNewCPU() { 
197 		ST retVal = this.getTypedField(6, 0);
198 		return retVal;
199     }
200     
201     /**
202      * Returns
203      * NSC-6: "New CPU" - creates it if necessary
204      */
205     public ST getNsc6_NewCPU() { 
206 		ST retVal = this.getTypedField(6, 0);
207 		return retVal;
208     }
209 
210 
211 
212     /**
213      * Returns
214      * NSC-7: "New Fileserver" - creates it if necessary
215      */
216     public ST getNewFileserver() { 
217 		ST retVal = this.getTypedField(7, 0);
218 		return retVal;
219     }
220     
221     /**
222      * Returns
223      * NSC-7: "New Fileserver" - creates it if necessary
224      */
225     public ST getNsc7_NewFileserver() { 
226 		ST retVal = this.getTypedField(7, 0);
227 		return retVal;
228     }
229 
230 
231 
232     /**
233      * Returns
234      * NSC-8: "New Application" - creates it if necessary
235      */
236     public HD getNewApplication() { 
237 		HD retVal = this.getTypedField(8, 0);
238 		return retVal;
239     }
240     
241     /**
242      * Returns
243      * NSC-8: "New Application" - creates it if necessary
244      */
245     public HD getNsc8_NewApplication() { 
246 		HD retVal = this.getTypedField(8, 0);
247 		return retVal;
248     }
249 
250 
251 
252     /**
253      * Returns
254      * NSC-9: "New Facility" - creates it if necessary
255      */
256     public HD getNewFacility() { 
257 		HD retVal = this.getTypedField(9, 0);
258 		return retVal;
259     }
260     
261     /**
262      * Returns
263      * NSC-9: "New Facility" - creates it if necessary
264      */
265     public HD getNsc9_NewFacility() { 
266 		HD retVal = this.getTypedField(9, 0);
267 		return retVal;
268     }
269 
270 
271 
272 
273 
274     /** {@inheritDoc} */   
275     protected Type createNewTypeWithoutReflection(int field) {
276        switch (field) {
277           case 0: return new IS(getMessage(), new Integer( 409 ));
278           case 1: return new ST(getMessage());
279           case 2: return new ST(getMessage());
280           case 3: return new HD(getMessage());
281           case 4: return new HD(getMessage());
282           case 5: return new ST(getMessage());
283           case 6: return new ST(getMessage());
284           case 7: return new HD(getMessage());
285           case 8: return new HD(getMessage());
286           default: return null;
287        }
288    }
289 
290 
291 }
292