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.v27.segment;
035
036// import ca.uhn.hl7v2.model.v27.group.*;
037import ca.uhn.hl7v2.model.v27.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/**
049 *<p>Represents an HL7 SCP message segment (Sterilizer Configuration (Anti-Microbial Devices)). 
050 * This segment has the following fields:</p>
051 * <ul>
052     * <li>SCP-1: Number Of Decontamination/Sterilization Devices (NM) <b>optional </b>
053     * <li>SCP-2: Labor Calculation Type (CWE) <b>optional </b>
054     * <li>SCP-3: Date Format (CWE) <b>optional </b>
055     * <li>SCP-4: Device Number (EI) <b>optional </b>
056     * <li>SCP-5: Device Name (ST) <b>optional </b>
057     * <li>SCP-6: Device Model Name (ST) <b>optional </b>
058     * <li>SCP-7: Device Type (CWE) <b>optional </b>
059     * <li>SCP-8: Lot Control (CWE) <b>optional </b>
060 * </ul>
061 */
062@SuppressWarnings("unused")
063public class SCP extends AbstractSegment {
064
065    /** 
066     * Creates a new SCP segment
067     */
068    public SCP(Group parent, ModelClassFactory factory) {
069       super(parent, factory);
070       init(factory);
071    }
072
073    private void init(ModelClassFactory factory) {
074       try {
075                                  this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Number Of Decontamination/Sterilization Devices");
076                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Labor Calculation Type");
077                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Date Format");
078                                  this.add(EI.class, false, 1, 0, new Object[]{ getMessage() }, "Device Number");
079                                  this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Device Name");
080                                  this.add(ST.class, false, 1, 0, new Object[]{ getMessage() }, "Device Model Name");
081                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Device Type");
082                                  this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Lot Control");
083       } catch(HL7Exception e) {
084          log.error("Unexpected error creating SCP - this is probably a bug in the source code generator.", e);
085       }
086    }
087
088
089
090    /**
091     * Returns
092     * SCP-1: "Number Of Decontamination/Sterilization Devices" - creates it if necessary
093     */
094    public NM getNumberOfDecontaminationSterilizationDevices() { 
095                NM retVal = this.getTypedField(1, 0);
096                return retVal;
097    }
098    
099    /**
100     * Returns
101     * SCP-1: "Number Of Decontamination/Sterilization Devices" - creates it if necessary
102     */
103    public NM getScp1_NumberOfDecontaminationSterilizationDevices() { 
104                NM retVal = this.getTypedField(1, 0);
105                return retVal;
106    }
107
108
109
110    /**
111     * Returns
112     * SCP-2: "Labor Calculation Type" - creates it if necessary
113     */
114    public CWE getLaborCalculationType() { 
115                CWE retVal = this.getTypedField(2, 0);
116                return retVal;
117    }
118    
119    /**
120     * Returns
121     * SCP-2: "Labor Calculation Type" - creates it if necessary
122     */
123    public CWE getScp2_LaborCalculationType() { 
124                CWE retVal = this.getTypedField(2, 0);
125                return retVal;
126    }
127
128
129
130    /**
131     * Returns
132     * SCP-3: "Date Format" - creates it if necessary
133     */
134    public CWE getDateFormat() { 
135                CWE retVal = this.getTypedField(3, 0);
136                return retVal;
137    }
138    
139    /**
140     * Returns
141     * SCP-3: "Date Format" - creates it if necessary
142     */
143    public CWE getScp3_DateFormat() { 
144                CWE retVal = this.getTypedField(3, 0);
145                return retVal;
146    }
147
148
149
150    /**
151     * Returns
152     * SCP-4: "Device Number" - creates it if necessary
153     */
154    public EI getDeviceNumber() { 
155                EI retVal = this.getTypedField(4, 0);
156                return retVal;
157    }
158    
159    /**
160     * Returns
161     * SCP-4: "Device Number" - creates it if necessary
162     */
163    public EI getScp4_DeviceNumber() { 
164                EI retVal = this.getTypedField(4, 0);
165                return retVal;
166    }
167
168
169
170    /**
171     * Returns
172     * SCP-5: "Device Name" - creates it if necessary
173     */
174    public ST getDeviceName() { 
175                ST retVal = this.getTypedField(5, 0);
176                return retVal;
177    }
178    
179    /**
180     * Returns
181     * SCP-5: "Device Name" - creates it if necessary
182     */
183    public ST getScp5_DeviceName() { 
184                ST retVal = this.getTypedField(5, 0);
185                return retVal;
186    }
187
188
189
190    /**
191     * Returns
192     * SCP-6: "Device Model Name" - creates it if necessary
193     */
194    public ST getDeviceModelName() { 
195                ST retVal = this.getTypedField(6, 0);
196                return retVal;
197    }
198    
199    /**
200     * Returns
201     * SCP-6: "Device Model Name" - creates it if necessary
202     */
203    public ST getScp6_DeviceModelName() { 
204                ST retVal = this.getTypedField(6, 0);
205                return retVal;
206    }
207
208
209
210    /**
211     * Returns
212     * SCP-7: "Device Type" - creates it if necessary
213     */
214    public CWE getDeviceType() { 
215                CWE retVal = this.getTypedField(7, 0);
216                return retVal;
217    }
218    
219    /**
220     * Returns
221     * SCP-7: "Device Type" - creates it if necessary
222     */
223    public CWE getScp7_DeviceType() { 
224                CWE retVal = this.getTypedField(7, 0);
225                return retVal;
226    }
227
228
229
230    /**
231     * Returns
232     * SCP-8: "Lot Control" - creates it if necessary
233     */
234    public CWE getLotControl() { 
235                CWE retVal = this.getTypedField(8, 0);
236                return retVal;
237    }
238    
239    /**
240     * Returns
241     * SCP-8: "Lot Control" - creates it if necessary
242     */
243    public CWE getScp8_LotControl() { 
244                CWE retVal = this.getTypedField(8, 0);
245                return retVal;
246    }
247
248
249
250
251
252    /** {@inheritDoc} */   
253    protected Type createNewTypeWithoutReflection(int field) {
254       switch (field) {
255          case 0: return new NM(getMessage());
256          case 1: return new CWE(getMessage());
257          case 2: return new CWE(getMessage());
258          case 3: return new EI(getMessage());
259          case 4: return new ST(getMessage());
260          case 5: return new ST(getMessage());
261          case 6: return new CWE(getMessage());
262          case 7: return new CWE(getMessage());
263          default: return null;
264       }
265   }
266
267
268}
269