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