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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0 033 034 035import org.hl7.fhir.r4.model.EnumFactory; 036 037public class TeethEnumFactory implements EnumFactory<Teeth> { 038 039 public Teeth fromCode(String codeString) throws IllegalArgumentException { 040 if (codeString == null || "".equals(codeString)) 041 return null; 042 if ("11".equals(codeString)) 043 return Teeth._11; 044 if ("12".equals(codeString)) 045 return Teeth._12; 046 if ("13".equals(codeString)) 047 return Teeth._13; 048 if ("14".equals(codeString)) 049 return Teeth._14; 050 if ("15".equals(codeString)) 051 return Teeth._15; 052 if ("16".equals(codeString)) 053 return Teeth._16; 054 if ("17".equals(codeString)) 055 return Teeth._17; 056 if ("18".equals(codeString)) 057 return Teeth._18; 058 if ("21".equals(codeString)) 059 return Teeth._21; 060 if ("22".equals(codeString)) 061 return Teeth._22; 062 if ("23".equals(codeString)) 063 return Teeth._23; 064 if ("24".equals(codeString)) 065 return Teeth._24; 066 if ("25".equals(codeString)) 067 return Teeth._25; 068 if ("26".equals(codeString)) 069 return Teeth._26; 070 if ("27".equals(codeString)) 071 return Teeth._27; 072 if ("28".equals(codeString)) 073 return Teeth._28; 074 if ("31".equals(codeString)) 075 return Teeth._31; 076 if ("32".equals(codeString)) 077 return Teeth._32; 078 if ("33".equals(codeString)) 079 return Teeth._33; 080 if ("34".equals(codeString)) 081 return Teeth._34; 082 if ("35".equals(codeString)) 083 return Teeth._35; 084 if ("36".equals(codeString)) 085 return Teeth._36; 086 if ("37".equals(codeString)) 087 return Teeth._37; 088 if ("38".equals(codeString)) 089 return Teeth._38; 090 if ("41".equals(codeString)) 091 return Teeth._41; 092 if ("42".equals(codeString)) 093 return Teeth._42; 094 if ("43".equals(codeString)) 095 return Teeth._43; 096 if ("44".equals(codeString)) 097 return Teeth._44; 098 if ("45".equals(codeString)) 099 return Teeth._45; 100 if ("46".equals(codeString)) 101 return Teeth._46; 102 if ("47".equals(codeString)) 103 return Teeth._47; 104 if ("48".equals(codeString)) 105 return Teeth._48; 106 throw new IllegalArgumentException("Unknown Teeth code '"+codeString+"'"); 107 } 108 109 public String toCode(Teeth code) { 110 if (code == Teeth._11) 111 return "11"; 112 if (code == Teeth._12) 113 return "12"; 114 if (code == Teeth._13) 115 return "13"; 116 if (code == Teeth._14) 117 return "14"; 118 if (code == Teeth._15) 119 return "15"; 120 if (code == Teeth._16) 121 return "16"; 122 if (code == Teeth._17) 123 return "17"; 124 if (code == Teeth._18) 125 return "18"; 126 if (code == Teeth._21) 127 return "21"; 128 if (code == Teeth._22) 129 return "22"; 130 if (code == Teeth._23) 131 return "23"; 132 if (code == Teeth._24) 133 return "24"; 134 if (code == Teeth._25) 135 return "25"; 136 if (code == Teeth._26) 137 return "26"; 138 if (code == Teeth._27) 139 return "27"; 140 if (code == Teeth._28) 141 return "28"; 142 if (code == Teeth._31) 143 return "31"; 144 if (code == Teeth._32) 145 return "32"; 146 if (code == Teeth._33) 147 return "33"; 148 if (code == Teeth._34) 149 return "34"; 150 if (code == Teeth._35) 151 return "35"; 152 if (code == Teeth._36) 153 return "36"; 154 if (code == Teeth._37) 155 return "37"; 156 if (code == Teeth._38) 157 return "38"; 158 if (code == Teeth._41) 159 return "41"; 160 if (code == Teeth._42) 161 return "42"; 162 if (code == Teeth._43) 163 return "43"; 164 if (code == Teeth._44) 165 return "44"; 166 if (code == Teeth._45) 167 return "45"; 168 if (code == Teeth._46) 169 return "46"; 170 if (code == Teeth._47) 171 return "47"; 172 if (code == Teeth._48) 173 return "48"; 174 return "?"; 175 } 176 177 public String toSystem(Teeth code) { 178 return code.getSystem(); 179 } 180 181} 182