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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034
035import org.hl7.fhir.r4.model.EnumFactory;
036
037public class FeedingDeviceEnumFactory implements EnumFactory<FeedingDevice> {
038
039  public FeedingDevice fromCode(String codeString) throws IllegalArgumentException {
040    if (codeString == null || "".equals(codeString))
041      return null;
042    if ("standard-nipple".equals(codeString))
043      return FeedingDevice.STANDARDNIPPLE;
044    if ("preemie-nipple".equals(codeString))
045      return FeedingDevice.PREEMIENIPPLE;
046    if ("ortho-nipple".equals(codeString))
047      return FeedingDevice.ORTHONIPPLE;
048    if ("sloflo-nipple".equals(codeString))
049      return FeedingDevice.SLOFLONIPPLE;
050    if ("midflo-nipple".equals(codeString))
051      return FeedingDevice.MIDFLONIPPLE;
052    if ("bigcut-nipple".equals(codeString))
053      return FeedingDevice.BIGCUTNIPPLE;
054    if ("haberman-bottle".equals(codeString))
055      return FeedingDevice.HABERMANBOTTLE;
056    if ("sippy-valve".equals(codeString))
057      return FeedingDevice.SIPPYVALVE;
058    if ("sippy-no-valve".equals(codeString))
059      return FeedingDevice.SIPPYNOVALVE;
060    if ("provale-cup".equals(codeString))
061      return FeedingDevice.PROVALECUP;
062    if ("glass-lid".equals(codeString))
063      return FeedingDevice.GLASSLID;
064    if ("handhold-cup".equals(codeString))
065      return FeedingDevice.HANDHOLDCUP;
066    if ("rubber-mat".equals(codeString))
067      return FeedingDevice.RUBBERMAT;
068    if ("straw".equals(codeString))
069      return FeedingDevice.STRAW;
070    if ("nose-cup".equals(codeString))
071      return FeedingDevice.NOSECUP;
072    if ("scoop-plate".equals(codeString))
073      return FeedingDevice.SCOOPPLATE;
074    if ("utensil-holder".equals(codeString))
075      return FeedingDevice.UTENSILHOLDER;
076    if ("foam-handle".equals(codeString))
077      return FeedingDevice.FOAMHANDLE;
078    if ("angled-utensil".equals(codeString))
079      return FeedingDevice.ANGLEDUTENSIL;
080    if ("spout-cup".equals(codeString))
081      return FeedingDevice.SPOUTCUP;
082    if ("autofeeding-device".equals(codeString))
083      return FeedingDevice.AUTOFEEDINGDEVICE;
084    if ("rocker-knife".equals(codeString))
085      return FeedingDevice.ROCKERKNIFE;
086    throw new IllegalArgumentException("Unknown FeedingDevice code '"+codeString+"'");
087  }
088
089  public String toCode(FeedingDevice code) {
090    if (code == FeedingDevice.STANDARDNIPPLE)
091      return "standard-nipple";
092    if (code == FeedingDevice.PREEMIENIPPLE)
093      return "preemie-nipple";
094    if (code == FeedingDevice.ORTHONIPPLE)
095      return "ortho-nipple";
096    if (code == FeedingDevice.SLOFLONIPPLE)
097      return "sloflo-nipple";
098    if (code == FeedingDevice.MIDFLONIPPLE)
099      return "midflo-nipple";
100    if (code == FeedingDevice.BIGCUTNIPPLE)
101      return "bigcut-nipple";
102    if (code == FeedingDevice.HABERMANBOTTLE)
103      return "haberman-bottle";
104    if (code == FeedingDevice.SIPPYVALVE)
105      return "sippy-valve";
106    if (code == FeedingDevice.SIPPYNOVALVE)
107      return "sippy-no-valve";
108    if (code == FeedingDevice.PROVALECUP)
109      return "provale-cup";
110    if (code == FeedingDevice.GLASSLID)
111      return "glass-lid";
112    if (code == FeedingDevice.HANDHOLDCUP)
113      return "handhold-cup";
114    if (code == FeedingDevice.RUBBERMAT)
115      return "rubber-mat";
116    if (code == FeedingDevice.STRAW)
117      return "straw";
118    if (code == FeedingDevice.NOSECUP)
119      return "nose-cup";
120    if (code == FeedingDevice.SCOOPPLATE)
121      return "scoop-plate";
122    if (code == FeedingDevice.UTENSILHOLDER)
123      return "utensil-holder";
124    if (code == FeedingDevice.FOAMHANDLE)
125      return "foam-handle";
126    if (code == FeedingDevice.ANGLEDUTENSIL)
127      return "angled-utensil";
128    if (code == FeedingDevice.SPOUTCUP)
129      return "spout-cup";
130    if (code == FeedingDevice.AUTOFEEDINGDEVICE)
131      return "autofeeding-device";
132    if (code == FeedingDevice.ROCKERKNIFE)
133      return "rocker-knife";
134    return "?";
135  }
136
137    public String toSystem(FeedingDevice code) {
138      return code.getSystem();
139      }
140
141}
142