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.dstu3.model.EnumFactory;
039
040public class ToothEnumFactory implements EnumFactory<Tooth> {
041
042  public Tooth fromCode(String codeString) throws IllegalArgumentException {
043    if (codeString == null || "".equals(codeString))
044      return null;
045    if ("0".equals(codeString))
046      return Tooth._0;
047    if ("1".equals(codeString))
048      return Tooth._1;
049    if ("2".equals(codeString))
050      return Tooth._2;
051    if ("3".equals(codeString))
052      return Tooth._3;
053    if ("4".equals(codeString))
054      return Tooth._4;
055    if ("5".equals(codeString))
056      return Tooth._5;
057    if ("6".equals(codeString))
058      return Tooth._6;
059    if ("7".equals(codeString))
060      return Tooth._7;
061    if ("8".equals(codeString))
062      return Tooth._8;
063    if ("11".equals(codeString))
064      return Tooth._11;
065    if ("12".equals(codeString))
066      return Tooth._12;
067    if ("13".equals(codeString))
068      return Tooth._13;
069    if ("14".equals(codeString))
070      return Tooth._14;
071    if ("15".equals(codeString))
072      return Tooth._15;
073    if ("16".equals(codeString))
074      return Tooth._16;
075    if ("17".equals(codeString))
076      return Tooth._17;
077    if ("18".equals(codeString))
078      return Tooth._18;
079    if ("21".equals(codeString))
080      return Tooth._21;
081    if ("22".equals(codeString))
082      return Tooth._22;
083    if ("23".equals(codeString))
084      return Tooth._23;
085    if ("24".equals(codeString))
086      return Tooth._24;
087    if ("25".equals(codeString))
088      return Tooth._25;
089    if ("26".equals(codeString))
090      return Tooth._26;
091    if ("27".equals(codeString))
092      return Tooth._27;
093    if ("28".equals(codeString))
094      return Tooth._28;
095    if ("31".equals(codeString))
096      return Tooth._31;
097    if ("32".equals(codeString))
098      return Tooth._32;
099    if ("33".equals(codeString))
100      return Tooth._33;
101    if ("34".equals(codeString))
102      return Tooth._34;
103    if ("35".equals(codeString))
104      return Tooth._35;
105    if ("36".equals(codeString))
106      return Tooth._36;
107    if ("37".equals(codeString))
108      return Tooth._37;
109    if ("38".equals(codeString))
110      return Tooth._38;
111    if ("41".equals(codeString))
112      return Tooth._41;
113    if ("42".equals(codeString))
114      return Tooth._42;
115    if ("43".equals(codeString))
116      return Tooth._43;
117    if ("44".equals(codeString))
118      return Tooth._44;
119    if ("45".equals(codeString))
120      return Tooth._45;
121    if ("46".equals(codeString))
122      return Tooth._46;
123    if ("47".equals(codeString))
124      return Tooth._47;
125    if ("48".equals(codeString))
126      return Tooth._48;
127    throw new IllegalArgumentException("Unknown Tooth code '"+codeString+"'");
128  }
129
130  public String toCode(Tooth code) {
131       if (code == Tooth.NULL)
132           return null;
133       if (code == Tooth._0)
134      return "0";
135    if (code == Tooth._1)
136      return "1";
137    if (code == Tooth._2)
138      return "2";
139    if (code == Tooth._3)
140      return "3";
141    if (code == Tooth._4)
142      return "4";
143    if (code == Tooth._5)
144      return "5";
145    if (code == Tooth._6)
146      return "6";
147    if (code == Tooth._7)
148      return "7";
149    if (code == Tooth._8)
150      return "8";
151    if (code == Tooth._11)
152      return "11";
153    if (code == Tooth._12)
154      return "12";
155    if (code == Tooth._13)
156      return "13";
157    if (code == Tooth._14)
158      return "14";
159    if (code == Tooth._15)
160      return "15";
161    if (code == Tooth._16)
162      return "16";
163    if (code == Tooth._17)
164      return "17";
165    if (code == Tooth._18)
166      return "18";
167    if (code == Tooth._21)
168      return "21";
169    if (code == Tooth._22)
170      return "22";
171    if (code == Tooth._23)
172      return "23";
173    if (code == Tooth._24)
174      return "24";
175    if (code == Tooth._25)
176      return "25";
177    if (code == Tooth._26)
178      return "26";
179    if (code == Tooth._27)
180      return "27";
181    if (code == Tooth._28)
182      return "28";
183    if (code == Tooth._31)
184      return "31";
185    if (code == Tooth._32)
186      return "32";
187    if (code == Tooth._33)
188      return "33";
189    if (code == Tooth._34)
190      return "34";
191    if (code == Tooth._35)
192      return "35";
193    if (code == Tooth._36)
194      return "36";
195    if (code == Tooth._37)
196      return "37";
197    if (code == Tooth._38)
198      return "38";
199    if (code == Tooth._41)
200      return "41";
201    if (code == Tooth._42)
202      return "42";
203    if (code == Tooth._43)
204      return "43";
205    if (code == Tooth._44)
206      return "44";
207    if (code == Tooth._45)
208      return "45";
209    if (code == Tooth._46)
210      return "46";
211    if (code == Tooth._47)
212      return "47";
213    if (code == Tooth._48)
214      return "48";
215    return "?";
216   }
217
218    public String toSystem(Tooth code) {
219      return code.getSystem();
220      }
221
222}