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