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 ChromosomeHuman {
037
038  /**
039   * chromosome 1.
040   */
041  _1,
042  /**
043   * chromosome 2.
044   */
045  _2,
046  /**
047   * chromosome 3.
048   */
049  _3,
050  /**
051   * chromosome 4.
052   */
053  _4,
054  /**
055   * chromosome 5.
056   */
057  _5,
058  /**
059   * chromosome 6.
060   */
061  _6,
062  /**
063   * chromosome 7.
064   */
065  _7,
066  /**
067   * chromosome 8.
068   */
069  _8,
070  /**
071   * chromosome 9.
072   */
073  _9,
074  /**
075   * chromosome 10.
076   */
077  _10,
078  /**
079   * chromosome 11.
080   */
081  _11,
082  /**
083   * chromosome 12.
084   */
085  _12,
086  /**
087   * chromosome 13.
088   */
089  _13,
090  /**
091   * chromosome 14.
092   */
093  _14,
094  /**
095   * chromosome 15.
096   */
097  _15,
098  /**
099   * chromosome 16.
100   */
101  _16,
102  /**
103   * chromosome 17.
104   */
105  _17,
106  /**
107   * chromosome 18.
108   */
109  _18,
110  /**
111   * chromosome 19.
112   */
113  _19,
114  /**
115   * chromosome 20.
116   */
117  _20,
118  /**
119   * chromosome 21.
120   */
121  _21,
122  /**
123   * chromosome 22.
124   */
125  _22,
126  /**
127   * chromosome X.
128   */
129  X,
130  /**
131   * chromosome Y.
132   */
133  Y,
134  /**
135   * added to help the parsers
136   */
137  NULL;
138
139  public static ChromosomeHuman fromCode(String codeString) throws FHIRException {
140    if (codeString == null || "".equals(codeString))
141      return null;
142    if ("1".equals(codeString))
143      return _1;
144    if ("2".equals(codeString))
145      return _2;
146    if ("3".equals(codeString))
147      return _3;
148    if ("4".equals(codeString))
149      return _4;
150    if ("5".equals(codeString))
151      return _5;
152    if ("6".equals(codeString))
153      return _6;
154    if ("7".equals(codeString))
155      return _7;
156    if ("8".equals(codeString))
157      return _8;
158    if ("9".equals(codeString))
159      return _9;
160    if ("10".equals(codeString))
161      return _10;
162    if ("11".equals(codeString))
163      return _11;
164    if ("12".equals(codeString))
165      return _12;
166    if ("13".equals(codeString))
167      return _13;
168    if ("14".equals(codeString))
169      return _14;
170    if ("15".equals(codeString))
171      return _15;
172    if ("16".equals(codeString))
173      return _16;
174    if ("17".equals(codeString))
175      return _17;
176    if ("18".equals(codeString))
177      return _18;
178    if ("19".equals(codeString))
179      return _19;
180    if ("20".equals(codeString))
181      return _20;
182    if ("21".equals(codeString))
183      return _21;
184    if ("22".equals(codeString))
185      return _22;
186    if ("X".equals(codeString))
187      return X;
188    if ("Y".equals(codeString))
189      return Y;
190    throw new FHIRException("Unknown ChromosomeHuman code '" + codeString + "'");
191  }
192
193  public String toCode() {
194    switch (this) {
195    case _1:
196      return "1";
197    case _2:
198      return "2";
199    case _3:
200      return "3";
201    case _4:
202      return "4";
203    case _5:
204      return "5";
205    case _6:
206      return "6";
207    case _7:
208      return "7";
209    case _8:
210      return "8";
211    case _9:
212      return "9";
213    case _10:
214      return "10";
215    case _11:
216      return "11";
217    case _12:
218      return "12";
219    case _13:
220      return "13";
221    case _14:
222      return "14";
223    case _15:
224      return "15";
225    case _16:
226      return "16";
227    case _17:
228      return "17";
229    case _18:
230      return "18";
231    case _19:
232      return "19";
233    case _20:
234      return "20";
235    case _21:
236      return "21";
237    case _22:
238      return "22";
239    case X:
240      return "X";
241    case Y:
242      return "Y";
243    case NULL:
244      return null;
245    default:
246      return "?";
247    }
248  }
249
250  public String getSystem() {
251    return "http://terminology.hl7.org/CodeSystem/chromosome-human";
252  }
253
254  public String getDefinition() {
255    switch (this) {
256    case _1:
257      return "chromosome 1.";
258    case _2:
259      return "chromosome 2.";
260    case _3:
261      return "chromosome 3.";
262    case _4:
263      return "chromosome 4.";
264    case _5:
265      return "chromosome 5.";
266    case _6:
267      return "chromosome 6.";
268    case _7:
269      return "chromosome 7.";
270    case _8:
271      return "chromosome 8.";
272    case _9:
273      return "chromosome 9.";
274    case _10:
275      return "chromosome 10.";
276    case _11:
277      return "chromosome 11.";
278    case _12:
279      return "chromosome 12.";
280    case _13:
281      return "chromosome 13.";
282    case _14:
283      return "chromosome 14.";
284    case _15:
285      return "chromosome 15.";
286    case _16:
287      return "chromosome 16.";
288    case _17:
289      return "chromosome 17.";
290    case _18:
291      return "chromosome 18.";
292    case _19:
293      return "chromosome 19.";
294    case _20:
295      return "chromosome 20.";
296    case _21:
297      return "chromosome 21.";
298    case _22:
299      return "chromosome 22.";
300    case X:
301      return "chromosome X.";
302    case Y:
303      return "chromosome Y.";
304    case NULL:
305      return null;
306    default:
307      return "?";
308    }
309  }
310
311  public String getDisplay() {
312    switch (this) {
313    case _1:
314      return "chromosome 1";
315    case _2:
316      return "chromosome 2";
317    case _3:
318      return "chromosome 3";
319    case _4:
320      return "chromosome 4";
321    case _5:
322      return "chromosome 5";
323    case _6:
324      return "chromosome 6";
325    case _7:
326      return "chromosome 7";
327    case _8:
328      return "chromosome 8";
329    case _9:
330      return "chromosome 9";
331    case _10:
332      return "chromosome 10";
333    case _11:
334      return "chromosome 11";
335    case _12:
336      return "chromosome 12";
337    case _13:
338      return "chromosome 13";
339    case _14:
340      return "chromosome 14";
341    case _15:
342      return "chromosome 15";
343    case _16:
344      return "chromosome 16";
345    case _17:
346      return "chromosome 17";
347    case _18:
348      return "chromosome 18";
349    case _19:
350      return "chromosome 19";
351    case _20:
352      return "chromosome 20";
353    case _21:
354      return "chromosome 21";
355    case _22:
356      return "chromosome 22";
357    case X:
358      return "chromosome X";
359    case Y:
360      return "chromosome Y";
361    case NULL:
362      return null;
363    default:
364      return "?";
365    }
366  }
367
368}