001package org.hl7.fhir.r4.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r4 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023 024/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, 034 this list of conditions and the following disclaimer in the documentation 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 049 POSSIBILITY OF SUCH DAMAGE. 050 051*/ 052 053// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 054 055 056import org.hl7.fhir.r4.model.EnumFactory; 057 058public class V3Hl7RealmEnumFactory implements EnumFactory<V3Hl7Realm> { 059 060 public V3Hl7Realm fromCode(String codeString) throws IllegalArgumentException { 061 if (codeString == null || "".equals(codeString)) 062 return null; 063 if ("BindingRealms".equals(codeString)) 064 return V3Hl7Realm.BINDINGREALMS; 065 if ("AffiliateRealms".equals(codeString)) 066 return V3Hl7Realm.AFFILIATEREALMS; 067 if ("AR".equals(codeString)) 068 return V3Hl7Realm.AR; 069 if ("AT".equals(codeString)) 070 return V3Hl7Realm.AT; 071 if ("AU".equals(codeString)) 072 return V3Hl7Realm.AU; 073 if ("BR".equals(codeString)) 074 return V3Hl7Realm.BR; 075 if ("CA".equals(codeString)) 076 return V3Hl7Realm.CA; 077 if ("CH".equals(codeString)) 078 return V3Hl7Realm.CH; 079 if ("CL".equals(codeString)) 080 return V3Hl7Realm.CL; 081 if ("CN".equals(codeString)) 082 return V3Hl7Realm.CN; 083 if ("CO".equals(codeString)) 084 return V3Hl7Realm.CO; 085 if ("CZ".equals(codeString)) 086 return V3Hl7Realm.CZ; 087 if ("DE".equals(codeString)) 088 return V3Hl7Realm.DE; 089 if ("DK".equals(codeString)) 090 return V3Hl7Realm.DK; 091 if ("ES".equals(codeString)) 092 return V3Hl7Realm.ES; 093 if ("FI".equals(codeString)) 094 return V3Hl7Realm.FI; 095 if ("FR".equals(codeString)) 096 return V3Hl7Realm.FR; 097 if ("GR".equals(codeString)) 098 return V3Hl7Realm.GR; 099 if ("HR".equals(codeString)) 100 return V3Hl7Realm.HR; 101 if ("IE".equals(codeString)) 102 return V3Hl7Realm.IE; 103 if ("IN".equals(codeString)) 104 return V3Hl7Realm.IN; 105 if ("IT".equals(codeString)) 106 return V3Hl7Realm.IT; 107 if ("JP".equals(codeString)) 108 return V3Hl7Realm.JP; 109 if ("KR".equals(codeString)) 110 return V3Hl7Realm.KR; 111 if ("LT".equals(codeString)) 112 return V3Hl7Realm.LT; 113 if ("MX".equals(codeString)) 114 return V3Hl7Realm.MX; 115 if ("NL".equals(codeString)) 116 return V3Hl7Realm.NL; 117 if ("NZ".equals(codeString)) 118 return V3Hl7Realm.NZ; 119 if ("RO".equals(codeString)) 120 return V3Hl7Realm.RO; 121 if ("RU".equals(codeString)) 122 return V3Hl7Realm.RU; 123 if ("SE".equals(codeString)) 124 return V3Hl7Realm.SE; 125 if ("SG".equals(codeString)) 126 return V3Hl7Realm.SG; 127 if ("SOA".equals(codeString)) 128 return V3Hl7Realm.SOA; 129 if ("TR".equals(codeString)) 130 return V3Hl7Realm.TR; 131 if ("TW".equals(codeString)) 132 return V3Hl7Realm.TW; 133 if ("UK".equals(codeString)) 134 return V3Hl7Realm.UK; 135 if ("US".equals(codeString)) 136 return V3Hl7Realm.US; 137 if ("UV".equals(codeString)) 138 return V3Hl7Realm.UV; 139 if ("UY".equals(codeString)) 140 return V3Hl7Realm.UY; 141 if ("C1".equals(codeString)) 142 return V3Hl7Realm.C1; 143 if ("GB".equals(codeString)) 144 return V3Hl7Realm.GB; 145 if ("R1".equals(codeString)) 146 return V3Hl7Realm.R1; 147 if ("X1".equals(codeString)) 148 return V3Hl7Realm.X1; 149 if ("NamespaceRealms".equals(codeString)) 150 return V3Hl7Realm.NAMESPACEREALMS; 151 if ("ZZ".equals(codeString)) 152 return V3Hl7Realm.ZZ; 153 throw new IllegalArgumentException("Unknown V3Hl7Realm code '"+codeString+"'"); 154 } 155 156 public String toCode(V3Hl7Realm code) { 157 if (code == V3Hl7Realm.BINDINGREALMS) 158 return "BindingRealms"; 159 if (code == V3Hl7Realm.AFFILIATEREALMS) 160 return "AffiliateRealms"; 161 if (code == V3Hl7Realm.AR) 162 return "AR"; 163 if (code == V3Hl7Realm.AT) 164 return "AT"; 165 if (code == V3Hl7Realm.AU) 166 return "AU"; 167 if (code == V3Hl7Realm.BR) 168 return "BR"; 169 if (code == V3Hl7Realm.CA) 170 return "CA"; 171 if (code == V3Hl7Realm.CH) 172 return "CH"; 173 if (code == V3Hl7Realm.CL) 174 return "CL"; 175 if (code == V3Hl7Realm.CN) 176 return "CN"; 177 if (code == V3Hl7Realm.CO) 178 return "CO"; 179 if (code == V3Hl7Realm.CZ) 180 return "CZ"; 181 if (code == V3Hl7Realm.DE) 182 return "DE"; 183 if (code == V3Hl7Realm.DK) 184 return "DK"; 185 if (code == V3Hl7Realm.ES) 186 return "ES"; 187 if (code == V3Hl7Realm.FI) 188 return "FI"; 189 if (code == V3Hl7Realm.FR) 190 return "FR"; 191 if (code == V3Hl7Realm.GR) 192 return "GR"; 193 if (code == V3Hl7Realm.HR) 194 return "HR"; 195 if (code == V3Hl7Realm.IE) 196 return "IE"; 197 if (code == V3Hl7Realm.IN) 198 return "IN"; 199 if (code == V3Hl7Realm.IT) 200 return "IT"; 201 if (code == V3Hl7Realm.JP) 202 return "JP"; 203 if (code == V3Hl7Realm.KR) 204 return "KR"; 205 if (code == V3Hl7Realm.LT) 206 return "LT"; 207 if (code == V3Hl7Realm.MX) 208 return "MX"; 209 if (code == V3Hl7Realm.NL) 210 return "NL"; 211 if (code == V3Hl7Realm.NZ) 212 return "NZ"; 213 if (code == V3Hl7Realm.RO) 214 return "RO"; 215 if (code == V3Hl7Realm.RU) 216 return "RU"; 217 if (code == V3Hl7Realm.SE) 218 return "SE"; 219 if (code == V3Hl7Realm.SG) 220 return "SG"; 221 if (code == V3Hl7Realm.SOA) 222 return "SOA"; 223 if (code == V3Hl7Realm.TR) 224 return "TR"; 225 if (code == V3Hl7Realm.TW) 226 return "TW"; 227 if (code == V3Hl7Realm.UK) 228 return "UK"; 229 if (code == V3Hl7Realm.US) 230 return "US"; 231 if (code == V3Hl7Realm.UV) 232 return "UV"; 233 if (code == V3Hl7Realm.UY) 234 return "UY"; 235 if (code == V3Hl7Realm.C1) 236 return "C1"; 237 if (code == V3Hl7Realm.GB) 238 return "GB"; 239 if (code == V3Hl7Realm.R1) 240 return "R1"; 241 if (code == V3Hl7Realm.X1) 242 return "X1"; 243 if (code == V3Hl7Realm.NAMESPACEREALMS) 244 return "NamespaceRealms"; 245 if (code == V3Hl7Realm.ZZ) 246 return "ZZ"; 247 return "?"; 248 } 249 250 public String toSystem(V3Hl7Realm code) { 251 return code.getSystem(); 252 } 253 254} 255