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