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