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 V3Hl7RealmEnumFactory implements EnumFactory<V3Hl7Realm> {
037
038  public V3Hl7Realm fromCode(String codeString) throws IllegalArgumentException {
039    if (codeString == null || "".equals(codeString))
040      return null;
041    if ("BindingRealms".equals(codeString))
042      return V3Hl7Realm.BINDINGREALMS;
043    if ("AffiliateRealms".equals(codeString))
044      return V3Hl7Realm.AFFILIATEREALMS;
045    if ("AR".equals(codeString))
046      return V3Hl7Realm.AR;
047    if ("AT".equals(codeString))
048      return V3Hl7Realm.AT;
049    if ("AU".equals(codeString))
050      return V3Hl7Realm.AU;
051    if ("BR".equals(codeString))
052      return V3Hl7Realm.BR;
053    if ("CA".equals(codeString))
054      return V3Hl7Realm.CA;
055    if ("CH".equals(codeString))
056      return V3Hl7Realm.CH;
057    if ("CL".equals(codeString))
058      return V3Hl7Realm.CL;
059    if ("CN".equals(codeString))
060      return V3Hl7Realm.CN;
061    if ("CO".equals(codeString))
062      return V3Hl7Realm.CO;
063    if ("CZ".equals(codeString))
064      return V3Hl7Realm.CZ;
065    if ("DE".equals(codeString))
066      return V3Hl7Realm.DE;
067    if ("DK".equals(codeString))
068      return V3Hl7Realm.DK;
069    if ("ES".equals(codeString))
070      return V3Hl7Realm.ES;
071    if ("FI".equals(codeString))
072      return V3Hl7Realm.FI;
073    if ("FR".equals(codeString))
074      return V3Hl7Realm.FR;
075    if ("GR".equals(codeString))
076      return V3Hl7Realm.GR;
077    if ("HR".equals(codeString))
078      return V3Hl7Realm.HR;
079    if ("IE".equals(codeString))
080      return V3Hl7Realm.IE;
081    if ("IN".equals(codeString))
082      return V3Hl7Realm.IN;
083    if ("IT".equals(codeString))
084      return V3Hl7Realm.IT;
085    if ("JP".equals(codeString))
086      return V3Hl7Realm.JP;
087    if ("KR".equals(codeString))
088      return V3Hl7Realm.KR;
089    if ("LT".equals(codeString))
090      return V3Hl7Realm.LT;
091    if ("MX".equals(codeString))
092      return V3Hl7Realm.MX;
093    if ("NL".equals(codeString))
094      return V3Hl7Realm.NL;
095    if ("NZ".equals(codeString))
096      return V3Hl7Realm.NZ;
097    if ("RO".equals(codeString))
098      return V3Hl7Realm.RO;
099    if ("RU".equals(codeString))
100      return V3Hl7Realm.RU;
101    if ("SE".equals(codeString))
102      return V3Hl7Realm.SE;
103    if ("SG".equals(codeString))
104      return V3Hl7Realm.SG;
105    if ("SOA".equals(codeString))
106      return V3Hl7Realm.SOA;
107    if ("TR".equals(codeString))
108      return V3Hl7Realm.TR;
109    if ("TW".equals(codeString))
110      return V3Hl7Realm.TW;
111    if ("UK".equals(codeString))
112      return V3Hl7Realm.UK;
113    if ("US".equals(codeString))
114      return V3Hl7Realm.US;
115    if ("UV".equals(codeString))
116      return V3Hl7Realm.UV;
117    if ("UY".equals(codeString))
118      return V3Hl7Realm.UY;
119    if ("C1".equals(codeString))
120      return V3Hl7Realm.C1;
121    if ("GB".equals(codeString))
122      return V3Hl7Realm.GB;
123    if ("R1".equals(codeString))
124      return V3Hl7Realm.R1;
125    if ("X1".equals(codeString))
126      return V3Hl7Realm.X1;
127    if ("NamespaceRealms".equals(codeString))
128      return V3Hl7Realm.NAMESPACEREALMS;
129    if ("ZZ".equals(codeString))
130      return V3Hl7Realm.ZZ;
131    throw new IllegalArgumentException("Unknown V3Hl7Realm code '" + codeString + "'");
132  }
133
134  public String toCode(V3Hl7Realm code) {
135       if (code == V3Hl7Realm.NULL)
136           return null;
137       if (code == V3Hl7Realm.BINDINGREALMS)
138      return "BindingRealms";
139    if (code == V3Hl7Realm.AFFILIATEREALMS)
140      return "AffiliateRealms";
141    if (code == V3Hl7Realm.AR)
142      return "AR";
143    if (code == V3Hl7Realm.AT)
144      return "AT";
145    if (code == V3Hl7Realm.AU)
146      return "AU";
147    if (code == V3Hl7Realm.BR)
148      return "BR";
149    if (code == V3Hl7Realm.CA)
150      return "CA";
151    if (code == V3Hl7Realm.CH)
152      return "CH";
153    if (code == V3Hl7Realm.CL)
154      return "CL";
155    if (code == V3Hl7Realm.CN)
156      return "CN";
157    if (code == V3Hl7Realm.CO)
158      return "CO";
159    if (code == V3Hl7Realm.CZ)
160      return "CZ";
161    if (code == V3Hl7Realm.DE)
162      return "DE";
163    if (code == V3Hl7Realm.DK)
164      return "DK";
165    if (code == V3Hl7Realm.ES)
166      return "ES";
167    if (code == V3Hl7Realm.FI)
168      return "FI";
169    if (code == V3Hl7Realm.FR)
170      return "FR";
171    if (code == V3Hl7Realm.GR)
172      return "GR";
173    if (code == V3Hl7Realm.HR)
174      return "HR";
175    if (code == V3Hl7Realm.IE)
176      return "IE";
177    if (code == V3Hl7Realm.IN)
178      return "IN";
179    if (code == V3Hl7Realm.IT)
180      return "IT";
181    if (code == V3Hl7Realm.JP)
182      return "JP";
183    if (code == V3Hl7Realm.KR)
184      return "KR";
185    if (code == V3Hl7Realm.LT)
186      return "LT";
187    if (code == V3Hl7Realm.MX)
188      return "MX";
189    if (code == V3Hl7Realm.NL)
190      return "NL";
191    if (code == V3Hl7Realm.NZ)
192      return "NZ";
193    if (code == V3Hl7Realm.RO)
194      return "RO";
195    if (code == V3Hl7Realm.RU)
196      return "RU";
197    if (code == V3Hl7Realm.SE)
198      return "SE";
199    if (code == V3Hl7Realm.SG)
200      return "SG";
201    if (code == V3Hl7Realm.SOA)
202      return "SOA";
203    if (code == V3Hl7Realm.TR)
204      return "TR";
205    if (code == V3Hl7Realm.TW)
206      return "TW";
207    if (code == V3Hl7Realm.UK)
208      return "UK";
209    if (code == V3Hl7Realm.US)
210      return "US";
211    if (code == V3Hl7Realm.UV)
212      return "UV";
213    if (code == V3Hl7Realm.UY)
214      return "UY";
215    if (code == V3Hl7Realm.C1)
216      return "C1";
217    if (code == V3Hl7Realm.GB)
218      return "GB";
219    if (code == V3Hl7Realm.R1)
220      return "R1";
221    if (code == V3Hl7Realm.X1)
222      return "X1";
223    if (code == V3Hl7Realm.NAMESPACEREALMS)
224      return "NamespaceRealms";
225    if (code == V3Hl7Realm.ZZ)
226      return "ZZ";
227    return "?";
228   }
229
230  public String toSystem(V3Hl7Realm code) {
231    return code.getSystem();
232  }
233
234}