001package org.hl7.fhir.r4.model.codesystems;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
033
034import org.hl7.fhir.exceptions.FHIRException;
035
036public enum FHIRVersion {
037
038  /**
039   * Oldest archived version of FHIR.
040   */
041  _0_01,
042  /**
043   * 1st Draft for Comment (Sept 2012 Ballot).
044   */
045  _0_05,
046  /**
047   * 2nd Draft for Comment (January 2013 Ballot).
048   */
049  _0_06,
050  /**
051   * DSTU 1 Ballot version.
052   */
053  _0_11,
054  /**
055   * DSTU 1 Official version.
056   */
057  _0_0_80,
058  /**
059   * DSTU 1 Official version Technical Errata #1.
060   */
061  _0_0_81,
062  /**
063   * DSTU 1 Official version Technical Errata #2.
064   */
065  _0_0_82,
066  /**
067   * Draft For Comment (January 2015 Ballot).
068   */
069  _0_4_0,
070  /**
071   * DSTU 2 Ballot version (May 2015 Ballot).
072   */
073  _0_5_0,
074  /**
075   * DSTU 2 QA Preview + CQIF Ballot (Sep 2015).
076   */
077  _1_0_0,
078  /**
079   * DSTU 2 (Official version).
080   */
081  _1_0_1,
082  /**
083   * DSTU 2 (Official version) with 1 technical errata.
084   */
085  _1_0_2,
086  /**
087   * GAO Ballot + draft changes to main FHIR standard.
088   */
089  _1_1_0,
090  /**
091   * CQF on FHIR Ballot + Connectathon 12 (Montreal).
092   */
093  _1_4_0,
094  /**
095   * FHIR STU3 Ballot + Connectathon 13 (Baltimore).
096   */
097  _1_6_0,
098  /**
099   * FHIR STU3 Candidate + Connectathon 14 (San Antonio).
100   */
101  _1_8_0,
102  /**
103   * FHIR Release 3 (STU).
104   */
105  _3_0_0,
106  /**
107   * FHIR Release 3 (STU) with 1 technical errata.
108   */
109  _3_0_1,
110  /**
111   * R4 Ballot #1.
112   */
113  _3_3_0,
114  /**
115   * R4 Ballot #2.
116   */
117  _3_5_0,
118  /**
119   * FHIR Release 4 (Normative + STU).
120   */
121  _4_0_0,
122  /**
123   * added to help the parsers
124   */
125  NULL;
126
127  public static FHIRVersion fromCode(String codeString) throws FHIRException {
128    if (codeString == null || "".equals(codeString))
129      return null;
130    if ("0.01".equals(codeString))
131      return _0_01;
132    if ("0.05".equals(codeString))
133      return _0_05;
134    if ("0.06".equals(codeString))
135      return _0_06;
136    if ("0.11".equals(codeString))
137      return _0_11;
138    if ("0.0.80".equals(codeString))
139      return _0_0_80;
140    if ("0.0.81".equals(codeString))
141      return _0_0_81;
142    if ("0.0.82".equals(codeString))
143      return _0_0_82;
144    if ("0.4.0".equals(codeString))
145      return _0_4_0;
146    if ("0.5.0".equals(codeString))
147      return _0_5_0;
148    if ("1.0.0".equals(codeString))
149      return _1_0_0;
150    if ("1.0.1".equals(codeString))
151      return _1_0_1;
152    if ("1.0.2".equals(codeString))
153      return _1_0_2;
154    if ("1.1.0".equals(codeString))
155      return _1_1_0;
156    if ("1.4.0".equals(codeString))
157      return _1_4_0;
158    if ("1.6.0".equals(codeString))
159      return _1_6_0;
160    if ("1.8.0".equals(codeString))
161      return _1_8_0;
162    if ("3.0.0".equals(codeString))
163      return _3_0_0;
164    if ("3.0.1".equals(codeString))
165      return _3_0_1;
166    if ("3.3.0".equals(codeString))
167      return _3_3_0;
168    if ("3.5.0".equals(codeString))
169      return _3_5_0;
170    if ("4.0.0".equals(codeString))
171      return _4_0_0;
172    throw new FHIRException("Unknown FHIRVersion code '" + codeString + "'");
173  }
174
175  public String toCode() {
176    switch (this) {
177    case _0_01:
178      return "0.01";
179    case _0_05:
180      return "0.05";
181    case _0_06:
182      return "0.06";
183    case _0_11:
184      return "0.11";
185    case _0_0_80:
186      return "0.0.80";
187    case _0_0_81:
188      return "0.0.81";
189    case _0_0_82:
190      return "0.0.82";
191    case _0_4_0:
192      return "0.4.0";
193    case _0_5_0:
194      return "0.5.0";
195    case _1_0_0:
196      return "1.0.0";
197    case _1_0_1:
198      return "1.0.1";
199    case _1_0_2:
200      return "1.0.2";
201    case _1_1_0:
202      return "1.1.0";
203    case _1_4_0:
204      return "1.4.0";
205    case _1_6_0:
206      return "1.6.0";
207    case _1_8_0:
208      return "1.8.0";
209    case _3_0_0:
210      return "3.0.0";
211    case _3_0_1:
212      return "3.0.1";
213    case _3_3_0:
214      return "3.3.0";
215    case _3_5_0:
216      return "3.5.0";
217    case _4_0_0:
218      return "4.0.0";
219    case NULL:
220      return null;
221    default:
222      return "?";
223    }
224  }
225
226  public String getSystem() {
227    return "http://hl7.org/fhir/FHIR-version";
228  }
229
230  public String getDefinition() {
231    switch (this) {
232    case _0_01:
233      return "Oldest archived version of FHIR.";
234    case _0_05:
235      return "1st Draft for Comment (Sept 2012 Ballot).";
236    case _0_06:
237      return "2nd Draft for Comment (January 2013 Ballot).";
238    case _0_11:
239      return "DSTU 1 Ballot version.";
240    case _0_0_80:
241      return "DSTU 1 Official version.";
242    case _0_0_81:
243      return "DSTU 1 Official version Technical Errata #1.";
244    case _0_0_82:
245      return "DSTU 1 Official version Technical Errata #2.";
246    case _0_4_0:
247      return "Draft For Comment (January 2015 Ballot).";
248    case _0_5_0:
249      return "DSTU 2 Ballot version (May 2015 Ballot).";
250    case _1_0_0:
251      return "DSTU 2 QA Preview + CQIF Ballot (Sep 2015).";
252    case _1_0_1:
253      return "DSTU 2 (Official version).";
254    case _1_0_2:
255      return "DSTU 2 (Official version) with 1 technical errata.";
256    case _1_1_0:
257      return "GAO Ballot + draft changes to main FHIR standard.";
258    case _1_4_0:
259      return "CQF on FHIR Ballot + Connectathon 12 (Montreal).";
260    case _1_6_0:
261      return "FHIR STU3 Ballot + Connectathon 13 (Baltimore).";
262    case _1_8_0:
263      return "FHIR STU3 Candidate + Connectathon 14 (San Antonio).";
264    case _3_0_0:
265      return "FHIR Release 3 (STU).";
266    case _3_0_1:
267      return "FHIR Release 3 (STU) with 1 technical errata.";
268    case _3_3_0:
269      return "R4 Ballot #1.";
270    case _3_5_0:
271      return "R4 Ballot #2.";
272    case _4_0_0:
273      return "FHIR Release 4 (Normative + STU).";
274    case NULL:
275      return null;
276    default:
277      return "?";
278    }
279  }
280
281  public String getDisplay() {
282    switch (this) {
283    case _0_01:
284      return "0.01";
285    case _0_05:
286      return "0.05";
287    case _0_06:
288      return "0.06";
289    case _0_11:
290      return "0.11";
291    case _0_0_80:
292      return "0.0.80";
293    case _0_0_81:
294      return "0.0.81";
295    case _0_0_82:
296      return "0.0.82";
297    case _0_4_0:
298      return "0.4.0";
299    case _0_5_0:
300      return "0.5.0";
301    case _1_0_0:
302      return "1.0.0";
303    case _1_0_1:
304      return "1.0.1";
305    case _1_0_2:
306      return "1.0.2";
307    case _1_1_0:
308      return "1.1.0";
309    case _1_4_0:
310      return "1.4.0";
311    case _1_6_0:
312      return "1.6.0";
313    case _1_8_0:
314      return "1.8.0";
315    case _3_0_0:
316      return "3.0.0";
317    case _3_0_1:
318      return "3.0.1";
319    case _3_3_0:
320      return "3.3.0";
321    case _3_5_0:
322      return "3.5.0";
323    case _4_0_0:
324      return "4.0.0";
325    case NULL:
326      return null;
327    default:
328      return "?";
329    }
330  }
331
332}