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.NULL) 090 return null; 091 if (code == FeedingDevice.STANDARDNIPPLE) 092 return "standard-nipple"; 093 if (code == FeedingDevice.PREEMIENIPPLE) 094 return "preemie-nipple"; 095 if (code == FeedingDevice.ORTHONIPPLE) 096 return "ortho-nipple"; 097 if (code == FeedingDevice.SLOFLONIPPLE) 098 return "sloflo-nipple"; 099 if (code == FeedingDevice.MIDFLONIPPLE) 100 return "midflo-nipple"; 101 if (code == FeedingDevice.BIGCUTNIPPLE) 102 return "bigcut-nipple"; 103 if (code == FeedingDevice.HABERMANBOTTLE) 104 return "haberman-bottle"; 105 if (code == FeedingDevice.SIPPYVALVE) 106 return "sippy-valve"; 107 if (code == FeedingDevice.SIPPYNOVALVE) 108 return "sippy-no-valve"; 109 if (code == FeedingDevice.PROVALECUP) 110 return "provale-cup"; 111 if (code == FeedingDevice.GLASSLID) 112 return "glass-lid"; 113 if (code == FeedingDevice.HANDHOLDCUP) 114 return "handhold-cup"; 115 if (code == FeedingDevice.RUBBERMAT) 116 return "rubber-mat"; 117 if (code == FeedingDevice.STRAW) 118 return "straw"; 119 if (code == FeedingDevice.NOSECUP) 120 return "nose-cup"; 121 if (code == FeedingDevice.SCOOPPLATE) 122 return "scoop-plate"; 123 if (code == FeedingDevice.UTENSILHOLDER) 124 return "utensil-holder"; 125 if (code == FeedingDevice.FOAMHANDLE) 126 return "foam-handle"; 127 if (code == FeedingDevice.ANGLEDUTENSIL) 128 return "angled-utensil"; 129 if (code == FeedingDevice.SPOUTCUP) 130 return "spout-cup"; 131 if (code == FeedingDevice.AUTOFEEDINGDEVICE) 132 return "autofeeding-device"; 133 if (code == FeedingDevice.ROCKERKNIFE) 134 return "rocker-knife"; 135 return "?"; 136 } 137 138 public String toSystem(FeedingDevice code) { 139 return code.getSystem(); 140 } 141 142}