001package org.hl7.fhir.dstu3.model.codesystems;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum ChromosomeHuman {
041
042        /**
043         * chromosome 1
044         */
045        _1, 
046        /**
047         * chromosome 2
048         */
049        _2, 
050        /**
051         * chromosome 3
052         */
053        _3, 
054        /**
055         * chromosome 4
056         */
057        _4, 
058        /**
059         * chromosome 5
060         */
061        _5, 
062        /**
063         * chromosome 6
064         */
065        _6, 
066        /**
067         * chromosome 7
068         */
069        _7, 
070        /**
071         * chromosome 8
072         */
073        _8, 
074        /**
075         * chromosome 9
076         */
077        _9, 
078        /**
079         * chromosome 10
080         */
081        _10, 
082        /**
083         * chromosome 11
084         */
085        _11, 
086        /**
087         * chromosome 12
088         */
089        _12, 
090        /**
091         * chromosome 13
092         */
093        _13, 
094        /**
095         * chromosome 14
096         */
097        _14, 
098        /**
099         * chromosome 15
100         */
101        _15, 
102        /**
103         * chromosome 16
104         */
105        _16, 
106        /**
107         * chromosome 17
108         */
109        _17, 
110        /**
111         * chromosome 18
112         */
113        _18, 
114        /**
115         * chromosome 19
116         */
117        _19, 
118        /**
119         * chromosome 20
120         */
121        _20, 
122        /**
123         * chromosome 21
124         */
125        _21, 
126        /**
127         * chromosome 22
128         */
129        _22, 
130        /**
131         * chromosome X
132         */
133        X, 
134        /**
135         * chromosome Y
136         */
137        Y, 
138        /**
139         * added to help the parsers
140         */
141        NULL;
142        public static ChromosomeHuman fromCode(String codeString) throws FHIRException {
143            if (codeString == null || "".equals(codeString))
144                return null;
145        if ("1".equals(codeString))
146          return _1;
147        if ("2".equals(codeString))
148          return _2;
149        if ("3".equals(codeString))
150          return _3;
151        if ("4".equals(codeString))
152          return _4;
153        if ("5".equals(codeString))
154          return _5;
155        if ("6".equals(codeString))
156          return _6;
157        if ("7".equals(codeString))
158          return _7;
159        if ("8".equals(codeString))
160          return _8;
161        if ("9".equals(codeString))
162          return _9;
163        if ("10".equals(codeString))
164          return _10;
165        if ("11".equals(codeString))
166          return _11;
167        if ("12".equals(codeString))
168          return _12;
169        if ("13".equals(codeString))
170          return _13;
171        if ("14".equals(codeString))
172          return _14;
173        if ("15".equals(codeString))
174          return _15;
175        if ("16".equals(codeString))
176          return _16;
177        if ("17".equals(codeString))
178          return _17;
179        if ("18".equals(codeString))
180          return _18;
181        if ("19".equals(codeString))
182          return _19;
183        if ("20".equals(codeString))
184          return _20;
185        if ("21".equals(codeString))
186          return _21;
187        if ("22".equals(codeString))
188          return _22;
189        if ("X".equals(codeString))
190          return X;
191        if ("Y".equals(codeString))
192          return Y;
193        throw new FHIRException("Unknown ChromosomeHuman code '"+codeString+"'");
194        }
195        public String toCode() {
196          switch (this) {
197            case _1: return "1";
198            case _2: return "2";
199            case _3: return "3";
200            case _4: return "4";
201            case _5: return "5";
202            case _6: return "6";
203            case _7: return "7";
204            case _8: return "8";
205            case _9: return "9";
206            case _10: return "10";
207            case _11: return "11";
208            case _12: return "12";
209            case _13: return "13";
210            case _14: return "14";
211            case _15: return "15";
212            case _16: return "16";
213            case _17: return "17";
214            case _18: return "18";
215            case _19: return "19";
216            case _20: return "20";
217            case _21: return "21";
218            case _22: return "22";
219            case X: return "X";
220            case Y: return "Y";
221            case NULL: return null;
222            default: return "?";
223          }
224        }
225        public String getSystem() {
226          return "http://hl7.org/fhir/chromosome-human";
227        }
228        public String getDefinition() {
229          switch (this) {
230            case _1: return "chromosome 1";
231            case _2: return "chromosome 2";
232            case _3: return "chromosome 3";
233            case _4: return "chromosome 4";
234            case _5: return "chromosome 5";
235            case _6: return "chromosome 6";
236            case _7: return "chromosome 7";
237            case _8: return "chromosome 8";
238            case _9: return "chromosome 9";
239            case _10: return "chromosome 10";
240            case _11: return "chromosome 11";
241            case _12: return "chromosome 12";
242            case _13: return "chromosome 13";
243            case _14: return "chromosome 14";
244            case _15: return "chromosome 15";
245            case _16: return "chromosome 16";
246            case _17: return "chromosome 17";
247            case _18: return "chromosome 18";
248            case _19: return "chromosome 19";
249            case _20: return "chromosome 20";
250            case _21: return "chromosome 21";
251            case _22: return "chromosome 22";
252            case X: return "chromosome X";
253            case Y: return "chromosome Y";
254            case NULL: return null;
255            default: return "?";
256          }
257        }
258        public String getDisplay() {
259          switch (this) {
260            case _1: return "chromosome 1";
261            case _2: return "chromosome 2";
262            case _3: return "chromosome 3";
263            case _4: return "chromosome 4";
264            case _5: return "chromosome 5";
265            case _6: return "chromosome 6";
266            case _7: return "chromosome 7";
267            case _8: return "chromosome 8";
268            case _9: return "chromosome 9";
269            case _10: return "chromosome 10";
270            case _11: return "chromosome 11";
271            case _12: return "chromosome 12";
272            case _13: return "chromosome 13";
273            case _14: return "chromosome 14";
274            case _15: return "chromosome 15";
275            case _16: return "chromosome 16";
276            case _17: return "chromosome 17";
277            case _18: return "chromosome 18";
278            case _19: return "chromosome 19";
279            case _20: return "chromosome 20";
280            case _21: return "chromosome 21";
281            case _22: return "chromosome 22";
282            case X: return "chromosome X";
283            case Y: return "chromosome Y";
284            case NULL: return null;
285            default: return "?";
286          }
287    }
288
289
290}