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.NULL) 096 return null; 097 if (code == QuestionnaireItemControl.GROUP) 098 return "group"; 099 if (code == QuestionnaireItemControl.LIST) 100 return "list"; 101 if (code == QuestionnaireItemControl.TABLE) 102 return "table"; 103 if (code == QuestionnaireItemControl.HTABLE) 104 return "htable"; 105 if (code == QuestionnaireItemControl.GTABLE) 106 return "gtable"; 107 if (code == QuestionnaireItemControl.ATABLE) 108 return "atable"; 109 if (code == QuestionnaireItemControl.HEADER) 110 return "header"; 111 if (code == QuestionnaireItemControl.FOOTER) 112 return "footer"; 113 if (code == QuestionnaireItemControl.TEXT) 114 return "text"; 115 if (code == QuestionnaireItemControl.INLINE) 116 return "inline"; 117 if (code == QuestionnaireItemControl.PROMPT) 118 return "prompt"; 119 if (code == QuestionnaireItemControl.UNIT) 120 return "unit"; 121 if (code == QuestionnaireItemControl.LOWER) 122 return "lower"; 123 if (code == QuestionnaireItemControl.UPPER) 124 return "upper"; 125 if (code == QuestionnaireItemControl.FLYOVER) 126 return "flyover"; 127 if (code == QuestionnaireItemControl.HELP) 128 return "help"; 129 if (code == QuestionnaireItemControl.QUESTION) 130 return "question"; 131 if (code == QuestionnaireItemControl.AUTOCOMPLETE) 132 return "autocomplete"; 133 if (code == QuestionnaireItemControl.DROPDOWN) 134 return "drop-down"; 135 if (code == QuestionnaireItemControl.CHECKBOX) 136 return "check-box"; 137 if (code == QuestionnaireItemControl.LOOKUP) 138 return "lookup"; 139 if (code == QuestionnaireItemControl.RADIOBUTTON) 140 return "radio-button"; 141 if (code == QuestionnaireItemControl.SLIDER) 142 return "slider"; 143 if (code == QuestionnaireItemControl.SPINNER) 144 return "spinner"; 145 if (code == QuestionnaireItemControl.TEXTBOX) 146 return "text-box"; 147 return "?"; 148 } 149 150 public String toSystem(QuestionnaireItemControl code) { 151 return code.getSystem(); 152 } 153 154}