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