![](/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 DataTypesEnumFactory implements EnumFactory<DataTypes> { 037 038 public DataTypes fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("Address".equals(codeString)) 042 return DataTypes.ADDRESS; 043 if ("Age".equals(codeString)) 044 return DataTypes.AGE; 045 if ("Annotation".equals(codeString)) 046 return DataTypes.ANNOTATION; 047 if ("Attachment".equals(codeString)) 048 return DataTypes.ATTACHMENT; 049 if ("BackboneElement".equals(codeString)) 050 return DataTypes.BACKBONEELEMENT; 051 if ("CodeableConcept".equals(codeString)) 052 return DataTypes.CODEABLECONCEPT; 053 if ("Coding".equals(codeString)) 054 return DataTypes.CODING; 055 if ("ContactDetail".equals(codeString)) 056 return DataTypes.CONTACTDETAIL; 057 if ("ContactPoint".equals(codeString)) 058 return DataTypes.CONTACTPOINT; 059 if ("Contributor".equals(codeString)) 060 return DataTypes.CONTRIBUTOR; 061 if ("Count".equals(codeString)) 062 return DataTypes.COUNT; 063 if ("DataRequirement".equals(codeString)) 064 return DataTypes.DATAREQUIREMENT; 065 if ("Distance".equals(codeString)) 066 return DataTypes.DISTANCE; 067 if ("Dosage".equals(codeString)) 068 return DataTypes.DOSAGE; 069 if ("Duration".equals(codeString)) 070 return DataTypes.DURATION; 071 if ("Element".equals(codeString)) 072 return DataTypes.ELEMENT; 073 if ("ElementDefinition".equals(codeString)) 074 return DataTypes.ELEMENTDEFINITION; 075 if ("Expression".equals(codeString)) 076 return DataTypes.EXPRESSION; 077 if ("Extension".equals(codeString)) 078 return DataTypes.EXTENSION; 079 if ("HumanName".equals(codeString)) 080 return DataTypes.HUMANNAME; 081 if ("Identifier".equals(codeString)) 082 return DataTypes.IDENTIFIER; 083 if ("MarketingStatus".equals(codeString)) 084 return DataTypes.MARKETINGSTATUS; 085 if ("Meta".equals(codeString)) 086 return DataTypes.META; 087 if ("Money".equals(codeString)) 088 return DataTypes.MONEY; 089 if ("MoneyQuantity".equals(codeString)) 090 return DataTypes.MONEYQUANTITY; 091 if ("Narrative".equals(codeString)) 092 return DataTypes.NARRATIVE; 093 if ("ParameterDefinition".equals(codeString)) 094 return DataTypes.PARAMETERDEFINITION; 095 if ("Period".equals(codeString)) 096 return DataTypes.PERIOD; 097 if ("Population".equals(codeString)) 098 return DataTypes.POPULATION; 099 if ("ProdCharacteristic".equals(codeString)) 100 return DataTypes.PRODCHARACTERISTIC; 101 if ("ProductShelfLife".equals(codeString)) 102 return DataTypes.PRODUCTSHELFLIFE; 103 if ("Quantity".equals(codeString)) 104 return DataTypes.QUANTITY; 105 if ("Range".equals(codeString)) 106 return DataTypes.RANGE; 107 if ("Ratio".equals(codeString)) 108 return DataTypes.RATIO; 109 if ("Reference".equals(codeString)) 110 return DataTypes.REFERENCE; 111 if ("RelatedArtifact".equals(codeString)) 112 return DataTypes.RELATEDARTIFACT; 113 if ("SampledData".equals(codeString)) 114 return DataTypes.SAMPLEDDATA; 115 if ("Signature".equals(codeString)) 116 return DataTypes.SIGNATURE; 117 if ("SimpleQuantity".equals(codeString)) 118 return DataTypes.SIMPLEQUANTITY; 119 if ("SubstanceAmount".equals(codeString)) 120 return DataTypes.SUBSTANCEAMOUNT; 121 if ("Timing".equals(codeString)) 122 return DataTypes.TIMING; 123 if ("TriggerDefinition".equals(codeString)) 124 return DataTypes.TRIGGERDEFINITION; 125 if ("UsageContext".equals(codeString)) 126 return DataTypes.USAGECONTEXT; 127 if ("base64Binary".equals(codeString)) 128 return DataTypes.BASE64BINARY; 129 if ("boolean".equals(codeString)) 130 return DataTypes.BOOLEAN; 131 if ("canonical".equals(codeString)) 132 return DataTypes.CANONICAL; 133 if ("code".equals(codeString)) 134 return DataTypes.CODE; 135 if ("date".equals(codeString)) 136 return DataTypes.DATE; 137 if ("dateTime".equals(codeString)) 138 return DataTypes.DATETIME; 139 if ("decimal".equals(codeString)) 140 return DataTypes.DECIMAL; 141 if ("id".equals(codeString)) 142 return DataTypes.ID; 143 if ("instant".equals(codeString)) 144 return DataTypes.INSTANT; 145 if ("integer".equals(codeString)) 146 return DataTypes.INTEGER; 147 if ("markdown".equals(codeString)) 148 return DataTypes.MARKDOWN; 149 if ("oid".equals(codeString)) 150 return DataTypes.OID; 151 if ("positiveInt".equals(codeString)) 152 return DataTypes.POSITIVEINT; 153 if ("string".equals(codeString)) 154 return DataTypes.STRING; 155 if ("time".equals(codeString)) 156 return DataTypes.TIME; 157 if ("unsignedInt".equals(codeString)) 158 return DataTypes.UNSIGNEDINT; 159 if ("uri".equals(codeString)) 160 return DataTypes.URI; 161 if ("url".equals(codeString)) 162 return DataTypes.URL; 163 if ("uuid".equals(codeString)) 164 return DataTypes.UUID; 165 if ("xhtml".equals(codeString)) 166 return DataTypes.XHTML; 167 throw new IllegalArgumentException("Unknown DataTypes code '" + codeString + "'"); 168 } 169 170 public String toCode(DataTypes code) { 171 if (code == DataTypes.ADDRESS) 172 return "Address"; 173 if (code == DataTypes.AGE) 174 return "Age"; 175 if (code == DataTypes.ANNOTATION) 176 return "Annotation"; 177 if (code == DataTypes.ATTACHMENT) 178 return "Attachment"; 179 if (code == DataTypes.BACKBONEELEMENT) 180 return "BackboneElement"; 181 if (code == DataTypes.CODEABLECONCEPT) 182 return "CodeableConcept"; 183 if (code == DataTypes.CODING) 184 return "Coding"; 185 if (code == DataTypes.CONTACTDETAIL) 186 return "ContactDetail"; 187 if (code == DataTypes.CONTACTPOINT) 188 return "ContactPoint"; 189 if (code == DataTypes.CONTRIBUTOR) 190 return "Contributor"; 191 if (code == DataTypes.COUNT) 192 return "Count"; 193 if (code == DataTypes.DATAREQUIREMENT) 194 return "DataRequirement"; 195 if (code == DataTypes.DISTANCE) 196 return "Distance"; 197 if (code == DataTypes.DOSAGE) 198 return "Dosage"; 199 if (code == DataTypes.DURATION) 200 return "Duration"; 201 if (code == DataTypes.ELEMENT) 202 return "Element"; 203 if (code == DataTypes.ELEMENTDEFINITION) 204 return "ElementDefinition"; 205 if (code == DataTypes.EXPRESSION) 206 return "Expression"; 207 if (code == DataTypes.EXTENSION) 208 return "Extension"; 209 if (code == DataTypes.HUMANNAME) 210 return "HumanName"; 211 if (code == DataTypes.IDENTIFIER) 212 return "Identifier"; 213 if (code == DataTypes.MARKETINGSTATUS) 214 return "MarketingStatus"; 215 if (code == DataTypes.META) 216 return "Meta"; 217 if (code == DataTypes.MONEY) 218 return "Money"; 219 if (code == DataTypes.MONEYQUANTITY) 220 return "MoneyQuantity"; 221 if (code == DataTypes.NARRATIVE) 222 return "Narrative"; 223 if (code == DataTypes.PARAMETERDEFINITION) 224 return "ParameterDefinition"; 225 if (code == DataTypes.PERIOD) 226 return "Period"; 227 if (code == DataTypes.POPULATION) 228 return "Population"; 229 if (code == DataTypes.PRODCHARACTERISTIC) 230 return "ProdCharacteristic"; 231 if (code == DataTypes.PRODUCTSHELFLIFE) 232 return "ProductShelfLife"; 233 if (code == DataTypes.QUANTITY) 234 return "Quantity"; 235 if (code == DataTypes.RANGE) 236 return "Range"; 237 if (code == DataTypes.RATIO) 238 return "Ratio"; 239 if (code == DataTypes.REFERENCE) 240 return "Reference"; 241 if (code == DataTypes.RELATEDARTIFACT) 242 return "RelatedArtifact"; 243 if (code == DataTypes.SAMPLEDDATA) 244 return "SampledData"; 245 if (code == DataTypes.SIGNATURE) 246 return "Signature"; 247 if (code == DataTypes.SIMPLEQUANTITY) 248 return "SimpleQuantity"; 249 if (code == DataTypes.SUBSTANCEAMOUNT) 250 return "SubstanceAmount"; 251 if (code == DataTypes.TIMING) 252 return "Timing"; 253 if (code == DataTypes.TRIGGERDEFINITION) 254 return "TriggerDefinition"; 255 if (code == DataTypes.USAGECONTEXT) 256 return "UsageContext"; 257 if (code == DataTypes.BASE64BINARY) 258 return "base64Binary"; 259 if (code == DataTypes.BOOLEAN) 260 return "boolean"; 261 if (code == DataTypes.CANONICAL) 262 return "canonical"; 263 if (code == DataTypes.CODE) 264 return "code"; 265 if (code == DataTypes.DATE) 266 return "date"; 267 if (code == DataTypes.DATETIME) 268 return "dateTime"; 269 if (code == DataTypes.DECIMAL) 270 return "decimal"; 271 if (code == DataTypes.ID) 272 return "id"; 273 if (code == DataTypes.INSTANT) 274 return "instant"; 275 if (code == DataTypes.INTEGER) 276 return "integer"; 277 if (code == DataTypes.MARKDOWN) 278 return "markdown"; 279 if (code == DataTypes.OID) 280 return "oid"; 281 if (code == DataTypes.POSITIVEINT) 282 return "positiveInt"; 283 if (code == DataTypes.STRING) 284 return "string"; 285 if (code == DataTypes.TIME) 286 return "time"; 287 if (code == DataTypes.UNSIGNEDINT) 288 return "unsignedInt"; 289 if (code == DataTypes.URI) 290 return "uri"; 291 if (code == DataTypes.URL) 292 return "url"; 293 if (code == DataTypes.UUID) 294 return "uuid"; 295 if (code == DataTypes.XHTML) 296 return "xhtml"; 297 return "?"; 298 } 299 300 public String toSystem(DataTypes code) { 301 return code.getSystem(); 302 } 303 304}