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 V3AddressPartTypeEnumFactory implements EnumFactory<V3AddressPartType> {
059
060  public V3AddressPartType fromCode(String codeString) throws IllegalArgumentException {
061    if (codeString == null || "".equals(codeString))
062      return null;
063    if ("ADL".equals(codeString))
064      return V3AddressPartType.ADL;
065    if ("AL".equals(codeString))
066      return V3AddressPartType.AL;
067    if ("DAL".equals(codeString))
068      return V3AddressPartType.DAL;
069    if ("SAL".equals(codeString))
070      return V3AddressPartType.SAL;
071    if ("BNN".equals(codeString))
072      return V3AddressPartType.BNN;
073    if ("BNR".equals(codeString))
074      return V3AddressPartType.BNR;
075    if ("BNS".equals(codeString))
076      return V3AddressPartType.BNS;
077    if ("CAR".equals(codeString))
078      return V3AddressPartType.CAR;
079    if ("CEN".equals(codeString))
080      return V3AddressPartType.CEN;
081    if ("CNT".equals(codeString))
082      return V3AddressPartType.CNT;
083    if ("CPA".equals(codeString))
084      return V3AddressPartType.CPA;
085    if ("CTY".equals(codeString))
086      return V3AddressPartType.CTY;
087    if ("DEL".equals(codeString))
088      return V3AddressPartType.DEL;
089    if ("DINST".equals(codeString))
090      return V3AddressPartType.DINST;
091    if ("DINSTA".equals(codeString))
092      return V3AddressPartType.DINSTA;
093    if ("DINSTQ".equals(codeString))
094      return V3AddressPartType.DINSTQ;
095    if ("DIR".equals(codeString))
096      return V3AddressPartType.DIR;
097    if ("DMOD".equals(codeString))
098      return V3AddressPartType.DMOD;
099    if ("DMODID".equals(codeString))
100      return V3AddressPartType.DMODID;
101    if ("DPID".equals(codeString))
102      return V3AddressPartType.DPID;
103    if ("INT".equals(codeString))
104      return V3AddressPartType.INT;
105    if ("POB".equals(codeString))
106      return V3AddressPartType.POB;
107    if ("PRE".equals(codeString))
108      return V3AddressPartType.PRE;
109    if ("STA".equals(codeString))
110      return V3AddressPartType.STA;
111    if ("STB".equals(codeString))
112      return V3AddressPartType.STB;
113    if ("STR".equals(codeString))
114      return V3AddressPartType.STR;
115    if ("STTYP".equals(codeString))
116      return V3AddressPartType.STTYP;
117    if ("UNID".equals(codeString))
118      return V3AddressPartType.UNID;
119    if ("UNIT".equals(codeString))
120      return V3AddressPartType.UNIT;
121    if ("ZIP".equals(codeString))
122      return V3AddressPartType.ZIP;
123    throw new IllegalArgumentException("Unknown V3AddressPartType code '"+codeString+"'");
124  }
125
126  public String toCode(V3AddressPartType code) {
127    if (code == V3AddressPartType.ADL)
128      return "ADL";
129    if (code == V3AddressPartType.AL)
130      return "AL";
131    if (code == V3AddressPartType.DAL)
132      return "DAL";
133    if (code == V3AddressPartType.SAL)
134      return "SAL";
135    if (code == V3AddressPartType.BNN)
136      return "BNN";
137    if (code == V3AddressPartType.BNR)
138      return "BNR";
139    if (code == V3AddressPartType.BNS)
140      return "BNS";
141    if (code == V3AddressPartType.CAR)
142      return "CAR";
143    if (code == V3AddressPartType.CEN)
144      return "CEN";
145    if (code == V3AddressPartType.CNT)
146      return "CNT";
147    if (code == V3AddressPartType.CPA)
148      return "CPA";
149    if (code == V3AddressPartType.CTY)
150      return "CTY";
151    if (code == V3AddressPartType.DEL)
152      return "DEL";
153    if (code == V3AddressPartType.DINST)
154      return "DINST";
155    if (code == V3AddressPartType.DINSTA)
156      return "DINSTA";
157    if (code == V3AddressPartType.DINSTQ)
158      return "DINSTQ";
159    if (code == V3AddressPartType.DIR)
160      return "DIR";
161    if (code == V3AddressPartType.DMOD)
162      return "DMOD";
163    if (code == V3AddressPartType.DMODID)
164      return "DMODID";
165    if (code == V3AddressPartType.DPID)
166      return "DPID";
167    if (code == V3AddressPartType.INT)
168      return "INT";
169    if (code == V3AddressPartType.POB)
170      return "POB";
171    if (code == V3AddressPartType.PRE)
172      return "PRE";
173    if (code == V3AddressPartType.STA)
174      return "STA";
175    if (code == V3AddressPartType.STB)
176      return "STB";
177    if (code == V3AddressPartType.STR)
178      return "STR";
179    if (code == V3AddressPartType.STTYP)
180      return "STTYP";
181    if (code == V3AddressPartType.UNID)
182      return "UNID";
183    if (code == V3AddressPartType.UNIT)
184      return "UNIT";
185    if (code == V3AddressPartType.ZIP)
186      return "ZIP";
187    return "?";
188  }
189
190    public String toSystem(V3AddressPartType code) {
191      return code.getSystem();
192      }
193
194}
195