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 FeedingDeviceEnumFactory implements EnumFactory<FeedingDevice> {
059
060  public FeedingDevice fromCode(String codeString) throws IllegalArgumentException {
061    if (codeString == null || "".equals(codeString))
062      return null;
063    if ("standard-nipple".equals(codeString))
064      return FeedingDevice.STANDARDNIPPLE;
065    if ("preemie-nipple".equals(codeString))
066      return FeedingDevice.PREEMIENIPPLE;
067    if ("ortho-nipple".equals(codeString))
068      return FeedingDevice.ORTHONIPPLE;
069    if ("sloflo-nipple".equals(codeString))
070      return FeedingDevice.SLOFLONIPPLE;
071    if ("midflo-nipple".equals(codeString))
072      return FeedingDevice.MIDFLONIPPLE;
073    if ("bigcut-nipple".equals(codeString))
074      return FeedingDevice.BIGCUTNIPPLE;
075    if ("haberman-bottle".equals(codeString))
076      return FeedingDevice.HABERMANBOTTLE;
077    if ("sippy-valve".equals(codeString))
078      return FeedingDevice.SIPPYVALVE;
079    if ("sippy-no-valve".equals(codeString))
080      return FeedingDevice.SIPPYNOVALVE;
081    if ("provale-cup".equals(codeString))
082      return FeedingDevice.PROVALECUP;
083    if ("glass-lid".equals(codeString))
084      return FeedingDevice.GLASSLID;
085    if ("handhold-cup".equals(codeString))
086      return FeedingDevice.HANDHOLDCUP;
087    if ("rubber-mat".equals(codeString))
088      return FeedingDevice.RUBBERMAT;
089    if ("straw".equals(codeString))
090      return FeedingDevice.STRAW;
091    if ("nose-cup".equals(codeString))
092      return FeedingDevice.NOSECUP;
093    if ("scoop-plate".equals(codeString))
094      return FeedingDevice.SCOOPPLATE;
095    if ("utensil-holder".equals(codeString))
096      return FeedingDevice.UTENSILHOLDER;
097    if ("foam-handle".equals(codeString))
098      return FeedingDevice.FOAMHANDLE;
099    if ("angled-utensil".equals(codeString))
100      return FeedingDevice.ANGLEDUTENSIL;
101    if ("spout-cup".equals(codeString))
102      return FeedingDevice.SPOUTCUP;
103    if ("autofeeding-device".equals(codeString))
104      return FeedingDevice.AUTOFEEDINGDEVICE;
105    if ("rocker-knife".equals(codeString))
106      return FeedingDevice.ROCKERKNIFE;
107    throw new IllegalArgumentException("Unknown FeedingDevice code '"+codeString+"'");
108  }
109
110  public String toCode(FeedingDevice code) {
111    if (code == FeedingDevice.STANDARDNIPPLE)
112      return "standard-nipple";
113    if (code == FeedingDevice.PREEMIENIPPLE)
114      return "preemie-nipple";
115    if (code == FeedingDevice.ORTHONIPPLE)
116      return "ortho-nipple";
117    if (code == FeedingDevice.SLOFLONIPPLE)
118      return "sloflo-nipple";
119    if (code == FeedingDevice.MIDFLONIPPLE)
120      return "midflo-nipple";
121    if (code == FeedingDevice.BIGCUTNIPPLE)
122      return "bigcut-nipple";
123    if (code == FeedingDevice.HABERMANBOTTLE)
124      return "haberman-bottle";
125    if (code == FeedingDevice.SIPPYVALVE)
126      return "sippy-valve";
127    if (code == FeedingDevice.SIPPYNOVALVE)
128      return "sippy-no-valve";
129    if (code == FeedingDevice.PROVALECUP)
130      return "provale-cup";
131    if (code == FeedingDevice.GLASSLID)
132      return "glass-lid";
133    if (code == FeedingDevice.HANDHOLDCUP)
134      return "handhold-cup";
135    if (code == FeedingDevice.RUBBERMAT)
136      return "rubber-mat";
137    if (code == FeedingDevice.STRAW)
138      return "straw";
139    if (code == FeedingDevice.NOSECUP)
140      return "nose-cup";
141    if (code == FeedingDevice.SCOOPPLATE)
142      return "scoop-plate";
143    if (code == FeedingDevice.UTENSILHOLDER)
144      return "utensil-holder";
145    if (code == FeedingDevice.FOAMHANDLE)
146      return "foam-handle";
147    if (code == FeedingDevice.ANGLEDUTENSIL)
148      return "angled-utensil";
149    if (code == FeedingDevice.SPOUTCUP)
150      return "spout-cup";
151    if (code == FeedingDevice.AUTOFEEDINGDEVICE)
152      return "autofeeding-device";
153    if (code == FeedingDevice.ROCKERKNIFE)
154      return "rocker-knife";
155    return "?";
156  }
157
158    public String toSystem(FeedingDevice code) {
159      return code.getSystem();
160      }
161
162}
163