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