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