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