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.NULL)
140           return null;
141       if (code == V3Hl7Realm.BINDINGREALMS)
142      return "BindingRealms";
143    if (code == V3Hl7Realm.AFFILIATEREALMS)
144      return "AffiliateRealms";
145    if (code == V3Hl7Realm.AR)
146      return "AR";
147    if (code == V3Hl7Realm.AT)
148      return "AT";
149    if (code == V3Hl7Realm.AU)
150      return "AU";
151    if (code == V3Hl7Realm.BR)
152      return "BR";
153    if (code == V3Hl7Realm.CA)
154      return "CA";
155    if (code == V3Hl7Realm.CH)
156      return "CH";
157    if (code == V3Hl7Realm.CL)
158      return "CL";
159    if (code == V3Hl7Realm.CN)
160      return "CN";
161    if (code == V3Hl7Realm.CO)
162      return "CO";
163    if (code == V3Hl7Realm.CZ)
164      return "CZ";
165    if (code == V3Hl7Realm.DE)
166      return "DE";
167    if (code == V3Hl7Realm.DK)
168      return "DK";
169    if (code == V3Hl7Realm.ES)
170      return "ES";
171    if (code == V3Hl7Realm.FI)
172      return "FI";
173    if (code == V3Hl7Realm.FR)
174      return "FR";
175    if (code == V3Hl7Realm.GR)
176      return "GR";
177    if (code == V3Hl7Realm.HR)
178      return "HR";
179    if (code == V3Hl7Realm.IE)
180      return "IE";
181    if (code == V3Hl7Realm.IN)
182      return "IN";
183    if (code == V3Hl7Realm.IT)
184      return "IT";
185    if (code == V3Hl7Realm.JP)
186      return "JP";
187    if (code == V3Hl7Realm.KR)
188      return "KR";
189    if (code == V3Hl7Realm.LT)
190      return "LT";
191    if (code == V3Hl7Realm.MX)
192      return "MX";
193    if (code == V3Hl7Realm.NL)
194      return "NL";
195    if (code == V3Hl7Realm.NZ)
196      return "NZ";
197    if (code == V3Hl7Realm.RO)
198      return "RO";
199    if (code == V3Hl7Realm.RU)
200      return "RU";
201    if (code == V3Hl7Realm.SE)
202      return "SE";
203    if (code == V3Hl7Realm.SG)
204      return "SG";
205    if (code == V3Hl7Realm.SOA)
206      return "SOA";
207    if (code == V3Hl7Realm.TR)
208      return "TR";
209    if (code == V3Hl7Realm.TW)
210      return "TW";
211    if (code == V3Hl7Realm.UK)
212      return "UK";
213    if (code == V3Hl7Realm.US)
214      return "US";
215    if (code == V3Hl7Realm.UV)
216      return "UV";
217    if (code == V3Hl7Realm.UY)
218      return "UY";
219    if (code == V3Hl7Realm.C1)
220      return "C1";
221    if (code == V3Hl7Realm.GB)
222      return "GB";
223    if (code == V3Hl7Realm.R1)
224      return "R1";
225    if (code == V3Hl7Realm.X1)
226      return "X1";
227    if (code == V3Hl7Realm.NAMESPACEREALMS)
228      return "NamespaceRealms";
229    if (code == V3Hl7Realm.ZZ)
230      return "ZZ";
231    return "?";
232   }
233
234    public String toSystem(V3Hl7Realm code) {
235      return code.getSystem();
236      }
237
238}