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 ServiceCategoryEnumFactory implements EnumFactory<ServiceCategory> {
059
060  public ServiceCategory fromCode(String codeString) throws IllegalArgumentException {
061    if (codeString == null || "".equals(codeString))
062      return null;
063    if ("1".equals(codeString))
064      return ServiceCategory._1;
065    if ("2".equals(codeString))
066      return ServiceCategory._2;
067    if ("34".equals(codeString))
068      return ServiceCategory._34;
069    if ("3".equals(codeString))
070      return ServiceCategory._3;
071    if ("4".equals(codeString))
072      return ServiceCategory._4;
073    if ("5".equals(codeString))
074      return ServiceCategory._5;
075    if ("6".equals(codeString))
076      return ServiceCategory._6;
077    if ("7".equals(codeString))
078      return ServiceCategory._7;
079    if ("8".equals(codeString))
080      return ServiceCategory._8;
081    if ("36".equals(codeString))
082      return ServiceCategory._36;
083    if ("9".equals(codeString))
084      return ServiceCategory._9;
085    if ("10".equals(codeString))
086      return ServiceCategory._10;
087    if ("11".equals(codeString))
088      return ServiceCategory._11;
089    if ("12".equals(codeString))
090      return ServiceCategory._12;
091    if ("13".equals(codeString))
092      return ServiceCategory._13;
093    if ("14".equals(codeString))
094      return ServiceCategory._14;
095    if ("15".equals(codeString))
096      return ServiceCategory._15;
097    if ("16".equals(codeString))
098      return ServiceCategory._16;
099    if ("17".equals(codeString))
100      return ServiceCategory._17;
101    if ("35".equals(codeString))
102      return ServiceCategory._35;
103    if ("18".equals(codeString))
104      return ServiceCategory._18;
105    if ("19".equals(codeString))
106      return ServiceCategory._19;
107    if ("20".equals(codeString))
108      return ServiceCategory._20;
109    if ("21".equals(codeString))
110      return ServiceCategory._21;
111    if ("22".equals(codeString))
112      return ServiceCategory._22;
113    if ("38".equals(codeString))
114      return ServiceCategory._38;
115    if ("23".equals(codeString))
116      return ServiceCategory._23;
117    if ("24".equals(codeString))
118      return ServiceCategory._24;
119    if ("25".equals(codeString))
120      return ServiceCategory._25;
121    if ("26".equals(codeString))
122      return ServiceCategory._26;
123    if ("27".equals(codeString))
124      return ServiceCategory._27;
125    if ("28".equals(codeString))
126      return ServiceCategory._28;
127    if ("29".equals(codeString))
128      return ServiceCategory._29;
129    if ("30".equals(codeString))
130      return ServiceCategory._30;
131    if ("31".equals(codeString))
132      return ServiceCategory._31;
133    if ("32".equals(codeString))
134      return ServiceCategory._32;
135    if ("37".equals(codeString))
136      return ServiceCategory._37;
137    if ("33".equals(codeString))
138      return ServiceCategory._33;
139    throw new IllegalArgumentException("Unknown ServiceCategory code '"+codeString+"'");
140  }
141
142  public String toCode(ServiceCategory code) {
143    if (code == ServiceCategory._1)
144      return "1";
145    if (code == ServiceCategory._2)
146      return "2";
147    if (code == ServiceCategory._34)
148      return "34";
149    if (code == ServiceCategory._3)
150      return "3";
151    if (code == ServiceCategory._4)
152      return "4";
153    if (code == ServiceCategory._5)
154      return "5";
155    if (code == ServiceCategory._6)
156      return "6";
157    if (code == ServiceCategory._7)
158      return "7";
159    if (code == ServiceCategory._8)
160      return "8";
161    if (code == ServiceCategory._36)
162      return "36";
163    if (code == ServiceCategory._9)
164      return "9";
165    if (code == ServiceCategory._10)
166      return "10";
167    if (code == ServiceCategory._11)
168      return "11";
169    if (code == ServiceCategory._12)
170      return "12";
171    if (code == ServiceCategory._13)
172      return "13";
173    if (code == ServiceCategory._14)
174      return "14";
175    if (code == ServiceCategory._15)
176      return "15";
177    if (code == ServiceCategory._16)
178      return "16";
179    if (code == ServiceCategory._17)
180      return "17";
181    if (code == ServiceCategory._35)
182      return "35";
183    if (code == ServiceCategory._18)
184      return "18";
185    if (code == ServiceCategory._19)
186      return "19";
187    if (code == ServiceCategory._20)
188      return "20";
189    if (code == ServiceCategory._21)
190      return "21";
191    if (code == ServiceCategory._22)
192      return "22";
193    if (code == ServiceCategory._38)
194      return "38";
195    if (code == ServiceCategory._23)
196      return "23";
197    if (code == ServiceCategory._24)
198      return "24";
199    if (code == ServiceCategory._25)
200      return "25";
201    if (code == ServiceCategory._26)
202      return "26";
203    if (code == ServiceCategory._27)
204      return "27";
205    if (code == ServiceCategory._28)
206      return "28";
207    if (code == ServiceCategory._29)
208      return "29";
209    if (code == ServiceCategory._30)
210      return "30";
211    if (code == ServiceCategory._31)
212      return "31";
213    if (code == ServiceCategory._32)
214      return "32";
215    if (code == ServiceCategory._37)
216      return "37";
217    if (code == ServiceCategory._33)
218      return "33";
219    return "?";
220  }
221
222    public String toSystem(ServiceCategory code) {
223      return code.getSystem();
224      }
225
226}
227