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