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