001package org.hl7.fhir.r4.model.codesystems;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r4
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
054
055
056import org.hl7.fhir.r4.model.EnumFactory;
057
058public class ToothEnumFactory implements EnumFactory<Tooth> {
059
060  public Tooth fromCode(String codeString) throws IllegalArgumentException {
061    if (codeString == null || "".equals(codeString))
062      return null;
063    if ("0".equals(codeString))
064      return Tooth._0;
065    if ("1".equals(codeString))
066      return Tooth._1;
067    if ("2".equals(codeString))
068      return Tooth._2;
069    if ("3".equals(codeString))
070      return Tooth._3;
071    if ("4".equals(codeString))
072      return Tooth._4;
073    if ("5".equals(codeString))
074      return Tooth._5;
075    if ("6".equals(codeString))
076      return Tooth._6;
077    if ("7".equals(codeString))
078      return Tooth._7;
079    if ("8".equals(codeString))
080      return Tooth._8;
081    if ("11".equals(codeString))
082      return Tooth._11;
083    if ("12".equals(codeString))
084      return Tooth._12;
085    if ("13".equals(codeString))
086      return Tooth._13;
087    if ("14".equals(codeString))
088      return Tooth._14;
089    if ("15".equals(codeString))
090      return Tooth._15;
091    if ("16".equals(codeString))
092      return Tooth._16;
093    if ("17".equals(codeString))
094      return Tooth._17;
095    if ("18".equals(codeString))
096      return Tooth._18;
097    if ("21".equals(codeString))
098      return Tooth._21;
099    if ("22".equals(codeString))
100      return Tooth._22;
101    if ("23".equals(codeString))
102      return Tooth._23;
103    if ("24".equals(codeString))
104      return Tooth._24;
105    if ("25".equals(codeString))
106      return Tooth._25;
107    if ("26".equals(codeString))
108      return Tooth._26;
109    if ("27".equals(codeString))
110      return Tooth._27;
111    if ("28".equals(codeString))
112      return Tooth._28;
113    if ("31".equals(codeString))
114      return Tooth._31;
115    if ("32".equals(codeString))
116      return Tooth._32;
117    if ("33".equals(codeString))
118      return Tooth._33;
119    if ("34".equals(codeString))
120      return Tooth._34;
121    if ("35".equals(codeString))
122      return Tooth._35;
123    if ("36".equals(codeString))
124      return Tooth._36;
125    if ("37".equals(codeString))
126      return Tooth._37;
127    if ("38".equals(codeString))
128      return Tooth._38;
129    if ("41".equals(codeString))
130      return Tooth._41;
131    if ("42".equals(codeString))
132      return Tooth._42;
133    if ("43".equals(codeString))
134      return Tooth._43;
135    if ("44".equals(codeString))
136      return Tooth._44;
137    if ("45".equals(codeString))
138      return Tooth._45;
139    if ("46".equals(codeString))
140      return Tooth._46;
141    if ("47".equals(codeString))
142      return Tooth._47;
143    if ("48".equals(codeString))
144      return Tooth._48;
145    throw new IllegalArgumentException("Unknown Tooth code '"+codeString+"'");
146  }
147
148  public String toCode(Tooth code) {
149    if (code == Tooth._0)
150      return "0";
151    if (code == Tooth._1)
152      return "1";
153    if (code == Tooth._2)
154      return "2";
155    if (code == Tooth._3)
156      return "3";
157    if (code == Tooth._4)
158      return "4";
159    if (code == Tooth._5)
160      return "5";
161    if (code == Tooth._6)
162      return "6";
163    if (code == Tooth._7)
164      return "7";
165    if (code == Tooth._8)
166      return "8";
167    if (code == Tooth._11)
168      return "11";
169    if (code == Tooth._12)
170      return "12";
171    if (code == Tooth._13)
172      return "13";
173    if (code == Tooth._14)
174      return "14";
175    if (code == Tooth._15)
176      return "15";
177    if (code == Tooth._16)
178      return "16";
179    if (code == Tooth._17)
180      return "17";
181    if (code == Tooth._18)
182      return "18";
183    if (code == Tooth._21)
184      return "21";
185    if (code == Tooth._22)
186      return "22";
187    if (code == Tooth._23)
188      return "23";
189    if (code == Tooth._24)
190      return "24";
191    if (code == Tooth._25)
192      return "25";
193    if (code == Tooth._26)
194      return "26";
195    if (code == Tooth._27)
196      return "27";
197    if (code == Tooth._28)
198      return "28";
199    if (code == Tooth._31)
200      return "31";
201    if (code == Tooth._32)
202      return "32";
203    if (code == Tooth._33)
204      return "33";
205    if (code == Tooth._34)
206      return "34";
207    if (code == Tooth._35)
208      return "35";
209    if (code == Tooth._36)
210      return "36";
211    if (code == Tooth._37)
212      return "37";
213    if (code == Tooth._38)
214      return "38";
215    if (code == Tooth._41)
216      return "41";
217    if (code == Tooth._42)
218      return "42";
219    if (code == Tooth._43)
220      return "43";
221    if (code == Tooth._44)
222      return "44";
223    if (code == Tooth._45)
224      return "45";
225    if (code == Tooth._46)
226      return "46";
227    if (code == Tooth._47)
228      return "47";
229    if (code == Tooth._48)
230      return "48";
231    return "?";
232  }
233
234    public String toSystem(Tooth code) {
235      return code.getSystem();
236      }
237
238}
239