001package org.hl7.fhir.dstu3.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0 036 037 038import org.hl7.fhir.dstu3.model.EnumFactory; 039 040public class QuestionnaireItemControlEnumFactory implements EnumFactory<QuestionnaireItemControl> { 041 042 public QuestionnaireItemControl fromCode(String codeString) throws IllegalArgumentException { 043 if (codeString == null || "".equals(codeString)) 044 return null; 045 if ("group".equals(codeString)) 046 return QuestionnaireItemControl.GROUP; 047 if ("list".equals(codeString)) 048 return QuestionnaireItemControl.LIST; 049 if ("table".equals(codeString)) 050 return QuestionnaireItemControl.TABLE; 051 if ("header".equals(codeString)) 052 return QuestionnaireItemControl.HEADER; 053 if ("footer".equals(codeString)) 054 return QuestionnaireItemControl.FOOTER; 055 if ("text".equals(codeString)) 056 return QuestionnaireItemControl.TEXT; 057 if ("inline".equals(codeString)) 058 return QuestionnaireItemControl.INLINE; 059 if ("prompt".equals(codeString)) 060 return QuestionnaireItemControl.PROMPT; 061 if ("unit".equals(codeString)) 062 return QuestionnaireItemControl.UNIT; 063 if ("lower".equals(codeString)) 064 return QuestionnaireItemControl.LOWER; 065 if ("upper".equals(codeString)) 066 return QuestionnaireItemControl.UPPER; 067 if ("flyover".equals(codeString)) 068 return QuestionnaireItemControl.FLYOVER; 069 if ("help".equals(codeString)) 070 return QuestionnaireItemControl.HELP; 071 if ("question".equals(codeString)) 072 return QuestionnaireItemControl.QUESTION; 073 if ("autocomplete".equals(codeString)) 074 return QuestionnaireItemControl.AUTOCOMPLETE; 075 if ("drop-down".equals(codeString)) 076 return QuestionnaireItemControl.DROPDOWN; 077 if ("check-box".equals(codeString)) 078 return QuestionnaireItemControl.CHECKBOX; 079 if ("lookup".equals(codeString)) 080 return QuestionnaireItemControl.LOOKUP; 081 if ("radio-button".equals(codeString)) 082 return QuestionnaireItemControl.RADIOBUTTON; 083 if ("slider".equals(codeString)) 084 return QuestionnaireItemControl.SLIDER; 085 if ("spinner".equals(codeString)) 086 return QuestionnaireItemControl.SPINNER; 087 if ("text-box".equals(codeString)) 088 return QuestionnaireItemControl.TEXTBOX; 089 throw new IllegalArgumentException("Unknown QuestionnaireItemControl code '"+codeString+"'"); 090 } 091 092 public String toCode(QuestionnaireItemControl code) { 093 if (code == QuestionnaireItemControl.NULL) 094 return null; 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.HEADER) 102 return "header"; 103 if (code == QuestionnaireItemControl.FOOTER) 104 return "footer"; 105 if (code == QuestionnaireItemControl.TEXT) 106 return "text"; 107 if (code == QuestionnaireItemControl.INLINE) 108 return "inline"; 109 if (code == QuestionnaireItemControl.PROMPT) 110 return "prompt"; 111 if (code == QuestionnaireItemControl.UNIT) 112 return "unit"; 113 if (code == QuestionnaireItemControl.LOWER) 114 return "lower"; 115 if (code == QuestionnaireItemControl.UPPER) 116 return "upper"; 117 if (code == QuestionnaireItemControl.FLYOVER) 118 return "flyover"; 119 if (code == QuestionnaireItemControl.HELP) 120 return "help"; 121 if (code == QuestionnaireItemControl.QUESTION) 122 return "question"; 123 if (code == QuestionnaireItemControl.AUTOCOMPLETE) 124 return "autocomplete"; 125 if (code == QuestionnaireItemControl.DROPDOWN) 126 return "drop-down"; 127 if (code == QuestionnaireItemControl.CHECKBOX) 128 return "check-box"; 129 if (code == QuestionnaireItemControl.LOOKUP) 130 return "lookup"; 131 if (code == QuestionnaireItemControl.RADIOBUTTON) 132 return "radio-button"; 133 if (code == QuestionnaireItemControl.SLIDER) 134 return "slider"; 135 if (code == QuestionnaireItemControl.SPINNER) 136 return "spinner"; 137 if (code == QuestionnaireItemControl.TEXTBOX) 138 return "text-box"; 139 return "?"; 140 } 141 142 public String toSystem(QuestionnaireItemControl code) { 143 return code.getSystem(); 144 } 145 146}