![](/hapi-fhir/images/logos/raccoon-forwards.png)
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 QuestionnaireItemControlEnumFactory implements EnumFactory<QuestionnaireItemControl> { 037 038 public QuestionnaireItemControl fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("group".equals(codeString)) 042 return QuestionnaireItemControl.GROUP; 043 if ("list".equals(codeString)) 044 return QuestionnaireItemControl.LIST; 045 if ("table".equals(codeString)) 046 return QuestionnaireItemControl.TABLE; 047 if ("htable".equals(codeString)) 048 return QuestionnaireItemControl.HTABLE; 049 if ("gtable".equals(codeString)) 050 return QuestionnaireItemControl.GTABLE; 051 if ("atable".equals(codeString)) 052 return QuestionnaireItemControl.ATABLE; 053 if ("header".equals(codeString)) 054 return QuestionnaireItemControl.HEADER; 055 if ("footer".equals(codeString)) 056 return QuestionnaireItemControl.FOOTER; 057 if ("text".equals(codeString)) 058 return QuestionnaireItemControl.TEXT; 059 if ("inline".equals(codeString)) 060 return QuestionnaireItemControl.INLINE; 061 if ("prompt".equals(codeString)) 062 return QuestionnaireItemControl.PROMPT; 063 if ("unit".equals(codeString)) 064 return QuestionnaireItemControl.UNIT; 065 if ("lower".equals(codeString)) 066 return QuestionnaireItemControl.LOWER; 067 if ("upper".equals(codeString)) 068 return QuestionnaireItemControl.UPPER; 069 if ("flyover".equals(codeString)) 070 return QuestionnaireItemControl.FLYOVER; 071 if ("help".equals(codeString)) 072 return QuestionnaireItemControl.HELP; 073 if ("question".equals(codeString)) 074 return QuestionnaireItemControl.QUESTION; 075 if ("autocomplete".equals(codeString)) 076 return QuestionnaireItemControl.AUTOCOMPLETE; 077 if ("drop-down".equals(codeString)) 078 return QuestionnaireItemControl.DROPDOWN; 079 if ("check-box".equals(codeString)) 080 return QuestionnaireItemControl.CHECKBOX; 081 if ("lookup".equals(codeString)) 082 return QuestionnaireItemControl.LOOKUP; 083 if ("radio-button".equals(codeString)) 084 return QuestionnaireItemControl.RADIOBUTTON; 085 if ("slider".equals(codeString)) 086 return QuestionnaireItemControl.SLIDER; 087 if ("spinner".equals(codeString)) 088 return QuestionnaireItemControl.SPINNER; 089 if ("text-box".equals(codeString)) 090 return QuestionnaireItemControl.TEXTBOX; 091 throw new IllegalArgumentException("Unknown QuestionnaireItemControl code '" + codeString + "'"); 092 } 093 094 public String toCode(QuestionnaireItemControl code) { 095 if (code == QuestionnaireItemControl.GROUP) 096 return "group"; 097 if (code == QuestionnaireItemControl.LIST) 098 return "list"; 099 if (code == QuestionnaireItemControl.TABLE) 100 return "table"; 101 if (code == QuestionnaireItemControl.HTABLE) 102 return "htable"; 103 if (code == QuestionnaireItemControl.GTABLE) 104 return "gtable"; 105 if (code == QuestionnaireItemControl.ATABLE) 106 return "atable"; 107 if (code == QuestionnaireItemControl.HEADER) 108 return "header"; 109 if (code == QuestionnaireItemControl.FOOTER) 110 return "footer"; 111 if (code == QuestionnaireItemControl.TEXT) 112 return "text"; 113 if (code == QuestionnaireItemControl.INLINE) 114 return "inline"; 115 if (code == QuestionnaireItemControl.PROMPT) 116 return "prompt"; 117 if (code == QuestionnaireItemControl.UNIT) 118 return "unit"; 119 if (code == QuestionnaireItemControl.LOWER) 120 return "lower"; 121 if (code == QuestionnaireItemControl.UPPER) 122 return "upper"; 123 if (code == QuestionnaireItemControl.FLYOVER) 124 return "flyover"; 125 if (code == QuestionnaireItemControl.HELP) 126 return "help"; 127 if (code == QuestionnaireItemControl.QUESTION) 128 return "question"; 129 if (code == QuestionnaireItemControl.AUTOCOMPLETE) 130 return "autocomplete"; 131 if (code == QuestionnaireItemControl.DROPDOWN) 132 return "drop-down"; 133 if (code == QuestionnaireItemControl.CHECKBOX) 134 return "check-box"; 135 if (code == QuestionnaireItemControl.LOOKUP) 136 return "lookup"; 137 if (code == QuestionnaireItemControl.RADIOBUTTON) 138 return "radio-button"; 139 if (code == QuestionnaireItemControl.SLIDER) 140 return "slider"; 141 if (code == QuestionnaireItemControl.SPINNER) 142 return "spinner"; 143 if (code == QuestionnaireItemControl.TEXTBOX) 144 return "text-box"; 145 return "?"; 146 } 147 148 public String toSystem(QuestionnaireItemControl code) { 149 return code.getSystem(); 150 } 151 152}