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.group;
035
036import ca.uhn.hl7v2.model.v27.segment.*;
037
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.model.*;
041
042/**
043 * <p>Represents a CCR_I16_CLINICAL_HISTORY_DETAIL group structure (a Group object).
044 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
045 * This Group contains the following elements:  
046 * </p>
047 * <ul>
048                         * <li>1: OBR (Observation Request) <b>  choice</b></li>
049                         * <li>2: ODS (Dietary Orders, Supplements, and Preferences) <b>  choice</b></li>
050                         * <li>3: PR1 (Procedures) <b>  choice</b></li>
051                         * <li>4: RF1 (Referral Information) <b>  choice</b></li>
052                         * <li>5: AL1 (Patient Allergy Information) <b>  choice</b></li>
053                         * <li>6: IAM (Patient Adverse Reaction Information) <b>  choice</b></li>
054                         * <li>7: ACC (Accident) <b>  choice</b></li>
055                         * <li>8: RMI (Risk Management Incident) <b>  choice</b></li>
056                         * <li>9: DB1 (Disability) <b>  choice</b></li>
057                         * <li>10: DG1 (Diagnosis) <b>  choice</b></li>
058                         * <li>11: DRG (Diagnosis Related Group) <b>  choice</b></li>
059                         * <li>12: OBX (Observation/Result) <b>optional repeating </b></li>
060 * </ul>
061 * <p>
062 * Note that this structure has "choice" elements. This means that one of the 
063 * structures above marked as "choice" must be present, but no more than one.
064 * </p> 
065 */
066//@SuppressWarnings("unused")
067public class CCR_I16_CLINICAL_HISTORY_DETAIL extends AbstractGroup {
068
069    /** 
070     * Creates a new CCR_I16_CLINICAL_HISTORY_DETAIL group
071     */
072    public CCR_I16_CLINICAL_HISTORY_DETAIL(Group parent, ModelClassFactory factory) {
073       super(parent, factory);
074       init(factory);
075    }
076
077    private void init(ModelClassFactory factory) {
078       try {
079                                  this.add(OBR.class, true, false, true);
080                                  this.add(ODS.class, true, false, true);
081                                  this.add(PR1.class, true, false, true);
082                                  this.add(RF1.class, true, false, true);
083                                  this.add(AL1.class, true, false, true);
084                                  this.add(IAM.class, true, false, true);
085                                  this.add(ACC.class, true, false, true);
086                                  this.add(RMI.class, true, false, true);
087                                  this.add(DB1.class, true, false, true);
088                                  this.add(DG1.class, true, false, true);
089                                  this.add(DRG.class, true, false, true);
090                                  this.add(OBX.class, false, true, false);
091       } catch(HL7Exception e) {
092          log.error("Unexpected error creating CCR_I16_CLINICAL_HISTORY_DETAIL - this is probably a bug in the source code generator.", e);
093       }
094    }
095
096    /** 
097     * Returns "2.7"
098     */
099    public String getVersion() {
100       return "2.7";
101    }
102
103
104
105    /**
106     * Returns
107     * OBR (Observation Request) - creates it if necessary
108     */
109    public OBR getOBR() { 
110       OBR retVal = getTyped("OBR", OBR.class);
111       return retVal;
112    }
113
114
115
116
117    /**
118     * Returns
119     * ODS (Dietary Orders, Supplements, and Preferences) - creates it if necessary
120     */
121    public ODS getODS() { 
122       ODS retVal = getTyped("ODS", ODS.class);
123       return retVal;
124    }
125
126
127
128
129    /**
130     * Returns
131     * PR1 (Procedures) - creates it if necessary
132     */
133    public PR1 getPR1() { 
134       PR1 retVal = getTyped("PR1", PR1.class);
135       return retVal;
136    }
137
138
139
140
141    /**
142     * Returns
143     * RF1 (Referral Information) - creates it if necessary
144     */
145    public RF1 getRF1() { 
146       RF1 retVal = getTyped("RF1", RF1.class);
147       return retVal;
148    }
149
150
151
152
153    /**
154     * Returns
155     * AL1 (Patient Allergy Information) - creates it if necessary
156     */
157    public AL1 getAL1() { 
158       AL1 retVal = getTyped("AL1", AL1.class);
159       return retVal;
160    }
161
162
163
164
165    /**
166     * Returns
167     * IAM (Patient Adverse Reaction Information) - creates it if necessary
168     */
169    public IAM getIAM() { 
170       IAM retVal = getTyped("IAM", IAM.class);
171       return retVal;
172    }
173
174
175
176
177    /**
178     * Returns
179     * ACC (Accident) - creates it if necessary
180     */
181    public ACC getACC() { 
182       ACC retVal = getTyped("ACC", ACC.class);
183       return retVal;
184    }
185
186
187
188
189    /**
190     * Returns
191     * RMI (Risk Management Incident) - creates it if necessary
192     */
193    public RMI getRMI() { 
194       RMI retVal = getTyped("RMI", RMI.class);
195       return retVal;
196    }
197
198
199
200
201    /**
202     * Returns
203     * DB1 (Disability) - creates it if necessary
204     */
205    public DB1 getDB1() { 
206       DB1 retVal = getTyped("DB1", DB1.class);
207       return retVal;
208    }
209
210
211
212
213    /**
214     * Returns
215     * DG1 (Diagnosis) - creates it if necessary
216     */
217    public DG1 getDG1() { 
218       DG1 retVal = getTyped("DG1", DG1.class);
219       return retVal;
220    }
221
222
223
224
225    /**
226     * Returns
227     * DRG (Diagnosis Related Group) - creates it if necessary
228     */
229    public DRG getDRG() { 
230       DRG retVal = getTyped("DRG", DRG.class);
231       return retVal;
232    }
233
234
235
236
237    /**
238     * Returns
239     * the first repetition of 
240     * OBX (Observation/Result) - creates it if necessary
241     */
242    public OBX getOBX() { 
243       OBX retVal = getTyped("OBX", OBX.class);
244       return retVal;
245    }
246
247
248    /**
249     * Returns a specific repetition of
250     * OBX (Observation/Result) - creates it if necessary
251     *
252     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
253     * @throws HL7Exception if the repetition requested is more than one 
254     *     greater than the number of existing repetitions.
255     */
256    public OBX getOBX(int rep) { 
257       OBX retVal = getTyped("OBX", rep, OBX.class);
258       return retVal;
259    }
260
261    /** 
262     * Returns the number of existing repetitions of OBX 
263     */ 
264    public int getOBXReps() {  
265        return getReps("OBX");
266    } 
267
268    /** 
269     * <p>
270     * Returns a non-modifiable List containing all current existing repetitions of OBX.
271     * <p>
272     * <p>
273     * Note that unlike {@link #getOBX()}, this method will not create any reps
274     * if none are already present, so an empty list may be returned.
275     * </p>
276     */ 
277    public java.util.List<OBX> getOBXAll() throws HL7Exception {
278        return getAllAsList("OBX", OBX.class);
279    } 
280
281    /**
282     * Inserts a specific repetition of OBX (Observation/Result)
283     * @see AbstractGroup#insertRepetition(Structure, int) 
284     */
285    public void insertOBX(OBX structure, int rep) throws HL7Exception { 
286       super.insertRepetition("OBX", structure, rep);
287    }
288
289
290    /**
291     * Inserts a specific repetition of OBX (Observation/Result)
292     * @see AbstractGroup#insertRepetition(Structure, int) 
293     */
294    public OBX insertOBX(int rep) throws HL7Exception { 
295       return (OBX)super.insertRepetition("OBX", rep);
296    }
297
298
299    /**
300     * Removes a specific repetition of OBX (Observation/Result)
301     * @see AbstractGroup#removeRepetition(String, int) 
302     */
303    public OBX removeOBX(int rep) throws HL7Exception { 
304       return (OBX)super.removeRepetition("OBX", rep);
305    }
306
307
308
309}
310