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.NULL) 128 return null; 129 if (code == Tooth._0) 130 return "0"; 131 if (code == Tooth._1) 132 return "1"; 133 if (code == Tooth._2) 134 return "2"; 135 if (code == Tooth._3) 136 return "3"; 137 if (code == Tooth._4) 138 return "4"; 139 if (code == Tooth._5) 140 return "5"; 141 if (code == Tooth._6) 142 return "6"; 143 if (code == Tooth._7) 144 return "7"; 145 if (code == Tooth._8) 146 return "8"; 147 if (code == Tooth._11) 148 return "11"; 149 if (code == Tooth._12) 150 return "12"; 151 if (code == Tooth._13) 152 return "13"; 153 if (code == Tooth._14) 154 return "14"; 155 if (code == Tooth._15) 156 return "15"; 157 if (code == Tooth._16) 158 return "16"; 159 if (code == Tooth._17) 160 return "17"; 161 if (code == Tooth._18) 162 return "18"; 163 if (code == Tooth._21) 164 return "21"; 165 if (code == Tooth._22) 166 return "22"; 167 if (code == Tooth._23) 168 return "23"; 169 if (code == Tooth._24) 170 return "24"; 171 if (code == Tooth._25) 172 return "25"; 173 if (code == Tooth._26) 174 return "26"; 175 if (code == Tooth._27) 176 return "27"; 177 if (code == Tooth._28) 178 return "28"; 179 if (code == Tooth._31) 180 return "31"; 181 if (code == Tooth._32) 182 return "32"; 183 if (code == Tooth._33) 184 return "33"; 185 if (code == Tooth._34) 186 return "34"; 187 if (code == Tooth._35) 188 return "35"; 189 if (code == Tooth._36) 190 return "36"; 191 if (code == Tooth._37) 192 return "37"; 193 if (code == Tooth._38) 194 return "38"; 195 if (code == Tooth._41) 196 return "41"; 197 if (code == Tooth._42) 198 return "42"; 199 if (code == Tooth._43) 200 return "43"; 201 if (code == Tooth._44) 202 return "44"; 203 if (code == Tooth._45) 204 return "45"; 205 if (code == Tooth._46) 206 return "46"; 207 if (code == Tooth._47) 208 return "47"; 209 if (code == Tooth._48) 210 return "48"; 211 return "?"; 212 } 213 214 public String toSystem(Tooth code) { 215 return code.getSystem(); 216 } 217 218}