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 BenefitSubcategoryEnumFactory implements EnumFactory<BenefitSubcategory> {
038
039  public BenefitSubcategory fromCode(String codeString) throws IllegalArgumentException {
040    if (codeString == null || "".equals(codeString))
041      return null;
042    if ("1".equals(codeString))
043      return BenefitSubcategory._1;
044    if ("2".equals(codeString))
045      return BenefitSubcategory._2;
046    if ("3".equals(codeString))
047      return BenefitSubcategory._3;
048    if ("4".equals(codeString))
049      return BenefitSubcategory._4;
050    if ("5".equals(codeString))
051      return BenefitSubcategory._5;
052    if ("14".equals(codeString))
053      return BenefitSubcategory._14;
054    if ("23".equals(codeString))
055      return BenefitSubcategory._23;
056    if ("24".equals(codeString))
057      return BenefitSubcategory._24;
058    if ("25".equals(codeString))
059      return BenefitSubcategory._25;
060    if ("26".equals(codeString))
061      return BenefitSubcategory._26;
062    if ("27".equals(codeString))
063      return BenefitSubcategory._27;
064    if ("28".equals(codeString))
065      return BenefitSubcategory._28;
066    if ("30".equals(codeString))
067      return BenefitSubcategory._30;
068    if ("35".equals(codeString))
069      return BenefitSubcategory._35;
070    if ("36".equals(codeString))
071      return BenefitSubcategory._36;
072    if ("37".equals(codeString))
073      return BenefitSubcategory._37;
074    if ("49".equals(codeString))
075      return BenefitSubcategory._49;
076    if ("55".equals(codeString))
077      return BenefitSubcategory._55;
078    if ("56".equals(codeString))
079      return BenefitSubcategory._56;
080    if ("61".equals(codeString))
081      return BenefitSubcategory._61;
082    if ("62".equals(codeString))
083      return BenefitSubcategory._62;
084    if ("63".equals(codeString))
085      return BenefitSubcategory._63;
086    if ("69".equals(codeString))
087      return BenefitSubcategory._69;
088    if ("76".equals(codeString))
089      return BenefitSubcategory._76;
090    if ("F1".equals(codeString))
091      return BenefitSubcategory.F1;
092    if ("F3".equals(codeString))
093      return BenefitSubcategory.F3;
094    if ("F4".equals(codeString))
095      return BenefitSubcategory.F4;
096    if ("F6".equals(codeString))
097      return BenefitSubcategory.F6;
098    throw new IllegalArgumentException("Unknown BenefitSubcategory code '"+codeString+"'");
099  }
100
101  public String toCode(BenefitSubcategory code) {
102    if (code == BenefitSubcategory._1)
103      return "1";
104    if (code == BenefitSubcategory._2)
105      return "2";
106    if (code == BenefitSubcategory._3)
107      return "3";
108    if (code == BenefitSubcategory._4)
109      return "4";
110    if (code == BenefitSubcategory._5)
111      return "5";
112    if (code == BenefitSubcategory._14)
113      return "14";
114    if (code == BenefitSubcategory._23)
115      return "23";
116    if (code == BenefitSubcategory._24)
117      return "24";
118    if (code == BenefitSubcategory._25)
119      return "25";
120    if (code == BenefitSubcategory._26)
121      return "26";
122    if (code == BenefitSubcategory._27)
123      return "27";
124    if (code == BenefitSubcategory._28)
125      return "28";
126    if (code == BenefitSubcategory._30)
127      return "30";
128    if (code == BenefitSubcategory._35)
129      return "35";
130    if (code == BenefitSubcategory._36)
131      return "36";
132    if (code == BenefitSubcategory._37)
133      return "37";
134    if (code == BenefitSubcategory._49)
135      return "49";
136    if (code == BenefitSubcategory._55)
137      return "55";
138    if (code == BenefitSubcategory._56)
139      return "56";
140    if (code == BenefitSubcategory._61)
141      return "61";
142    if (code == BenefitSubcategory._62)
143      return "62";
144    if (code == BenefitSubcategory._63)
145      return "63";
146    if (code == BenefitSubcategory._69)
147      return "69";
148    if (code == BenefitSubcategory._76)
149      return "76";
150    if (code == BenefitSubcategory.F1)
151      return "F1";
152    if (code == BenefitSubcategory.F3)
153      return "F3";
154    if (code == BenefitSubcategory.F4)
155      return "F4";
156    if (code == BenefitSubcategory.F6)
157      return "F6";
158    return "?";
159  }
160
161    public String toSystem(BenefitSubcategory code) {
162      return code.getSystem();
163      }
164
165}
166